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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:04:22+00:00 2026-05-26T16:04:22+00:00

In my current Android app I have several settings stored in SharedPreferences and one

  • 0

In my current Android app I have several settings stored in SharedPreferences and one object which handles access to them. I now wonder if it makes sense to cache the values or if doesn’t mater much accessing them like:

public final boolean isxxxEnabled() {
    return preferences.getBoolean("xxx", false);
}

instead of

public final boolean isxxxEnabled() {
            // check if value changed
            // if not, check if value is cached
            // decide whether to return cached or new
            // cache value
    return 
}
  • 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-26T16:04:23+00:00Added an answer on May 26, 2026 at 4:04 pm

    Caching shared preferences isn’t really necessary. The speed up you’re gonna get will be marginal at best and it’s going to increase the code you have to write. I’d say don’t bother.

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

Sidebar

Related Questions

I have a project which has gui consisting of three buttons.Now one of these
I have a current Android app that uses i18n via resources. res/values-es/strings.xml and so
I have worked on android mobile app development, now I want to develop apps
I Have created an android app, which has view flipper and it has 4
in my android app, I have a button that leads to an activity which
I have an android app with a Business Object (let's call it SuperClass) that
in my test android app I intend to create and access database file, which
I am writing an Android app, part of which will be a survey involving
I have an Android app that can be downloaded from the Google market and
I have a fairly simple android app, it gets protobuf data from a web

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.