# Android データ管理 (Android) > SharedPreferences、DataStore、File I/O、Internal/External Storage、Scoped Storage - 29 面接問題 - Junior - [面接問題: Android](https://sharpskill.dev/ja/technologies/android/interview-questions.md) ## 1. Android の SharedPreferences とは何ですか? **回答** SharedPreferences は、プリミティブデータ(int、boolean、float、long、String、Set)を保存するためのシンプルなキー値ストレージシステムです。データはアプリのセッションや再起動の間も永続化されます。ユーザー設定、設定値、小さなデータに最適です。シンプルな API: getSharedPreferences()、edit()、putString()、apply()/commit()。 ## 2. SharedPreferences に値を保存するにはどうしますか? **回答** インスタンスを取得: val prefs = context.getSharedPreferences('name', Context.MODE_PRIVATE)。編集: val editor = prefs.edit(); editor.putString('key', 'value'); editor.apply()(非同期)または editor.commit()(同期)。チェーンも可能: prefs.edit().putString('key', 'value').apply()。 ## 3. apply() と commit() の違いは何ですか? **回答** apply() は非同期で(バックグラウンドで書き込み、UI スレッドをブロックしない)、何も返さず、ほとんどの場合に推奨されます。commit() は同期で(書き込みまでブロック)、boolean を返し(成功すれば true)、成功をすぐに確認する必要がある場合に役立ちます。apply() は UI のパフォーマンスが向上します。 ## さらに26問利用可能 - SharedPreferences から値を読み取るにはどうしますか? - Jetpack DataStore とは何ですか? 無料で登録: https://sharpskill.dev/ja/login ## その他のAndroid面接トピック - [Android の基礎](https://sharpskill.dev/ja/technologies/android/interview-questions/android-fundamentals.md): 24問, Junior - [Android UIとリソース](https://sharpskill.dev/ja/technologies/android/interview-questions/android-ui-and-resources.md): 30問, Junior - [Androidライフサイクル](https://sharpskill.dev/ja/technologies/android/interview-questions/android-lifecycle.md): 30問, Junior - [Android ナビゲーション](https://sharpskill.dev/ja/technologies/android/interview-questions/android-navigation.md): 26問, Junior - [Android ネットワーキング](https://sharpskill.dev/ja/technologies/android/interview-questions/android-networking.md): 29問, Junior - [Android テスト](https://sharpskill.dev/ja/technologies/android/interview-questions/android-testing.md): 28問, Junior - [Android Gradle](https://sharpskill.dev/ja/technologies/android/interview-questions/android-gradle.md): 26問, Junior - [Android向けKotlin言語の基礎](https://sharpskill.dev/ja/technologies/android/interview-questions/android-kotlin-language-essentials.md): 24問, Junior - [Room Database](https://sharpskill.dev/ja/technologies/android/interview-questions/android-room-database.md): 25問, Mid-Level - [バックグラウンド処理](https://sharpskill.dev/ja/technologies/android/interview-questions/android-background-work.md): 18問, Mid-Level - [Jetpack Compose](https://sharpskill.dev/ja/technologies/android/interview-questions/android-compose.md): 28問, Mid-Level - [パーミッションとデバイス機能](https://sharpskill.dev/ja/technologies/android/interview-questions/android-permissions-and-device.md): 21問, Mid-Level - [Android向けFirebase](https://sharpskill.dev/ja/technologies/android/interview-questions/android-firebase.md): 23問, Mid-Level - [Android MVVM Architecture](https://sharpskill.dev/ja/technologies/android/interview-questions/android-mvvm-architecture.md): 18問, Mid-Level - [Androidネットワーキング上級](https://sharpskill.dev/ja/technologies/android/interview-questions/android-networking-advanced.md): 13問, Mid-Level - [Kotlinのコレクションと演算子](https://sharpskill.dev/ja/technologies/android/interview-questions/android-kotlin-collections-operators.md): 20問, Mid-Level - [Kotlin Coroutinesとflow](https://sharpskill.dev/ja/technologies/android/interview-questions/android-kotlin-coroutines-flow.md): 20問, Mid-Level - [Android の依存性注入](https://sharpskill.dev/ja/technologies/android/interview-questions/android-dependency-injection.md): 15問, Mid-Level - [Android MVI Architecture](https://sharpskill.dev/ja/technologies/android/interview-questions/android-mvi-architecture.md): 17問, Mid-Level - [Android Clean Architecture](https://sharpskill.dev/ja/technologies/android/interview-questions/android-clean-architecture.md): 21問, Senior - [Android Compose 上級](https://sharpskill.dev/ja/technologies/android/interview-questions/android-compose-advanced.md): 17問, Senior - [Android Performance and Monitoring](https://sharpskill.dev/ja/technologies/android/interview-questions/android-performance-monitoring.md): 13問, Senior - [Android Security and Privacy](https://sharpskill.dev/ja/technologies/android/interview-questions/android-security-privacy.md): 18問, Senior - [Android CI/CD and Release](https://sharpskill.dev/ja/technologies/android/interview-questions/android-cicd-release.md): 15問, Senior - [Android UX and Form Factors](https://sharpskill.dev/ja/technologies/android/interview-questions/android-ux-form-factors.md): 18問, Senior - [Android Testing Advanced](https://sharpskill.dev/ja/technologies/android/interview-questions/android-testing-advanced.md): 18問, Senior --- Source: SharpSkill (https://sharpskill.dev), tech interview preparation for your real stack. HTML version of this page: https://sharpskill.dev/ja/technologies/android/interview-questions/android-data-management