0

I am new to android development. I have two questions:

  1. I have an Excel sheet as a database for my data. I want to display that data in my android application. How can I do it? Do I have to use SQLite database? If yes, then how?

  2. If there are any changes in the Excel sheet in the future, then how would be these changes be reflected in the application?

Thanks in advance for all the help.

Gaffi
  • 4,307
  • 8
  • 43
  • 73
Smit Davda
  • 638
  • 5
  • 15
  • some more research on the matter would make easier for you to get help. It seems like you didnt even look for a solution just decided that asking here would be easier. People tend to be more helpful when they see you have tried yourself. – Gabriel Netto May 21 '13 at 12:16

2 Answers2

1
  1. To read excel file in android, you should use some excel library such as JExcelApi, Apache POI. after reading it, you can write them into SQLite dababase to reduce excel parsing time.

  2. when you parse excel file, you save the file's last modified time to text file or preferences and whenever your app runs, comare them and update it if last modified time is different.

Tommy
  • 366
  • 3
  • 3
0

WelCome to Stack overflow!

I have an excel sheet as a database for my data.I want to display that data in my android application.How can i do it? do i have to use sqlite database?if yes then how?

Here is example how read .xls file from server (you can also read file from SDCARD)

assume your .xls is like below

enter image description here

then you have to create sqlite database and create table with field(Item Number,Description,Price,Quantitiy) you can also create fields depend on .xls file.

after read data from .xls insert in to sqlite database

Note: with xls some times its not working well if file format is not well. i have developed app which work with xls,csv. so, i ll sagest you to use csv insted of xls which is best option. how read csv file and how write csv file.


And if there are any changes in the excel sheet in the future then how would be these changes be reflected in the application

any changes in xls then you have to update you sqlite database.(its easy if you have developed code to create table dynamically depend on xls file column then its good)

How to use sqlite in android Basic

How to use sqlite in android.

Community
  • 1
  • 1
Dhaval Parmar
  • 18,812
  • 8
  • 82
  • 177
  • Thanks dhawal for your answer.Sorry to be responding late.I am currently using the reading of the .xls file from the server but i am getting an error: Could not find class 'org.apache.poi.hssf.usermodel.HSSFWorkbook', referenced from method com.example.readexcelfromserver.ReadExcelFromUrlActivity$ExcelURL.parseExcel – Smit Davda Jun 02 '13 at 11:38
  • I have already included all the following jar files: 1)poi-3.9-20121203 2)poi-examples-3.9-20121203 3)poi-excelant-3.9-20121203 4)poi-ooxml-3.9-20121203 5)poi-ooxml-schemas-3.9-20121203 6)poi-scratchpad-3.9-20121203 After adding all these files i am getting the above mentioned error.if you could help me with that. – Smit Davda Jun 02 '13 at 11:44