Reputation: 2171
Can anyone please help me to know how to open an excel sheet in Android? Thanks
Upvotes: 1
Views: 9327
Reputation: 9507
In android, jxl.jar is used to create excel sheet and it is available at here and you can create excel sheet by using following code.
File root = Environment.getExternalStorageDirectory();
File gpxfile = new File(root, sFileName);
FileWriter writer = new FileWriter(gpxfile);
writer.append("NAME");
Upvotes: 0
Reputation: 1486
Use the below mentioned code and try:
File file = new File(Environment.getExternalStorageDirectory()+ "/filepath/" + filename);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),"application/vnd.ms-excel");
startActivity(intent);
Upvotes: 0
Reputation: 40391
There's not much support around for MS formats in android. All the forums are full of questions about android support for jexcelapi or Apache POI, but no answers to be found. You may give it a shot, but don't have high expectations.
If you have control over the files, just use a csv format or save them as html
Upvotes: 1