Google Drive file sharing between Android app and Web app (appengine) - android

I am trying to access Google Drive files from my android app and my website.
I used two client ids, one for the android app (Client ID for installed applications) and the other one for the website (Client ID for web applications). Those client ids are belong to the same google apis project.
Both Android and web applications are working properly. They can upload and list files. (their scope: https://www.googleapis.com/auth/drive.file = Per-file access to files created or opened by the app)
Here is a problem,
Files that uploaded from Android app are not visible from web application...
I guess even if Android and web app have client ids from same google apis project, Google does not think they are one application service.
Is there any way to solve this problem?
I wonder if there is a way to use one same google apis client id to web and Android app, or grant permission to read and modify files from both apps.

This is a known limitation from Android's OAuth 2.0 flow that will be resolve with the release of the Google Play Services (coming soon).
Take a look at this Google I/O 2012 session to learn more about how this works: https://developers.google.com/events/io/sessions/gooio2012/121/
In the meantime, one workaround you can use is passing the API key along with each request using the ?key=<API_KEY> query parameter.

Related

Google Drive V3 API implementation Xamarin Android

I've been trying for a while now to create an application where the users can sign in with their Google Account and the application will automatically upload some files into the users google drive.
So far I've managed to implement the Sign In mechanism but for the Google Drive integration I'm kind of confused if I should use a Service Account or not.
I've found this solution here Google Drive API implementation Xamarin Android but this way too old, and I can't find any updated solutions.
If anyone knows any solution or any suggestion I will appreciate it.
Think of serive accounts as a dummy user, this user can then be preauthorized to access some data.
You could share a folder on google drive with a service account and then the service account would have access to that folder on google drive.
Service accounts are intended for use by developers to access data they control.
If you are going to access the users account then you will need to use Oauth2, and request consent of the user to access their google drive account.
Unforuantatly it appears that Google Drive Android API used in the question you have linked is deprcated.
I can also tell you that the Google .net client library does not support Xamarin authorization.

Android: publish private apps for enterprise customers

I see that on PlayStore I can publish a private app to my customers if they has a OrganizationId.
I don't understand the role of "Play Custom App Publishing API","Android Management API
".
Is possible to develop a private enterprise store based on playstore ? I'm confused.. The world of private app for enterprise is soo few documented
There are 3 types of app distribution available using the Google APIs:
Public Google hosted apps - The app is available through the Play Store and not restricted to a specific enterprise. This type is supported by the Android Management API using an application policy.
Private Google hosted apps - The app is a private app (restricted to a single enterprise) but hosted by Google. This means your app will be uploaded privately to the Play Store and it will be available only to devices enrolled within your enterprise. This type is supported by the Android Management API using a managed iFrame for uploading APK files and an application policy to deploy the apps. Deployment is the same as with public apps where you use the package name of the app.
Private Self-Hosted apps - This type is fairly complex, but it does not require you to upload an APK to the Google Play store. Instead, you generate JSON meta data definitions of your APK and you only publish this meta data at Google. When you'd like to install an app, Google are actually using that meta-data to fetch APK files from your enterprise server.
Options 1 and 2 work for both work profile and device owner enrollments, while Option 3 works only for device owner enrollments. Furthermore, it seems it is only limited to the now closed EMM API.
The Play Custom App Publishing API is actually a way to manually create or update private APK uploads. So instead of using the Android Management API iFrame, you can use the publishing API to create your own in-house UI.
Depending on what you exactly mean, you may be able to build your own private store using the private apps functionality and the Play Custom App Publishing API to build your own UI for publishing apps. Be advised that there is a package name restriction imposed by the Play Store. There can be no 2 apps sharing the same package name uploaded to the Play Store. It does not matter if these are private apps, visible only for one enterprise. This rule applies globally for the whole Play Store.
Private Google hosted apps aren't restricted to a single enterprise. It can also be distributed to other organizations. Each company, or "enterprise", that allows employees to use their phones for work or gives devices to employees, manages those devices and decides which apps are available. If you don't want your app to be available to download from Play by consumer, but only by business that you've worked with, you might consider making your app "private" to just those companies that you work with. Each company will need to give you their "Organization ID" or "Enterprise ID" to make your app visible to that company.
Private self-hosted apps are actually called Externally hosted private apps. You can check this link for more information about externally hosted private apps.
For your use case, would it also work to use in-app purchases to enable app sales?

Automatically send private applications to clients

We have the same application for several clients. This application, for security reasons, cannot be published to Google Play, so we distribute it manually to customers.
The problem is that every time there is a new version of the application we have to contact all customers and update all their applications.
Isn't there a way to have private applications on google play and give access to different clients so that they can download the updates for those applications?
I've seen this, but I'm not sure if it behaves like I expect: https://support.google.com/googleplay/android-developer/answer/3131213?hl=en#runtest
Of course you can, there is an internal test app version available in the Play Store where you can upload your app version. Once uploaded you will have a private link available and only the people with access to that link will be able to download the app.
I guess you can publish as a "beta" version of the application https://support.google.com/googleplay/answer/7003180. You can define your clients as beta-testers and app would be visible on market only for them.
I have an approach, Assume you have an .apk file in your website. every customer will download it from here. Now you have to make an API call whenever user will use your application to make sure that they are using the latest version of application by sending the version details to server. If the user is using an older version (This you will get from server/api response) block the screen and redirect them to server to download the new .apk.
You can store the response to a local/DB so they can not use your application in offline mode also.

Self-hosted/EMM hosted private app's via Android Management API

Is it possible to use AMAPI to publish self-hosted/private app's to a device that is either using work profile or is fully managed without using the play store?
I am confused because what the answer i'm seeing in the following post doesn't jive with Google's documentation.
How can I silently push an apk and get it installed by android device policy using android management api?
User "Fred" in the above link says this operation is not possible however, the documentation at this website lists it as "Optional"
https://developers.google.com/android/work/requirements?api=clouddpx#313-self-hosted-private-app-management
Second question, using AMAPI requires the Android Device Policy on a device, can we use a custom DPC in conjunction with ADP to publish our private apps given that they are hosted via an EMM?
Unfortunately no!
The options you have is to use the play store/ private play store if you are using Android Management API.
Or integrate iFrame of Play Store - https://developers.google.com/android/management/apps
Self hosted APKs are again installed via Play store but it's hosted on your cloud.
As of now there is no way to install Apps without using play store!

Using google drive API to access my own "public" folder android/iOS

I have a google drive account that i want people within a certain organization to be able to upload files to programmatically, and also as invisible as possible. as i'm following along the google drive SDK tutorials, i can't seem to find anything about uploading a file directly to MY drive account. all the tutorials seem to be talking about allowing users to upload a file to their own account. The other problem is that they seem to all require some user permission (which i don't want).
the idea is this -> there's about 100 ppl (very controlled on who gets access) that have a special build of an android/iOS build, and for these people, i want to periodically sample certain screenshots of how they use the app. i'm able to save the screenshot files to their device locally; however, i want a "semi-public" source of viewing on these files. so i've set up a google drive account so that i can accept these screenshots in to my account. however, i don't want the users to have to accept any permissions, or use their own account. Ideally, at the end, i can share my drive account folder (with these screenshots) with people that i select to share it with.
Is this even possible? If so, how do i do this?
The Drive API for Android only supports authorizing the current user, however if you use the Google APIs Java client instead to access the Drive API you can store credentials for your account with the application and use those for all users of your app. Read more about authorization and the Java client here.

Categories

Resources