-1

I'm working on an App that uses Google Play Services' GcmNetworkManager. This feature was introduced in v7.5, so to maximize the number of devices where my app will not need to ask the user to update Google Play Services, I would like to build my app against that version of the API files.

Unfortunately, I don't seem to be able to select an older version in the Android SDK Manager. There are several websites that come up in a Google search that provide older API versions, but none of them seem to be official Google pages, so I'm a little hesitant to use them for security reasons.

I'd also rather not use the trick suggested in the answer to a similar question here (https://stackoverflow.com/a/32859695/1217178) since I have no idea whether there are parts of the API that will crash if they are tricked into executing against an untested older version of the APK.

Community
  • 1
  • 1
Markus A.
  • 12,349
  • 8
  • 52
  • 116
  • 1
    If you're using Android Studio, it's just a matter of specifying the desired version number in your `compile` statement. If you're not using Android Studio... um, the clock's ticking. :-) – CommonsWare Nov 19 '15 at 01:08
  • @CommonsWare That's the "trick" I was referring to in my question. Is this actually safe? I.e. is it downloading/building the actual older version of the API? Or does it just change some flags to say "ok, fine... I'll also run with v7.5", which I would consider a bit dangerous since call signatures may have changed... And, yeah... I hope the clock is ticking slowly... I really like Eclipse and can code for all other platforms in it... I'd hate to give it up and have to make room in my head for yet another tool... – Markus A. Nov 19 '15 at 01:11

2 Answers2

2

Is this actually safe?

Well, it's kinda the point of having artifact versioning. Presumably, Google intends to keep those older artifacts around in your local Google Repository.

If you're seriously nervous, back up your developer machine. (and if you're not seriously nervous, also back up your developer machine) You can always rummage around an old backup to grab the artifacts and cook up some means of using them in your app.

I.e. is it downloading/building the actual older version of the API?

It is compiling into your app the JARs/AARs that represented the Play Services SDK for that version. It's how all artifact versioning works. If you go to your Android SDK installation, and look in extras/google/m2repository/com/google/android/gms/, you will see the various artifact names. Go into those directories, and you will see the versions. Go into a version directory, and you will see the files. Go into the files, and you will see the bits. You can try diving down into the bits to see electrons or something, but I think that'll be carrying it a wee bit too far.

CommonsWare
  • 986,068
  • 189
  • 2,389
  • 2,491
  • That makes sense. Is artifact versioning available in Eclipse somehow? Or is there some official download-page where I can grab the artifacts to manually include them? – Markus A. Nov 19 '15 at 01:22
  • @MarkusA.: "Is artifact versioning available in Eclipse somehow?" -- Google doesn't distribute it that way. "Or is there some official download-page where I can grab the artifacts to manually include them?" -- none that I would rely upon long-term. Did I mention that you should back up your developer machine? :-) – CommonsWare Nov 19 '15 at 01:28
  • I found an official source (see below). But you are correct, this might go away any time, so I already downloaded all of them (just in case) and added them to my multiple on- and off-site RAID backups! ;) – Markus A. Nov 19 '15 at 01:30
0

I guess I should have searched a bit longer... Here's the answer I was looking for:

https://stackoverflow.com/a/26838281/1217178

More specifically:

The v7.5.71 API files are available at
           https://dl-ssl.google.com/android/repository/google_play_services_7571000_r25.zip

Community
  • 1
  • 1
Markus A.
  • 12,349
  • 8
  • 52
  • 116