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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:14:56+00:00 2026-06-17T09:14:56+00:00

We have a strange bug. Our App will loose it’s data (stored in SQLite)

  • 0

We have a strange bug. Our App will loose it’s data (stored in SQLite) if the battery runs out but it doesn’t if we kill the application forcefully and then the battery runs out.

We’re not sure what could cause this.

EDIT 1:

WHAT DOES IT MEAN TO LOOSE THE DATA?

  1. When the user registers we save his username etc.
  2. When the app is closed, forced-closed and the user opens the app again the username is there
  3. When the battery runs out and the app is running in foreground. After the battery is recharged and the user opens the app again, the username is gone.

How are objects stored:


 public Void perform(SQLiteDatabase db) {
                final ConfigEntry entry = new ConfigEntry(property, value);

                if(contains(property)) {
                    db.update(ConfigEntry.TABLE_NAME, databaseAdapter.convertToContentValues(entry), ConfigEntry.COLUMN_NAME + " = ?", new String[] { property });
                } else {
                    db.insertOrThrow(ConfigEntry.TABLE_NAME, null, databaseAdapter.convertToContentValues(entry));
                }
                return null;
            }
        });

So basically db.insertOrThrow is called.

This is how we initialize the database:


public  S doInTransaction(TransactionTask task) {
        DatabaseHelper mDbHelper = DatabaseHelper.getInstance(mContext);
        SQLiteDatabase mDb = mDbHelper.getWritableDatabase();
        mDb.setLockingEnabled(true);
        mDb.beginTransaction();
        try {
            S result = task.perform(mDb);
            mDb.setTransactionSuccessful();
            return result;
        } finally {
            mDb.endTransaction();
        }
    }

  • 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-17T09:14:57+00:00Added an answer on June 17, 2026 at 9:14 am

    Thanks a lot for all the Help, we finally found the answer.

    We are encrypting our database using a user password and salting the password with the MAC adddress of the device.

    What happened is that sometimes when the user ran out of battery after the boot, when our app was ran and we requested for the MAC address it failed because the network card it’s still disabled or something. In that case we created a new salt which when trying to read the DB would fail.

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

Sidebar

Related Questions

I have found what appears to be a strange bug with sqlite. I have
I have a strange bug in a multithreaded app: public class MyClass { private
I have a strange bug in my app when my UI flow is as
Had a strange bug appear today. In our app, on one file, all the
I have another strange bug which I cannot figure out. I try to create
I have a very strange bug in a shipping iPad/iPhone app that I can't
I have a strange bug I cant quite figure out, I've built an accordion
I have isolated very strange bug from our current project: index.html (demo) and iframe.html
I have a strange bug. I launch a PHP Unit test Suite. At the
I have a strange bug happening in my script. I have 3 balls on

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.