Is Android SQLite database saved after turning off the device?

I want to develop an Android application. I would like to receive data from the user and save it in the phone database.

My data must be saved on the phone, even if the phone is turned off. Is this possible with a SQLite database?

+5
source share
5 answers

Android provides several options for saving persistent application data. The decision you choose depends on your specific needs, for example, whether the data should be private to your application or accessible to other applications (and the user) and how much space your data requires.

The data storage options are as follows:

-.

.

.

SQLite .

+6

( sqlite). , sqlite. , . sqlite?

sqlite.

, , , SharedPreferences

, .

+2

. , , .

SharedPreferences? , .

:

:

SharedPreferences preferences = context.getSharedPreferences("YourAppPreferences", 0);
SharedPreferences.Editor editor = preferences.edit();

editor.putInt("yourvalue", 14);
editor.putString("name", "John");
e.commit();

:

SharedPreferences preferences = context.getSharedPreferences("YourAppPreferences", 0);
preferences .getInt("yourvalue", 0)

getInt - default value, .

+1

!

- SQLite. SQLite, , . code, , SQLite. SQL ( ) - , . , , , ( ). SQLite MySQL, PostgreSQL . , SQL . - , , , ( Android).

0

Sqlite , Android.

Sqlite .

Sqlite

1. Sqlite SD- ( ) 2.Sync Sqlite Google Drive ( )

URL: https://developers.google.com/drive/examples/android

Sqlite

1.Advantage Loaders ( )

2.

3.share

Sqlite .

0

All Articles