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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:06:24+00:00 2026-05-29T07:06:24+00:00

I’m working on building out a settings page for my Android app. For this

  • 0

I’m working on building out a settings page for my Android app. For this I am using the PreferenceActivity and its functionality. The saving/editing of the settings is the simple part but I’m wondering what the best way to access the settings through the app is? I could of course access the SharedPrefs every time I need to, however, this seems inefficient to me…especially if since some of the settings could be access fairly frequently.

I’m wondering if it is worth creating a class that loads all of the settings when the app is opened and is then accessible through out the app via the Application class. This class would then be updated every time the settings are changed.

Is it worth taking this approach or is there a better way? Or is it not worth keeping the settings in memory throughout the lifetime of the app?

Thanks

  • 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-29T07:06:25+00:00Added an answer on May 29, 2026 at 7:06 am

    The entire purpose for SharedPreference is what this is designed for. They are efficient to save/change the settings of your app, by just retrieveing it through your context. I dont see WHY you would keep it in memory, but you’d keep it in the XML key/value pairs that are SharedPrefereces.

    Just use it, its what the android engineers would want you to do.

    Just a snippet from the SDK:

    The SharedPreferences class provides a general framework that allows
    you to save and retrieve persistent key-value pairs of primitive data
    types. You can use SharedPreferences to save any primitive data:
    booleans, floats, ints, longs, and strings. This data will persist
    across user sessions (even if your application is killed).

    By primitives, it means lightweight variables that can be stored/committed.

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

Sidebar

Related Questions

We're building an app, our first using Rails 3, and we're having to build
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I am using Paperclip to handle profile photo uploads in my app. They upload
I'm making a simple page using Google Maps API 3. My first. One marker
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
Basically, what I'm trying to create is a page of div tags, each has
this is what i have right now Drawing an RSS feed into the php,

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.