LoginSignup
3
3

More than 5 years have passed since last update.

Android アプリ内の簡単なデータ保存

Last updated at Posted at 2012-09-30
//保存
android.content.SharedPreferences sp = getSharedPreferences("fileName", MODE_PRIVATE);
sp.edit().putString("hoge", "fuga").commit();
sp.edit().putInt("integer", 100).commit();

//取得
String hoge = sp.getString("hoge", null);

//削除
sp.edit().remove("integer").commit();

参考
http://yuubiseiharukana.blog.shinobi.jp/Entry/607/

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3