1

Can anyone please help me to know how to open an excel sheet in Android? Thanks

Jai Android
  • 2,131
  • 10
  • 38
  • 55

4 Answers4

1

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

Aleadam
  • 40,203
  • 9
  • 86
  • 108
0

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");
Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
Hardik Joshi
  • 9,477
  • 12
  • 61
  • 113
0

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);
nhahtdh
  • 55,989
  • 15
  • 126
  • 162
Ankit Adlakha
  • 1,436
  • 12
  • 15
0

You could try out jexcelapi or apache poi.

Infinite Recursion
  • 6,511
  • 28
  • 39
  • 51
thoredge
  • 12,237
  • 1
  • 40
  • 55