Jai Android
Jai Android

Reputation: 2171

How to open excel sheet in Android?

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

Upvotes: 1

Views: 9327

Answers (4)

thoredge
thoredge

Reputation: 12601

You could try out jexcelapi or apache poi.

Upvotes: 0

Hardik Joshi
Hardik Joshi

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

Ankit Adlakha
Ankit Adlakha

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

Aleadam
Aleadam

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

Related Questions