3

My application generates data and i want to share this data, like transfer to my PC and work or send it to others as excel sheet.

Can we store data from an android application to a Excel sheet programatically ? Then how do we open and Excel file and write to it ?

m4n07
  • 2,267
  • 12
  • 50
  • 65

2 Answers2

5

In theory, libraries like Apache POI and JExcel should work on Adroid but there are some issues with them at this point.

Only option is to generate XL that can be read by Excel. Steps are:

  1. Create an Excel file on PC with formatting that you need
  2. Save that file as XML, Excel will insert Tags for formatting/ formulas
  3. Write java code to generate similar XML file on Android
  4. On Android, save this XML file on SD Card
  5. Transfer the XML to PC and open that in Excel
Shamit Verma
  • 3,839
  • 23
  • 22
2

Take a look at this tutorial, How to create file in SD-Card.

bharath
  • 14,283
  • 16
  • 57
  • 95
hfitzwater
  • 544
  • 3
  • 11
  • @Mudassir: It's because the example shows how to create CSV file on SD card, that is indeed very similar to what **m4n07** was asking about... – shadyyx Sep 16 '11 at 18:05