What is the preferred way of importing/exporting data into Android app

1.6k views Asked by At

I am making a vocabulary app to learn hungarian. The app has a database with words in two languages. The words should be entered as I meet them in the daily life and then I use the app to exercise the words.

Now I want to be able to enter the words on the computer, and import it to my app. Or share my words with a friend and thus export it from the app somehow.

As a windows programmer I am used to think in terms of files. I would make a simple file format or just use csv or xml files. But I see now when making Android apps that the file approach is not the thing. I don't get any file dialogs included with the api and when I search for how to import files it is hard to find an answer.

So my question is: What is the android/touch way of importing/exporting this kind of data?

EDIT: To clarify my question: Many windows programs have a way of importing data when you press File->Import and you get a file dialog where you can choose the file with the data you want to import. Since I don't find any file dialog or many examples on how to import files I recon there must be another more convenient way in android/touch devices. Maybe something with Content Providers. My vocabulary app is just an example.

2

There are 2 answers

0
TajammulShah On

I did not understand your question clearly but my suggestion to you is, if you have large amount of data:for example saving data of an employ,so you can use the Sqlite Database in android and connect it to your Desktop Database (for example you can create in xampp).Then You can send and recieve data.

0
desidigitalnomad On

Since you want to allow the users to enter the words in a Spreadsheet, you should give them an option to import data from Excel sheets, provided they create the sheets in a format specified by you. You can learn how to read XLS files programmatically online, here are some references:

http://www.cuelogic.com/blog/creatingreading-an-excel-file-in-android/

How to read data from XLS (Excel) file [Java, Android]

Read Excel file in android

After parsing the XLS sheet, you can insert them in an SQLite database. You can have all you want to know about SQLite in Android here:

http://developer.android.com/reference/android/database/sqlite/SQLiteOpenHelper.html

http://www.vogella.com/tutorials/AndroidSQLite/article.html