How to open excel sheet in Android?
Can anyone开发者_Python百科 please help me to know how to open an excel sheet in Android? Thanks
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
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");
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);
You could try out jexcelapi or apache poi.
精彩评论