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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T08:38:44+00:00 2026-06-15T08:38:44+00:00

I will be releasing an update for my app with a new data structure,

  • 0

I will be releasing an update for my app with a new data structure, therefore if a user is updating my app I need to update their current data. So I was wondering how can I programatically check if the user updated my app or installed a new copy (if a new copy is installed I don’t need to update anything) ?

  • 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-06-15T08:38:45+00:00Added an answer on June 15, 2026 at 8:38 am

    SQLite

    If your data is in an SQLite database, you can implement code in SQLiteOpenHelper.onUpgrade().

    Checking previous version

    If not, you need some kind of way to check the previous version that was open on the device. Something like:

    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    // Use SharedPreferences to store something like "LAST_VERSION_RUN" = pInfo.versionName
    

    Then, you can check if previous version is not equal to current version. Of course, this kind of code has to be in previous versions, also. There is no way to implement, once an app is already in the wild, a code that will detect whether an app has been upgraded.

    Checking current version

    I suppose what you could do in this case is detect the app version, and then set a flag to not update the data schema again. So, let’s say your app version was 1.0.2, and is now 1.0.3:

    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    if (pInfo.versionName.equals("1.0.3") && /* some SharedPreference value */ == false) {
        // upgrade
        // set SharedPreference value to true
    }
    

    I think that’s going to be the best way to implement this if you’re not using SQLite.

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

Sidebar

Related Questions

In my experience, releasing a Windows Phone 7 app/game update will erase the isolated
I am working on releasing an app that will greatly benefit from using the
Here I've got a question concerning releasing update of the application in app store.
I will be releasing my Air/Flex application soon, but I am pretty sure there
So I have this SQL table that I need to update. Now we use
I want to create an MSI installer containing three apps. I will be releasing
I'm making an app that uses a video feed. There will be several UI
So I am working on a vital update to an app I have on
Quite soon I will be releasing my website project and, before it sees the
I'm still pretty new to Cocoa/Objective-C, so I hope I can explain my question.

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.