4

When my server responds to the purchase of a product id, via my app and Google Play server, by sending the IAP item to the device (client), where does it save / store the item (file).

Follow-up question - And can I control where they are stored?

Platz
  • 143
  • 1
  • 5

1 Answers1

0

Possible answer: Note: This applies to non-consumable IAPs such as images, new levels, characters, features, etc. For consumable IAPs such as credits and time-based features perhaps save this smaller data in an array list file, database or cache. Correct me if there's a better way please.

When your app makes a connection with your server, set the path where you want to save the file, then download it.
Location - Most likely the SD Card under Private files category (private to your app, as private as possible, and deleted when your app is removed) Saving Files - Android developers training.

Directory - Pass a name indicating the type of directory you'd like to save files that are private to your app.

Each directory created this way is added to a parent directory that encapsulates all your app's external storage files, which the system deletes when the user uninstalls your app.

However,

If none of the pre-defined sub-directory names suit your files, you can instead call getExternalFilesDir() and pass null. This returns the root directory for your app's private directory on the external storage.

it's important that you use directory names provided by API constants like DIRECTORY_PICTURES. These directory names ensure that the files are treated properly by the system.

If your app is going to use the file(s), you'll now know exactly where they are. I'm not sure of the details when using code that is in these files, such as add-ons / extension code.

Platz
  • 143
  • 1
  • 5