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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T03:54:39+00:00 2026-05-24T03:54:39+00:00

My Android App’s sqlite is synchronized with a back-end server database. i want that

  • 0

My Android App’s sqlite is synchronized with a back-end server database.
i want that when the database is deleted for some reason (e.g, app is uninstalled) to update my server that he should remove rows from its table.
i’m looking for some kind of a handler, but i can’t find anything like onDatabaseDelete().

private static class DatabaseHelper extends SQLiteOpenHelper {

    DatabaseHelper(Context context) {
        super(context, DBAdapter.DATABASE_NAME, null, DBAdapter.DATABASE_VERSION);
    }

    @Override
    public void onCreate(SQLiteDatabase db) {
    }

    @Override
    public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
    }
}

i guess as a workaround i could do this when the app is uninstalled, but this is less “elegant”.

Can anyone please tell me if there’s a way of doing it in an elegant way (from a db handler and not when the app is uninstalled)?

EDIT:
Is it possible to put a handler on the app uninstall? is it possible to run a few actions before the app is uninstalled?

  • 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-24T03:54:41+00:00Added an answer on May 24, 2026 at 3:54 am

    The application database file is located at /data/app_package/databases. When application is uninstalled all it’s private data is removed (/data/app_package). You can’t receive notification when the application is uninstalled or when it’s private data is deleted. A simple workaround will be every time the application starts to send keepAlive message to the server to indicate that it’s still alive. On the server side you’ll delete records for which you did’t receive keepAlive messages for more that some period ( it depends on your data ). You’ll come up with two problems –

    1. When app is uninstalled it’s data will be deleted on the server after one period of time (this can overload your server)
    2. For app that is not started for a period of time – the data on the server will be deleted (if you didn’t start the for given period of time you can consider that it’s uninstalled)
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

My Android app stores its SQLite database on the SD card, so that when
My android app needs to fetch some info from a php server that hosts
I am writing an android app. I want to pass some data across the
My android app works on landscape mode. I have a listview that contains some
My Android app is crashing with this error: E/AndroidRuntime( 315): Caused by: android.database.sqlite.SQLiteException: bind
I've got an android app using a local sqlite database. private SQLiteDatabase mDb; when
I'm building an Android app and I want to copy the text value of
We have an Android app and a Web Service. We want to download part
I've got an Android app which has a periodic background Service. I want this
I want my Android app to take a picture, as part of something larger

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.