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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T06:42:22+00:00 2026-06-09T06:42:22+00:00

In my application, I store sensitive user data (like bank details) and the user

  • 0

In my application, I store sensitive user data (like bank details) and the user can lock each of the details by using a separate password. I want the user to set a master password as soon as he runs the application for the first time after installation, so that he may recover data by entering this master password in case he forgets a password.

So, when the application is run for the first time after installation, there would be a pop-up asking him to set the master password and the user needs to set the password to continue further.

But, when the application would be started after a phone restart or maybe after closing the application, he should not get the pop-up.

The pop-up should come once and only once when the application is run for the first time after installation.

Assuming setMasterPassword() is the function which creates the dialog, where do I call this function on first run ?

Does android have any parameters to determine that the app has been newly installed ?

Or should I just use Preference Variables to check this ? {Something like initializing the counter in the PreferenceVariable as 0 and then checking this value in onCreate() and calling setMasterPassword() if and only if the counter is 0 and then incrementing the counter by 1 so that it would never be called again.}

What would be the best way to do this ?

Thanks in advance!

  • 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-09T06:42:23+00:00Added an answer on June 9, 2026 at 6:42 am

    I have also tried to figure out if there is a “fresh install” boolean, but it seems there is nothing like that, so you should go for a shared preference, like the folk did here.

    PS: By the way, it’s a duplicate of that question.

    PS2: Keep in mind, if the user deletes all the stored information of your application, the check will also be erased and thus you’ll be able to enter this again.

    How to improve your information security:

    1. Store the user’s information along with some control bytes (a random number, a specific string, whatever) and encrypt this with the user’s password.
    2. Anytime you need the user’s information, grab that file, try to decrypt its content with the user’s password (asked each time)
    3. Check for the control bytes (a substr() will suffice, probably). If they’re the same, then grab the information. If they’re not, prompt again.

    This way, you get some benefits:

    • You don’t store the user’s password anywhere. SharedPreferences won’t store this, just the “firstTime” variable.
    • If the user dumps the application’s information, putting again a password won’t reduce your information.
    • Opening that file from an explorer will only show a bunch of numbers, symbols and probably non-readable bytes that will mostly break the editor.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In an application I want to store sensitive data (which can be arbitrarily large)
Hey, I want to store application configuration data. Currently, I'm using INIs but they
I need a way to store application-level data (i.e. cross user sessions) in ASP.NET.
i am using coredata in my application to store and retrieve values.i want to
I'm using application level encryption to protect sensitive data. I need to encrypt the
I'm developing an application which will be storing user sensitive data. My issue is
I'm thinking of writing a CouchDB-backed application that will store sensitive data. Is it
I'm building an application that needs to store sensitive information, which means the data
What do you advise to store custom sensitive data within a Spring MVC application
To store application settings, I am using the Settings tab in the project properties.

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.