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 3996992
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T07:20:48+00:00 2026-05-20T07:20:48+00:00

I found many tutorials on how to deploy a SQLite Database together with an

  • 0

I found many tutorials on how to deploy a SQLite Database together with an android app. I also found out, that I cannot delete files from the assets folder during runtime, because the .apk is signed.
Now I want to offer an updated database for my app every week. My plan was to update the apk, and publish it at the marketplace. I obviously don’t want to copy the database with every program start from the asset folder into the application’s database folder. I tried comparing the filesize to find out if the new database is bigger than the old one. But it seems if you don’t add or change much data, the size stays the same.
So my question is: What is a smart way to copy the database only after the first install or after an application update?

(I’m pretty new to android development so forgive me if I’ve overseen the maybe terribly obvious solution. Usually I try to find my answers before I ask questions. But here I just couldn’t find a solution.)

  • 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-20T07:20:48+00:00Added an answer on May 20, 2026 at 7:20 am

    Answer is, you don’t have to. Suppose you use the SQLiteOpenHelper to implement your database, you have two overrides:

    onCreate(SQLiteDatabase db);
    onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion);
    

    These pretty much enough to handle all the issue. When you create your openhelper, you need to supply the ‘required’ database version to it. It will auto detect the Device, whether it previously has your app’s db or not. So, there will be three possible situation:

    1. No Db is found (Most probably it’s a clean install of your app) => call onCreate()
    2. Db is found and match version => none of the above override will call
    3. Db is found but version lower than the desired one (Suppose you need change in db structure after updating your app) => call onUpgrade()

    In case of you update your app, but the structure of db need not to be changed, (2) will happens and the db and data will remains.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am relatively new to assembly language. I have found so many tutorials that
Although there are many tutorials out there, I've found it really difficult to implement
I've been messing with Android for a couple of weeks, i found many tutorials
I found many tutorials on youtube which tell us, how to use AxWindowsMediaPlayer and
I have found many core data with nsfetchedresultscontroller tutorials, but none of them are
I read many question about that and tutorials, but the only one executed, and
In many articles, tutorials, docs, have read so far, that we call startService() or
Instead of installing User-Scripts I found many tutorials on the web to add it
I've been searching lots and found many tutorials for Javascript / jquery on click
I have found many tutorials about using Windows Server 2003 as a development machine,

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.