1

Is there a way i could have a spreadsheet of data on my computer, and have an app that's able to pull information off of that? I just need a way for my app to be able to get information from something stored on my computer. It will be easier than storing everything on the app itself, especially when i need to update the information. Oh and could you please explain how to do so, or point me towards a tutorial please.

ThatBoiJo
  • 199
  • 1
  • 13
  • You should check out http://firebase.com. Online JSON data (can be transferred the same as a spreadsheet) and used from there! – David Ziemann Jun 25 '13 at 21:05
  • You could check this out and try it - http://stackoverflow.com/questions/12478582/how-to-connect-android-app-with-google-spreadsheet?rq=1 – VikramV Jun 25 '13 at 22:32

3 Answers3

1

Assuming you are going to be using some sort of web interface to transfer the spreadsheet data from your personal directory to the app, you could use a scripting language such as Perl.

If you upload an .xlsx file using ftp to your web site directory you could then write a Perl script that uses Spreadsheet::XLSX which could be run from your app.

From your app you could use:

uriString = "http://yourwebsite.com/cgi-bin/myScriptToGrabXlsxData.pl"; 
....        
new SendTableRequest().execute(uriString);
....
URI uriResID = URI.create(uriString[0]);
HttpPost httpPostMethod = new HttpPost(uriResID);   
....
response = httpClient.execute(httpPostMethod);

HttpEntity entity = response.getEntity();

if (entity != null){
     InputStream inStream = entity.getContent();
     result = convertStreamToString(inStream);
....
    (Do stuff with your stringified data as you see fit)

I omitted a lot of steps, but the answer isn't very dependent on what implementation you choose(Perl vs Python vs PHP vs ...) or how you return the data(strings vs JSON vs ...), the data flow is the most important part to hammer out before you dive into coding.

thomas.cloud
  • 863
  • 12
  • 29
0

I think that the easiest way to do this, without having to set up your own web app, is to upload your spreadsheet to Google Docs, and then use the Google Docs API to access it from your Android app.

Then, you can either edit it as needed in Google Docs, or modify it locally, and re-upload it.

GreyBeardedGeek
  • 26,236
  • 2
  • 39
  • 58
0

Apache POI is the ticket for taking apart Excel spreadsheets. It isn't fully featured, but for most of your run of the mill spreadsheets it does the trick.

It is rather dense, I'll warn you, and not wonderfully documented, but it works. We run several spreadsheet parsers, unfortunately, and it works a treat. Also works for generating spreadsheets.

Since it would seem that you are going to use it as some sort of configuration file might I also recommend that you repackage it into some thing less... bulky than a spreadsheet after you pull out the values. YAML, JSON, even XML are all fine choices compared to a configuration spreadsheet shipping with an app.

electroCutie
  • 154
  • 1
  • 7