Upload files from android to google drive folder - java

I have created an android application that allows the users to do a test and save the results in a local .xlsl file. This app will run on around 30 devices. Since it is part of a scientific research I need it to automatically save the xlsl file in a specific folder on google drive which I do not own (but which they gave me access permissions and I can write/read). I'm reading the tutorial on the google docs, but from what I understood I need to sign up on all the devices with the account I used for the authentication. Are there ways to avoid it? The devices will probably be without any account on it and since I don't need to know who's uploading it and would be fine to pre-insert my credential in the code so it will automatically upload it with them. Is it possible?

Related

how can I auto-authenticate to a specific google account using java code?(auto-authenticate)

I am trying to create an application that uses google drive as storage, this application is somehow private. however, I don't want it to ask me to log in not even once, I don't mind the application knowing the full credentials it needs to access the google drive it will use.
In short, is there a way to auto-authenticate my app to fully access a certain google drive by saving the google account somewhere?

Do I need a server to send PDFs created in my app to the same app (different account) on another device?

Beginner here.
I'm creating an app in Android Studio (Java) where the user can create and store PDFs on the app and send these to another account on the same app, on a different device.
The user will have a list of contacts stored in a database.
Do I need a server to do this? Are there any tutorials online showing one how to code this? (I've been searching for hours but can't find anything specific to my problem. Maybe I'm wording it wrong...)
I was looking into Firebase but I'm completely lost on where to start.
Thanks!
For simple use cases you don't need a server, you can use firebase instead. Currently, they have a storage feature that lets you store files on their servers and retrieve them later.
Here is the official documentation firebase cloud storage
One thing you could do is upload the file from android device and download from another one.

Dropbox Java API : Limit access for an user

I'm working on an android app, that has to get resources from a database located on dropbox for various reasons.
I created an app limited to a folder on my dropbox's app page.
I hava data stored on this folder (i know how to do that), and want my android app to get this data. I don't want the app to be able to put files on this dropbox folder.
I know that I can generate an auth token for my app, but I need to manually "activate" it on a web browser to make it usable.
Is there a way to automatically anthenticate my android app, on any device running it, and prevent users to alterate my database, only allowing them to read data from the folder, through the dropbox's java API ?
Thanks for any answers !

Can my app users upload files to my Google Drive, without giving my gmail user nor password?

I am new to combining Google Drive with android.
I have succesfully made this Google Drive sample code work:
https://github.com/googledrive/android-quickstart
The app does these 4 steps:
1) Asks me to select a gmail account in my phone, or to add an existing one with user/password.
2) The camera opens
3) When the user takes a photo, the app opens an activity, asking me the folder within Google Drive to which I want to save the photo.
4) The photo appears in google drive.
I have an existential question that may seem dumb, but I am sure many other android developers may also be asking it:
Can users upload files to MY google drive account, without them having to input MY Google drive's user/password?
TAKE INTO ACCOUNT: Files are 2 Mb or less This is an R&D app, which means it will not be published in the Play Store, and it will be targeted to a few (20) users within the department. That said, security is relaxed.
The short answer is NO. With Google Drive (both GDAA and the REST Api), the android device user identifies her/himself by selecting an existing account on a device (or adding a new one). The app than uploads / downloads objects (files/folders) to that GooDrive account.
The only way this can be accomplished is under the REST Api (DRIVE scope), you let different users upload files to THEIR OWN GooDrives and share these files with your account (via your email, domain). Your account can then see the shared files. See this.
Obviously, there is still a possibility of creating a specific google account for your application/problem and let all the users share this account with a password known to all of them (but it is not what you were asking).
Good Luck
The short answer is Yes it is possible !!! the app user can directly upload the files to your drive without username and password of that account...which means u have to share the access token of that particular drive account to that app.
Using that access token(credential - setAccessToken("place your access token here") we can create a service and upload the file.

Android Policy: External application files

Google Play Developer Program Policies says:
An app downloaded from Google Play may not modify, replace or update
its own APK binary code using any method other than Google Play's
update mechanism.
I want to publish my application to Google Play. And I been planing to load my core SWF file dynamically, so game updates could be done without the need of going to Google Play market. An alternative Java implementation can achieve the same thing by downloading remote jar file.
In both cases I will have the next limitations:
I cannot modify my Manifest file.
I cannot extend the application permissions that I asked
My external code is bounded to application sand box(Just as the rest of my application)
Notice that my external code is not part of the APK files. It will be stored in application folder or in external storage(SD-Card). Its same place where external assets is stored.
Does this violatating Google policy? I am not sure what they meant by "APK binary code".
I am not a lawyer, and I don't play one on TV...
Your best course of action is to look at the reason they included that phrase in the first place. That text now exists in the Google Play policy because Facebook did the very same thing that you are describing in their application (providing an auto-update mechanism outside the Play Store) earlier this year, and Google threatened banning the application until this "feature" was removed (which it was, shortly thereafter).
The spirit of the law in this case is that Google does not want applications updating themselves without the user's consent outside of the Play Store...period. If your application does this, you can bet Google won't care how you are doing it and will likely remove the application when and if the feature is discovered. They won't care how closely executable code in an external SWF file resembles the internal classes of the APK.
Legal language like this is is intentionally vague so companies can apply it in any situation they see fit. Don't think you're being safe by splitting hairs with the terminology.
I am not a lawyer. I see this restriction as limiting only the apk binaries. There are many apps that have dynamic behavior changes, for example Google search where the search results algorithm is determined by dynamic code on the server, or facebook which loads new images texts, layouts and more.
I think that as long as you do not do anything bad for users using the swf changes, you should be ok.
The purpose of this clause, as I understand it, is to prevent apps from loading and using code that was not tested by Google using the normal process that tests apps when published. Google want to ensure that all code is scanned/tested by their bots.

Categories

Resources