0

I am a beginner to android eclipse. I am trying to do one simple application which is to register information in online and receive the same information while searching on the same application who interested to see that information

kindly guide me for this.

Murtaza Khursheed Hussain
  • 15,176
  • 7
  • 58
  • 83
Fahi
  • 1
  • This previous answer might be helpful to you: http://stackoverflow.com/questions/6276358/pros-and-cons-of-sqlite-and-shared-preferences – Sid Jan 21 '15 at 08:25
  • Search before you ask please [Pros and Cons of SQLite and Shared Preferences][1] http://stackoverflow.com/questions/9012521/sharedpreferences-or-sqlite-database [SharedPrefences or SQLite][2] http://stackoverflow.com/questions/13631546/sharedpreferences-or-sqlite [http://stackoverflow.com/questions/9012521/sharedpreferences-or-sqlite-database][3] http://stackoverflow.com/questions/9012521/sharedpreferences-or-sqlite-database – Adeel Shahzad Jan 21 '15 at 08:26

2 Answers2

1

Shared Preferences :

You can use SharedPreferences to save any primitive data: booleans, floats, ints, longs, and strings. This data will persist across user sessions (even if your application is killed).

Sqlite

SQLite is an Open Source database. SQLite supports standard relational database features like SQL syntax, transactions and prepared statements. The database requires limited memory at runtime (approx. 250 KByte) which makes it a good candidate from being embedded into other runtimes.

SQLite supports the data types TEXT (similar to String in Java), INTEGER (similar to long in Java) and REAL (similar to double in Java). All other types must be converted into one of these fields before getting saved in the database. SQLite itself does not validate if the types written to the columns are actually of the defined type, e.g. you can write an integer into a string column and vice versa.

Digvesh Patel
  • 6,503
  • 1
  • 20
  • 34
0

SQLite will allow you to store persistent data in a very structured way. It's usually used to store data models that your application needs to work with. For example, you make an application that is intended to show car details locally. Those cars should be stored in a SQLite database.

SharedPreferences allow you to store vars that are needed for your application and that should be saved even when the application is closed. For example, Shared Preferences will allow you to save mainly all the preferences of the user (should the application use sound, should it vibrate....).

Luciano Rodríguez
  • 2,239
  • 3
  • 19
  • 32