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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:39:31+00:00 2026-06-11T16:39:31+00:00

I did an app that copy a file in the app data folder, but

  • 0

I did an app that copy a file in the app data folder, but I need that when I overwrite my app with a new version the data folder must be deleted.

How can I do it?

  • 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-11T16:39:33+00:00Added an answer on June 11, 2026 at 4:39 pm

    Edit: I misunderstood. So the question is, you want your app to detect that it’s installed a new version, and delete the file?

    There’s no way to have the action performed on install, but you can have it performed on the first run of the new version of your application. When it runs, do the following.

    3 steps:
    -When your app is installed, store a SharedPreference with the current version of your app. You can either hardcode this or pull it from PackageManager using:

    PackageInfo pInfo = getPackageManager().getPackageInfo(getPackageName(), 0);
    version = pInfo.versionName;
    

    -Every time your app starts, check that SharedPreference against the current version of the application. If they match, do nothing.

    -If they don’t match, there’s a new version of your app on the device! Delete the file you want to delete, and update the SharedPreference to contain the new version number of your app.

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

Sidebar

Related Questions

I'm writing a Cocoa app that will need access to multiple file transfer protocols,
I can write an app that would copy all input from cin into a
I believe that I did everything necessary to change my app for ipad (was
In my app, I am upgrading from Cocos2D version 1.10->2.0-rc0a. So I did everything
I tried searching, but did not find a specific post that could answer my
How can I specify that Excel uses the .NET framework version 2.0 when running
I'm new to ASP.NET (did some classic ASPs back in the day, but my
I've inhereted a rails app that uses Solr, which is new to me. All
I am using push notifications module. One of my friend did an app for
My app was working and I did not change a single thing in the

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.