开发者

How to create/use non volatile variable at framework level

开发者 https://www.devze.com 2023-03-13 14:12 出处:网络
I\'m not able to create variable in android framework level or application level, which will retain its value even after factory 开发者_开发百科reset or software changes. Same thing I\'m able to imple

I'm not able to create variable in android framework level or application level, which will retain its value even after factory 开发者_开发百科reset or software changes. Same thing I'm able to implement at Modem code which is qualcomm based. In qualcomm we can add NV items.

But i want this in android framework layer or application layer.

I'm working on froyo version 2.2.


As far as I know, ordinary 3rd party application cannot store data that cannot be removed by user. Basically both internal and external storages can be cleared at any time.

Internal application's storage will be cleared on factory reset, when application is uninstalled or when user clicks "Clear data" in "Manage Applications" activity.

External storage is simple sd-card that can be formatted by user at any time on any other device (there are devices that have builtin external storage, but it can be formatted as well from Android's settings).

And there is no API for NV items (which is reasonable, I'd be surprised to see this available to 3rd party application developers).

So, you won't be able to store "non-volatile variable" in Andrdoid. At least not without the root. And even then things might be quite different from device to device.


There is a backup service which might be what you're looking for - store some application preferences in a google cloud - http://developer.android.com/guide/topics/data/backup.html.

0

精彩评论

暂无评论...
验证码 换一张
取 消