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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T18:59:18+00:00 2026-05-27T18:59:18+00:00

How to make Preferences items with programmatically filled values (like: Version, Model number…)?

  • 0

How to make Preferences items with programmatically filled values (like: Version, Model number…)?

  • 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-27T18:59:19+00:00Added an answer on May 27, 2026 at 6:59 pm

    You can set the preferences within you code, and check if it already is filled before you fill it. As long as you do not give users access to change this information, all they can do is “clear local data”, which will cause the program to re-fill the data if you do it right.

    I use this technique to store unique IDs for the device, who is logged in, etc. The user doesn’t even (and should never) know what I keep track of, all they know is they have a smooth program that does what they need it to do.

    Example:

    SharedPreferences settings = context.getSharedPreferences("preferanceName", 0);
    SharedPreferences.Editor editor = settings.edit();
    int value = foo;
    editor.putInt("ValueToStore", value);
    editor.commit();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want the user to be able to make some preferences like colors, prefered
How do I make preferences dialog to open up on a particular page? Doing
To make a JavaScript class with a public method I'd do something like: function
I would like to allow the user to enter (a non-predetermined amount of) values
In my android app I receive data as json like this: _playLists:[{name:Playlist 1, items:[{name:Poza
How can I make my list items appear horizontally in a row using CSS?
I'm trying to add preferences to my app but cant make it work. Here
For a background app (LSUIElement=1), what's the most elegant way to make its 'preferences'
Is there anyway I can make the process of adding references to C# projects
I'm trying to make sure some data is auto-deleted when there's no more references

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.