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

  • Home
  • SEARCH
  • 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 succumbed to the fact that if you are a hardcore computer
Well basically I have this script that takes a long time to execute and
I'm developing a small application using Blend, basically what I have in my application
I basically have an application that has, say 5 threads, which each read from
I have a signal that blocks SIGINT and basically says Sorry, you can't quit.\n
I have a new web app that is packaged as a WAR as part
I have basically two separate sites, a SharePoint collaboration site, and an ASP.Net application
I basically have a page which shows a processing screen which has been flushed
I basically have the following flow: XML -> JSON -> Spring MVC -> jsp
I am looking in to ways to enable a site to basically have something

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.