1. Download our Official Android App: Forums for Android!

SharedPreferences Vs. SQLite database

Discussion in 'Android Apps & Games' started by vikas.patel, Feb 11, 2011.

  1. vikas.patel

    vikas.patel Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    15
    Joined:
    Feb 11, 2011

    Feb 11, 2011
    15
    0
    15
    hi,
    is there difference between "SharedPreferences" and "SQLite Database" as far as their work is concerned. means both are used to store data on device parmanently.
    If I want to store something on device which could be more convenient ?

    Thnx.:cool:
     

    Advertisement

  2. afonseca

    afonseca Newbie
    Rank:
    None
    Points:
    36
    Posts:
    14
    Joined:
    Jul 9, 2010

    Jul 9, 2010
    14
    2
    36
    Entrepreneur
    Washington
    SharedPreferences are for quickly storing values like single strings, settings, flags, etc. The SQLite Database can do the same but is a little more heavy duty, think storing tables of information like customer data with multiple properties and being able to search (the Query in SQL).

    So the answer is, "it depends" on what that "something" is you want to store? If it's a user setting then the SharedPreferences is quick and easy. If it's a set of records then the SQLite Database may make more sense.

    Hope this helps.
     
  3. vikas.patel

    vikas.patel Newbie
    Thread Starter
    Rank:
    None
    Points:
    15
    Posts:
    15
    Joined:
    Feb 11, 2011

    Feb 11, 2011
    15
    0
    15
    afonseca,
    yes thts what I want to know.
    thx for reply.
     

Share This Page

Loading...