0

I have an application with like 400 records in the database, I have splash screen in the beginning, I have AsyncTask inserting the data in the database and onPostExecute() I close the splash screen and the application goes. Ofcourse I want this to happen only one time so when the user open the app in another time he don't occur duplication of data. So I created boolean SharedPrefernces for first visit. Now the question is, suppose I updated the application in the market, the user will have to replace the application, does the sharedprefernces value get back to the default?

I know that I have to insert the data inside onCreate() of the database handler/helper but it takes time to insert 400 records with many fields, so I made the splash screen with background execution.

Please tell me if what i'm doing is OK or I need to change the structure and put the insertion inside onCreate().

Thank you.

1 Answer 1

2

SharedPreferences and all of the app's data (such as sql databases) are maintained through app upgrades. The only time that data will be deleted or reset is if the user uninstalls the app.

Sign up to request clarification or add additional context in comments.

2 Comments

If you have a reference for that, please provide it.
I have a handful of apps in production, they all work this way. Also: stackoverflow.com/questions/3860823/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.