I have an app where I’ve created the exact database schema that a client wants, so that I can import a CSV file – the database contents – into the application, then compile it to an APK and push it to the marketplace.
How is this done?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Ship the
CSVfile as asset resource (store it intoassetsfolder) then copy it into database directory in the memory (don’t forget to add permissions):You do this for the first run of the app. Bear in mind that you need to test whether that file existed before (i.e. application has been run and the CSV file is copied in database directory). If not, then do the copy, if so, then do nothing, just proceed with operations, so you prevent losing data (if you copy on every start, you lose data). I hope this gives you the general idea.