Saved Games API or Drive API for Android? - android

I need to save some game information which can be accessed later on the current device or on a different device.
Should I really use Google Saved Games API over Google Drive API ?
My thoughts: Google Saved Games API requireS Google Drive API as a prerequisite, e.g. when setting up the client. scores, achievements, and leaderboards are separate to the Saved Games API, so I can still have those without using Saved Games API.
So rather than having to deal with Snapshots, and Google Saved Games work flow, I could just access Drive API.
Maybe the only benefit might be Google Saved Games conflict resolution functions. Maybe there is conflict resolution for Drive.
UPDATE
Having done some more reading up on this topic the benefits of conflict resolution and the delayed upload when internet connections are unavailable make it worthwhile using Saved Games API over Drive.
This video gives details of the Saved Games API, and my thoughts are now that Saved Games would probably be better.

From Android version: 6.0 (API 23) onward this can easily be achieved as by default Android performs an Auto backup of files. ie Files of the type:
Shared preferences files.
Files in the directory returned by getFilesDir().
Files in the directory returned by getDatabasePath(String), which also includes files created with the SQLiteOpenHelper class.
Files in directories created with getDir(String, int).
Files on external storage in the directory returned by getExternalFilesDir(String).
Now you can turn this feature on or off by changing the value here in Manifest file:
<application ...
android:allowBackup="true">
This keeps a backup in the users Google Drive, and the space is limited to 25MB and that space is not counted against the user's space quota.
More information regarding this is available here:
Auto Backup for Apps
More information regarding including and excluding various files from backing up is provided here:
Android Auto backup for Apps
So from API 23 onward you can save the game related info in any of the aforementioned files and not worry about retrieving it later.

Related

Keep file after wipe data in Android 10

The application I'm currently working on requires a manual setup (entering some information) on device provisioning. This information needs to be written to a file that should not be deleted when the application is uninstall or the application data is wiped (user support requirement, as they can direct users to do this in some cases)
There was a very similar old question, but the answer is now deprecated and no up-to-date answer has been posted
Keep files after uninstallation of android app
So the question is, given the deprecation of Environment.getExternalStorageDirectory() on Android 10, how do we programmatically write/read a file that will not be deleted when the application is uninstalled or the data is wiped?
For what is worth, we can not rely on app auto backup, as the users don't have google accounts configured.
Thanks
To summarize while targetting 30.
For Android 10 device: Request legacy external storage to get external storage access as usual.
And Googles step back for Android 11 devices: use directories like Download, Pictures, Movies, Documents, DCIM and so on. Read and write access for all. Android OS is very picky to use the right extensions for files to be created in those folders.

Google API to recover data

in google drive, there's a tab named "backups" that contains data from old android phones I have.
These backups are not downloadable.
Is there a way to download these backup files? is there a way to get the information inside the backup files? ( API requests )
I know that for the Whatsapp backup-file there is a different API (because it's not downloadable like the others).
There's no mention of accessing the backup folder in Drive API. But, if you're referring to a special folder called App Folder which is only accessible by your application, then you can. Check the Get authorization to use the App Folder.

Multi-user feature (sharing a folder) with Dropbox Sync API

I have an app on Android & iOS, say ABC. It stores and accesses SQLite database (.db file) which is local to user's device.
To provide sync among different devices, I implemented Dropbox Sync API so that data entered on one device gets reflected on other devices automatically. Of course, the user must have linked the app ABC to their Dropbox account on all devices. So, its the same Dropbox account on all devices.
The SQLite database gets stored in app folder (Dropbpx/Apps/ABC). I have taken permission for app folder only.
Now, I wish to implement multi-user feature with read/write permissions where users with different Dropbox accounts can access this app folder (Dropbpx/Apps/ABC). It seems app folders can't be shared. (When I try to share an app folder, it says 'An app folder can't be shared')
This link says you need Full Dropbox permissions to create a shared folder, but Sync API doesn't support Full Dropbox permission.
Any clues how can I provide multi-user feature (sharing a folder, .db files) with Sync API?
Any help would be appreciated.
The linked forum thread is still correct that the Sync API doesn't currently support the Full Dropbox permission. It's also correct that app folders are currently incompatible with shared folders (i.e., app folders can't be shared, or contain or be contained in shared folders.)
However, there is a new permission, called File Type, introduced after that thread, that the Sync API supports and can be used with shared folders. You can find more information about the different permissions here:
https://www.dropbox.com/developers/reference/devguide#app-permissions
Also, while .db isn't one of the standard extensions available in the File Type permission buckets, Dropbox API support can enable custom extensions as noted here:
https://www.dropbox.com/developers/support#custom-extensions

save files from android app to google drive without using HTTP request

I want to save files from my Android application to Google drive, but i don't want to use HTTPS request. I want to put my files in Google drive even if the user is offline like local drive. So when user will come online, Google drive will upload this file to cloud automatically.
Is there any api exist who let upload files while offline?
Is there any same APIs for iOS also??
Thanks,
There is no API to interact with the Google Drive Clients in the way that you want, sorry! However, it is as easy as doing a copy or move operation on the file system. Just ask and store the user's Google Drive location on the disk, then copy the file into that directory when you need to.
For people digging in the Stackoverflow archives, note that offline drive access is available using the Google Drive API for Android. See the documentation here: https://developers.google.com/drive/android/ ... and for sure there must be one for iOS too.

Android app structure: DLC via in-app billing

I'm building an android app that provides several interactive adventures to the user. These use a lot of media (sound files and images, plus some xml), and therefore a lot of space.
I'm planning on a freemium model where the app is downloaded free with one adventure, and the user can buy more from Google Play.
What I'm wondering is:
1) How do I structure my app so as not to blow 50mb apk?
2) Does internal storage have a size limit?
3) The in-app billing examples I've seen all assume that it's for something trivial that's already in the app. How do I set it up so that an adventure is downloaded when it's purchased?
You can use addons on the Play Store that go up to 2GB (IIRC), so 50mb is only a limit fo the APK. Internal storage is limited by the device's /data partition size, but there is no per-app limit (at least not in stock Android). As for 3, you need to have your own server, verify purchases on it and give the app a link to download data once you get a valid order. How exactly you save, load and manage the downloaded data is up to your app.

Categories

Resources