Where to store sensitive global information such as API keys in Android application?

前端 未结 3 657
臣服心动
臣服心动 2021-01-12 02:07

I need to store some sensitive information in an Android application. If I put it in a resource file, it appears that it is trivial for another app to be able to browse and

3条回答
  •  旧巷少年郎
    2021-01-12 02:37

    if you just want to deny access to your data from other applications, you can use SharedPreferences. Just use Contex.getSharedPreferences(/prefs file name/, Context.MODE_PRIVATE); According to documentation MODE_PRIVATE means that the created file can only be accessed by the calling application (or all applications sharing the same user ID).

提交回复
热议问题