Reputation: 54949
I am creating a community app where people can have a profile and search for people - like the soical network kind.
Which is the best way to store data of the logged in User like - User ID, name etc. so that i can use this across the activities for showing data and doing Api calls to get data across the application for the user related content.
What i want to store Locally
Upvotes: 0
Views: 318
Reputation: 53657
You can use either SQLite Databases or Shared Preferences Using SQLite Databases will be better If you want to store more information ina astructured manor. But to save small information you can use Shared Preference
Upvotes: 2
Reputation: 3081
Well I guess the best approach is to store data in a database (SQLite), and use a call to sync the data with the server. Like this you can use your app even if you are offline :) If you store data in memory when you have no internet connection, or you have an internet connection problem, you will get into a lots of trouble.
Good luck, Arkde
Upvotes: 1