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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T13:03:54+00:00 2026-05-25T13:03:54+00:00

I am writing a game for Android that requires a ton of simple data

  • 0

I am writing a game for Android that requires a ton of simple data (stats, map locations etc…) to be stored in SharedPreferences.

To simplify and streamline this process I created a Settings class that uses static set and get methods for all the sharedprefs. Then I simply call settings.getXYZ() from anywhere else in the app.

Lately I have read that using static methods in Android is a bad idea in the long run. Is there a better way to accomplish this?

  • 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-25T13:03:55+00:00Added an answer on May 25, 2026 at 1:03 pm

    I would recommend you have a set of static methods in a public class designed to get and set any preferences as properties.

    This is how I have it setup in my apps, and it works great! As long as you treat them as static objects, you should have no issues.

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

Sidebar

Related Questions

I am writing a small game in android that basically is a turn-based boardgame,
I am writing an android game. I need a Point class that stores x
I'm developing an Android game. At the moment I'm writing code that should calculate
I'm writing a game in Android/OpenGLES, and when I use traceview, I see that
I'm writing a game in Android that uses a custom XML format to describe
I'm writing a game for Android using libgdx. Here is some code that draws
I am currently writing a game for android where there are enemies that fly
I'm writing free game for Android and im going to use AdMob. I have
I am writing a game on Android, and it is coming along well enough.
I am writing a small game for Android. The game is drawn on a

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.