0

I am developing an Android app, and thinking of using in-app purchase to unlock full features of the app.

I want the app to be fully functional even without an active internet connection as well if the user paid, so I don't want to rely on checking the in-app API to check whether they purchased the paid version or not.

boolean userPaid = true;

Could I use shared preferences or internal storage to persist this userPaid data after application close/destroy, and would this be a secure method of storing the data?

blee
  • 3
  • 2
  • use [SharedPreferences](https://developer.android.com/reference/android/content/SharedPreferences.html) to save values(e.g boolean) and also don't forget to set the defaults. – Mehran Zamani Aug 01 '17 at 04:28
  • 1
    The In App Billing API works fine while offline as long as you've checked it before while the device is online. – ianhanniballake Aug 01 '17 at 04:56
  • @ianhanniballake Thanks. Do you have reference for this ? I wanna read – Ajay S Aug 01 '17 at 05:05
  • Thanks for all the input, I will try testing out what @ianhanniballake mentioned to see persistence when I get the chance to publish and test. – blee Aug 01 '17 at 05:15

1 Answers1

0

you can use simple encrypt to SharedPreferences, Because the mobile rootd are easy to see, folders can be changed.

see this link for encrypt

Rasoul Miri
  • 11,234
  • 1
  • 68
  • 78