Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3598660
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:16:11+00:00 2026-05-18T20:16:11+00:00

I have basically finished developing an android app that makes use of SQLite databases

  • 0

I have basically finished developing an android app that makes use of SQLite databases that I copy to the user data area on the device eg /data/data/com.company.app/databases/users.db

I am unsure how the marketplace app update procedure takes place and am also unsure as to how I could test it.

I currently check whether the database exists on the device and copy it if it doesn’t (generally only occurs on first ever launch). What happens if I have a new version of the database in my updated app? Will an marketplace update wipe user data so that it will copy my new database in on next launch?

What happens in the future if I make database changes/add records/etc and package this with the new app? Will this database not overwrite the old database?

Otherwise, to avoid copying and overriding the databases from the app bundle on every launch is there a way to check the size and date of the database files and only copy if the database in the bundle is newer?

If anyone needs clarification please ask.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T20:16:12+00:00Added an answer on May 18, 2026 at 8:16 pm

    I am doing something similar. What I did is set the database version, and then when I check if the database exists, I also to make sure it’s the correct version. If it’s not, I save user favorites from the database, wipe and recopy my db, and then put back user favorites.

    This is my on upgrade

        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
        if (oldVersion == 2) {
    
            System.out.println("Performing upgrade!");
            openDataBase();
            // save the old favorites
            Cursor mCursor = getFavorites();
            ArrayList<Stop> favs = allCursorToStops(mCursor);
            mCursor.close();
    
            deleteRecreate(db);
    
            openDataBase();
    
            for (int i = 0; i < favs.size(); i++)
                setFavorite(favs.get(i));
    
            close();
    
        } else {
    
            deleteRecreate(db);
    
        }
    }
    

    Here is where I check existence/if need to upgrade etc

        boolean dbExist = checkDataBase();
    
        if(dbExist){
            // check if we need to upgrade
            openDataBase();
            int cVersion = myDataBase.getVersion();
            close();
            if(cVersion != VERSION)
                onUpgrade(myDataBase, myDataBase.getVersion(), VERSION);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have basically finished developing an android app that makes use of SQLite databases
I have a game running on android. basically, it's structure is like lunarlander I
I have read plenty of questions and answers here about weak linking, checking if
A few friends and myself have been working on an XNA RPG once a
I will try to explain my problem with as little code as possible. Basically
I have been following this example http://demos.telerik.com/aspnet-mvc/grid/selectionclientside?theme=webblue , and have finished it for my
So right now I have the code $('[name=dept]').live('change',function() { $('#course').load('getCla.php?dept='+$(this).val()); $('select.speedC').selectmenu({style:'dropdown',maxHeight: 250}); }); Basically,
I have a problem analogous to the one described here: Prevent fork() from copying
I am basically quite sure this pattern must exist and possess a name... for
Ive been stuck on this for a while now so any help will be

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.