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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T23:46:17+00:00 2026-06-15T23:46:17+00:00

I´ll do appreciate som light with the following problem. I am writing an android

  • 0

I´ll do appreciate som light with the following problem.
I am writing an android application that comunicates with a remote server, the application stars with a login scrren, after the user login i want some important ionformation to get reachable through the entire appLication, user information, the department in wich the user works etc,
After reading about the best to achieve that I decided to use a singleton by extending the application class. Here is an example.

public class UsuarioCustom extends Application {

 private Usuario usuario;
 private Location posicionActual;   
 private Delegacion department;
 private RutaCustom rutaActual;          

     //getters and setters ....
}

One of the requirements of the applications is that have to send the current location of the user ever 10 minutes so this application needs to keep running for a log while.

I am testing the appication and from time to time crashed showing the window the application has stoped.

I debuged de application and I realized the at some point android set my singleton class to null. I read on the web that this is a common issue in android…

For example If i start my application then with the phone to airplane mode and then come back to my app y can see how my singleton is null.

I have read on the web about singleton classes on android, some people says that is better to use a servive but seems like the oficial android sdk documentation lacks some useful information here.

I am thinking about saving the information on sqllite so every time i want to use my singleton class i check if is null, if so i reload it again from sql litte.

Can someone give some nice tips about the best way to deal with that probem??.

Thanks a lot.

  • 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-15T23:46:18+00:00Added an answer on June 15, 2026 at 11:46 pm

    After searching the web , I finally decided to save the important imformation on the sqllite. Seems like in an Android enviroment u can not trust that u can save data on memory for a long time, soon or later Android will delete the informatión even if you create a singleton by extending the Application class.

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

Sidebar

Related Questions

I would appreciate any help in solving my problem that has had me pulling
Appreciate if I can get some help writing a LINQ that will get ALL
I am having som slight difficulties with the following problem. I have initialized a
I appreciate that LIKE queries are slow as they cannot be indexed. However, I
I love Jenkins and appreciate that it is an active project. Still, I don't
UPDATE : I do appreciate don't want that, want this instead suggestions. They are
I appreciate any help that can be offered on the subject. At the end
I am developing an app using phonegap for Android. I want this mobile application
I appreciate that similar questions have been asked before, but I am struggling to
I appreciate that this may be a pretty daft question, but can anyone think

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.