用户设置 - Android电子 [英] User Settings - Android

查看:161
本文介绍了用户设置 - Android电子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在应用程序的变化使得持续存在,因此,当应用程序重新推出的设置都保持相同的(例如,如果从应用程序我有选择的振动那么当应用程序没有运行,如果我的手机铃声模式时,应用程序重新推出将自身设置为振动)?

How to make in app changes persist so that when app relaunches all settings remain same(like if from app i have selected vibration then when app is not running if my phone is ringer mode when app relaunches it sets itself to vibration)?

推荐答案

实际上,有多种方式可以持续的变化。的 Android的文档涵盖所有这些在更多的细节,但本质上这些是五种方式。最简单的就是共享preferences ,大概。

There's actually multiple ways to persist changes. The Android documentation covers all of them in more detail, but essentially these are the five ways. Easiest is SharedPreferences, probably.

共享preferences

在键 - 值对存储专用的基本数据。

Store private primitive data in key-value pairs.

内部存储

在设备内存中存储私人数据。

Store private data on the device memory.

外部存储

在共享外部存储存储公共数据。

Store public data on the shared external storage.

SQLite数据库

存储结构化的数据。

网​​络连接

用自己的网络服务器在网络上存储数据。

Store data on the web with your own network server.

这篇关于用户设置 - Android电子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆