This shows you the differences between two versions of the page.
smd:laboratoare:06 [2021/04/21 20:41] adriana.draghici [Android storage model] |
smd:laboratoare:06 [2021/05/20 21:30] (current) adriana.draghici [Shared preferences] |
||
---|---|---|---|
Line 20: | Line 20: | ||
<note important>Android API Level 29 introduced important changes to how storage is accessed, driven by the need for increased privacy. | <note important>Android API Level 29 introduced important changes to how storage is accessed, driven by the need for increased privacy. | ||
- | It provided **Scoped Storage** ([[https://developer.android.com/training/data-storage#scoped-storage|documentation]][[https://www.raywenderlich.com/9577211-scoped-storage-in-android-10-getting-started|tutorial]]). Api Level 30 also introduced some updates related to storage, check [[https://developer.android.com/about/versions/11/privacy/storage|this link]] for some information about them. </note> | + | It provided **Scoped Storage** ([[https://developer.android.com/training/data-storage#scoped-storage|documentation]], [[https://www.raywenderlich.com/9577211-scoped-storage-in-android-10-getting-started|tutorial]]). Api Level 30 also introduced some updates related to storage, check [[https://developer.android.com/about/versions/11/privacy/storage|this link]] for some information about them. </note> |
====Internal Storage==== | ====Internal Storage==== | ||
Line 93: | Line 93: | ||
sharedPref = this.getSharedPreferences("mysettings", Context.MODE_PRIVATE); | sharedPref = this.getSharedPreferences("mysettings", Context.MODE_PRIVATE); | ||
// or | // or | ||
- | sharedPref = PreferenceManager.getDefaultSharedPreferences(context); | + | sharedPref = PreferenceManager.getDefaultSharedPreferences(context); //!!! recently deprecated in API level 29 |
</code> | </code> | ||
Line 226: | Line 226: | ||
* [[https://developer.android.com/guide/topics/data/data-storage|Android Data Storage documentation]] | * [[https://developer.android.com/guide/topics/data/data-storage|Android Data Storage documentation]] | ||
* [[https://developer.android.com/about/versions/11/privacy/storage|Storage updates in Android 11]] | * [[https://developer.android.com/about/versions/11/privacy/storage|Storage updates in Android 11]] | ||
- | * {{lab6-skel.zip|}} | + | * {{lab6_skel.zip|}} |