0

我用谷歌搜索了很多,但没有得到正确的答案。phonegap for android 是否支持 SharedPreferences 以 xml 格式存储键和值?

4

1 回答 1

3

Phonegap is not providing SharedPreference directly.

There may be different ways to follow the same scenarios.

   [1] You can make plugin calls from phonegap code to Android and use SharedPreference there.

   [2] You can use html5's localstorage as well, if there is no need of storing large amount of data.

Edited :

   [3] You can also use JavascriptInterface to achieve such functionality. This will be more easy then implement custom phonegap plugin.

This are some ways and may be there are many available also.

This you can implement easily.

Hope this helps you.

Thanks.

于 2012-12-13T09:07:13.737 回答