Integrating google drive with a 2.1+ android application - android

I'm trying to have my apps sync their database with drive so that the app data is n'sync throughout all his devices. I did some research and found this quickstart, Dr.Edit but when I downloaded the source code for a closer inspection I realised it's for 4.1+. Surprised, I checked the google drive app on google play and found out you can install it on 2.1+.
I understand that later versions of android OS not only work better but make our work as developer easier. However I am surprised I cannot find much about integrating google drive with older versions. If we check the current distribution of android versions, we can easily notice that 2.3.X alone is almost on 50% of the devices out there, so why not supporting them with our apps?
Does anyone know where to find code samples/tutorials on integrating google drive with an app written for 2.1+? I just want to sync some data (mostly the app's local database).

You can write a Drive app for any device supporting Google Play Services, which is 2.2+.
http://developer.android.com/google/play-services/index.html

Related

minimum required Android versions for apps whose support "varies by device"

I am researching what minimum versions of Android OS are required by popular apps in the Google Play store, but I'm having trouble finding that information for certain apps whose minimum OS version "varies by device", as in this screenshot of the Facebook app:
I know I can answer my question by exhaustively attempting to install the apps on devices running different OS versions, but this would be a monumental task if, say, you wanted to find out the minimum version for a list of 10 apps.
Is there an easy way to find out what the minimum Android version is for different device models in Google Play?
There seems to be no proper way of getting all data for all devices. I found some info about how Google Play makes this data available here: https://developer.android.com/google/play/filters#filtering-on-the-google-play-web-site.
So there is no better way than to try with different devices. One possible way of making this less tedious is to log in with a Google account on multiple devices (you can even log in on emulated devices) running different Android versions. You should then see which devices from your list support an app on the app's page on the Google Play website.
Original answer:
When I open an app's page in chrome on Windows, I can just scroll down and see
ADDITIONAL INFORMATION -> Requires Android -> x.x and up
I think inside the Google Play app itself, you can only find apps your device (on which Google Play is installed) supports.
When you creates new project in Android Studio, there you can find the versions, with that you can create an app
Also you can look in version distribution to see, what versions are currently in use.
And in wikipedia you can look, which verisons are supported and what name is what API level
With support of 26+ you will create an app for almost 80% of all android users (at april 2021)

How can i use older version of google play services?

I'm using Google Cloud messaging through google play services. The things is it only works on the devices with last version of play services installed, in remaining devices i need to show a dialog to send user to google play to install new version witch i really don't want to do!
So how can i avoid this?! I'm trying to use an older version of play services (lets say from 2 years ago) to insure majority of my users don't need to update but it seems impossible with grade and android sdk since it already deleted older versions! So what should i do? Is there any way to use older versions?! and if do find a way to use an older version are newer versions compatible with older one?
I don't want to force my users to update because
GCM it's not essential to my app although i like to have it!
It's over 30 MB witch is a lot in third world countries were my users are.
Google play blocks some of my users from accessing google play due to international lows! and i have to do update manually my self!
There is a solution for android studio:
1.Close your project
2.Browse to the folder where your projects has been saved
3.Go to folder 'app' and open the file 'build.gradle'
find this line :
compile 'com.google.android.gms:play-services:7.3.0'
and change the version (here 7.3.0) to an older one (like 6.5.87).
You can find out available versions by looking at sdk/extras/google/m2repository/com/google/android/gms/play-services
5.open the project again
Unfortunately Google Cloud Messaging was only added to the Play Services API in version 7.5, which was released end of May 2015 (see this Android Developers Blog post).
So, if you manage to find a copy of the v7.5 API (see my question regarding that here) or if the suggestion above by #Babak is safe (still investigating that one... and you can only go down to 7.5.0 before you lose GCM support), you might be able to gain a few months, but it will likely not make a huge difference...
Actually, I just noticed that your question was also posted end of May... So you probably won't be able to gain anything. But you may reduce support of you move to a new API version later!

Whether google play services is a built-In installation in every android phone?

I had seen some android mobiles that doesn't have google play services. For using GCM, developers need google play services.My doubt is "Whether any android API level has built-In installation of google play services into android mobiles?". Or google play services is an optional installation in android mobiles?
No, the Google Play Services are not mandatory. There are some devices out there that don't offer them as they cost licensing fees and you need to setup the device so it "promotes" Google services. In general Android is open source and free and can be used without these services. But as they are tremendously useful most people want to use them.
Android devices without them are e.g. the Amazon Fire tablets, a lot of local Chinese devices, the new Nokia Android phone (who will ever buy one of these and why??), or most devices with custom ROMs (e.g. Cyanogenmod). As the services add a lot to Android and in fact are seen as substantial to most users, adding them afterwards is possible while not always legal (but why would Google prosecute people who want to use their services?). It is not legal to deliver these services with custom ROMs but you can find them on certain download sites. It is not always fun to get the exactly correct version and to get them working.
Usually all android phone will have play service as built in app.if not You can use the below app to use GCM,Map etc. in your app
https://play.google.com/store/apps/details?id=com.google.android.gms
For more details
http://developer.android.com/google/play-services/index.html
Google Play Service isn't mandatory for Android to run, I think it's 98% included in any Android OS because you need it for others Google Apps (Maps, Play, Google + etc)
But as you can see, it's a standalone app : https://play.google.com/store/apps/details?id=com.google.android.gms&hl=fr
So if you use it, you can check if it exists on the mobile before doing anything (and perhaps popup a Dialog to invite the user to install it)

Is there a good reason we should not always use Google API SDK?

So far, I used the regular SDK in most projects, and used Google API SDK only when the project will utilize some of Google's feature.
I am now wondering is there a good reason I should NOT always use Google API SDK?
There are devices without Google services installed. In this case the Google API is not available. By not using the Google API SDK, your app can still run on these devices.
E.g. consider the Kindle Fire, it doesn’t have the Play store installed, as well as various low-budget tablets and Chinese phones. Custom builds from the open-source code such as Cyanogenmod also don’t have the Google apps installed (although many users add them manually).
Although Android itself is open-source, the Google apps require the vendor to get a license from Google. I know this because custom builds were asked by Google to not include their apps. Also having their own store instead of the Play Store is attractive for some manufacturers because then they get a share of the revenue instead of letting Google have all the profits. This is why not all devices have them.
One potential reason is this: why should you include something if you aren't using it? When you write a new class, do you import the entirety of the Android framework? No, you wouldn't, because at worst it could cause problems in your code, and even in the best case it takes up extra space in your resulting APK.
I'm not sure how much additional space would be taken up in memory/storage by building your app using the Google API SDK, but I can't imagine it's 0, and in mobile development you can't really afford not to be judicious with resource usage.

Android, official download location for google play apk for testing?

I have some functionality for rating my app and for viewing/installing other apps I have on the marketplace that I need to test in the android avd emulator. To do this I need to have the latest google play apk installed but I am unsure of the official location to download this from so I can install it on to the emulator.
Lot's of the sources I have found are for file sharing sites and out of date apks and I would be grateful for a link to the official apk. For some reason best known to themselves I don;t seem to be ble to get it from the main google play site. this is most confusing!
Or is there another way to test market app functionality on an emulator?
what you are looking for is: "market://details?id=" + APP_PNAME
I strongly recommend using the android code snippet app rater
good luck
First, this is not a programming question. Second, there is no such thing as an 'official download location'. The Play Store application is only available on licensed devices. Even if you pulled the apk from your device, it won't run on the emulator as is, since it requires other components as well. So, test on a real device if you need access to the Market/Play store.

Categories

Resources