Get backup folder information using Google drive api - java

Is there any way to get Google drive backup folder information or the time when android device apps where last backed up?
I am making an android app which checks the last backup time

I believe that the backups are saved into an application data folder, an special hidden folder that saves application-specific files. Every application has one and can only be accessed by it. This means that you won't be able to access it with your application.
References
Store application-specific data (Google Drive API v3 guide)

Related

Using Google Drive drive.appfolder scope for saving app backup

I have an app for which I am trying to create data backup & restore functionality where if user want, he can store backup on google drive. If he uninstalls the app and re-installs the app on same or different device then we can restore the backup from Drive.
Can I use Google Drive drive.appfolder scope for this purpose? If yes, what is the limitation?

How can we download file(pdf) in android studio from firebase such that it doesn't appear in phone's internal storage?

I am developing an application where I need to download pdf files from firebase storage and store it inside the app(the one I am developing) and these files shouldn't be accessible to user outside my app. I had developed using Firebase code for downloading but it is downloading in the download folder of mobile even after changing the destination directory.
Nowadays there are two kinds of storage in an android device: Internal and external.
According to android docs:
Internal storage:
It's always available.
Files saved here are accessible by only your app.
When the user uninstalls your app, the system removes all your app's files from internal storage.
External storage:
It's world-readable, so files saved here may be read outside of your control.
It's not always available, because the user can mount the external storage as USB storage and in some cases remove it from the device.
When the user uninstalls your app, the system removes your app's files from here only if you save them in the directory from getExternalFilesDir().
External storage is the best place for files that don't require access restrictions and for files that you want to share with other apps or allow the user to access with a computer.
Internal storage is best when you want to be sure that neither the user nor other apps can access your files.
To get path of internal storage of your app:
getFilesDir()
This will give you a File representing the directory on the file system that's uniquely associated with your app.
Hope it helps!
Source: Save files on device storage
EDIT:
If you want the file downloaded from firebase storage to be only visible to your app, you should move the file from downloads to internal storage and then delete the file from downloads

Is there a way to check where from app is installed

In my project I want to know from what website or android market, my application has been downloaded and installed.
Now I see two ways:
1) Use mobile browser storage to save location
2) Generate application for each site in the system
Both of them enough for my project, but I want to know if there is another legal ways through Play market
PackageManager.getInstallerPackageName() will give you the package name of the app which installed the app with the package name passed in as a String.
You're looking for Google Play Campaign Measurements
Google Play Campaign Measurement allows you to see which campaigns and
traffic sources are sending users to download your app from the Google
Play Store.
You can create multiple apk files, one for every distribution channel you have.
In your project, create a config.json which contains the information you want to know about the installation and current version of the installed apk file of your application. The contents of the file, varies based on the distribution channel. For example, for the version you want to upload to Google Play, it can contain :
{
"channel" : "google-play-store",
"campaign_name" : "fall 2016"
}
Now, when the user installs and runs your application for the first time, read this config.json and send this information to a remote webservice of your own, to collect statistics.

Store files in google drive from Google App Engine

All,
I have a google application engine (java) that requires to store some images. I tried using Blobs and storing them in datastore but as you know there is a size limit on data that can be stored in datastore.
So as result I'm storing the images on a different server and store the path in my datastore and all works fine.
Now I'm thinking on using a google drive folder instead of using a server to upload the files to the drive and using the share link to display them later.
I've seen https://developers.google.com/drive/web/quickstart/java and got it to work fine. When I try to use it in my application however obviously this won't work as the code is assuming a credential for a local user.
I created a service key on my application and want to change the sample code above to use it but I'm not sure if that's the correct approach.
Tried searching for samples but can't find anyone that takes the same approach. Is there a working sample that shows how to authenticate an application not a user and let's say store a file in google drive?
I've also seen https://developers.google.com/drive/web/examples/ please note what I want is to store files in my google drive and not the user's google drive. So if user A and user B come to my app, they shouldn't have to authorize my application and should both be able to upload a file to my google drive.
I don't know if this can be done directly from their browser or I have to move the file to my application (appspot) and then push it to google drive.
Thanks

hosting the database file on any cloud service

I have an android application, which wants the user to login each time he runs the app. So, the login procedure is simple, using the sqlite dabase file i'm using. I've copied the file in assets folder and doing the necessary modifications. But, the database file is of no use unless it is on the server. I don't have any server so i'm thinkin of keeping the database file on dropbox, google drive etc and then read or update that file as per user commands. The question is how to do that? I was searching the web for it, and found that the only way is downloading the db file modifying it and the uploading it back. Can anyone give me an example??
Doing that isn't possible unless you have a server.
Because, if you are using dropbox, first you'll have to make your file public in order to download it (Not recommended at all. Compromises security). Then you can use the url to download the file. But you won't be able to upload it back (Unless you are able to login to dropbox through your Android code).
Instead if you a web server with MySQL n PHP, you can easily send POST requests to your server.

Categories