PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Saturday, November 12, 2022

[FIXED] How to save object in memory for all activity\ies when application is alive, Android

 November 12, 2022     android, caching, memcached, retrofit, rx-java     No comments   

Issue

I have an app, it uses Rxjava and Retrofit to retrieve data from backend.

after login, I will get a JSON file which includes User information (name, email, id, stripeId....). I will need to use User information when retrieving data from backend in other activities. Since there are many times I need to use the User information, saving it in Database or SharePreference may spend a lot of time.

Is there any way that I can save the data in the memory when the App is alive (not killed in the background)? Thanks first.


Solution

You can extend Application Class which is initiated on application startup. Check it here:

Extending Application to share variables globally



Answered By - Maksym V.
Answer Checked By - Mildred Charles (PHPFixing Admin)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing