Harsha M V
Harsha M V

Reputation: 54949

Android Storing Data

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

  1. User Details like -> userId, Name, Last Known localtion, gender, birthday
  2. Messages Inbox -> threads of conversations between two people.

Upvotes: 0

Views: 318

Answers (2)

Sunil Kumar Sahoo
Sunil Kumar Sahoo

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

Aurelian Cotuna
Aurelian Cotuna

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

Related Questions