29

Google Play Services is a library for Android that offers various goodies, for instance for geolocalization.

While Android is Open Source, Google Play Services is proprietary.
Many developers ignore this difference and link their apps to Google Play Services, making them unusable on devices that are 100% Open Source. Such apps often don't install, or force close when they try to access Google Play Services.

Is there any Open Source implementation of Google Play Services?
Or at least a mock/stub that pretends Google Play Services is present?

4
  • 6
    Not having any experience with it, I cannot make it an answer; but you're most likely looking for NOGAPPS. Still in development, not all parts ready yet, but looks promising.
    – Izzy
    Mar 10, 2014 at 10:49
  • 2
    Such a thing may not exist. See this article which explores the situation as of last fall.
    – Bobson
    Mar 10, 2014 at 15:11
  • Google Play Services is what allows your phone to work. I remember recently reading that all web applications require Google Play Services to work now. Google still wants a piece of the non-stock Android OSes. And the article did talk about Google using the Play Services to take a little more control of Android again. Yes, Android is free and open source, but Google still needs Google Play Services apart of the experience. I did find the Article which I found again on ArsTechnica Mar 26, 2014 at 5:02
  • 1
    @Traven: "all web applications require Google Play Services to work" ← That's wrong. Devices without Play Services can use web applications, and most native applications as well.
    – Nicolas Raoul
    Apr 25, 2014 at 0:43

2 Answers 2

5

µg Project (Brilliantly described by Izzy on his website)

MaR-V-iN started developing what he named the NOGAPPS package - a set of applications and frameworks with the goal to fill the gap of missing gapps package. This project is now continued under the name µg Project .

The main idea of this project was to build a free replacement for all proprietary parts by Google injected into the Android ecosystem.

This is mainly two components these days, both called Play Services :

  • the client library play-services, that is injected into applications by their developers and GmsCore ,

  • the service component used by this library. Play services includes more or less all newer proprietary Android features.

These components are also summarised in 3 parts as:

  1. GmsCore more or less corresponds to the Google Services

  2. GsfProxy complements the core with Google Cloud Messaging for other apps

  3. FakeStore or alternatively Blank Store or even native Playstore

Geolocation

Currently, Android has two APIs for geolocating. One of them being the open source Location API that is implemented by UnifiedNlp , the other one is the proprietary Play Services Location API.

UnifiedNlp alone does not provide any features, but acts as a middleware for multiple backends. All of them can be downloaded and updated using F-Droid

.

Here is a list of backends for geolocation and (reverse) geocoding available:

  • AppleWifiNlpBackend - backend that uses Apple's service to resolve wifi locations.

  • OpenWlanMapNlpBackend - backend that uses OpenWlanMap.org to resolve user location.

  • OpenBmapNlpBackend - backend that uses openBmap to resolve user location.

  • MozillaNlpBackend - backend that uses the Mozilla Location Service to resolve user location.

  • PersonalWifiBackend - Local location provider for WiFi APs using on-phone generated database. LocalGSMLocationProvider - Local opencellid based location provider backend

  • LocalGSMBackend - Local location provider for gsm cells with separate database file (lacells.db)
  • NominatimGeocoderBackend

Install instructions:

https://github.com/microg/android_packages_apps_UnifiedNlp/blob/master/README.md Dedicated XDA thread: http://forum.xda-developers.com/android/apps-games/app-g-unifiednlp-floss-wi-fi-cell-tower-t2991544

Using apps requiring 'Play Services' APIs

Here is a small list of things you may encounter when you don't have the Google Play Services :

  • Some apps do not install because of missing Google Maps API.

  • Some apps fc (force close) at startup bacause of missing Maps API or Play license check issues.

  • Some apps hardcoded links to several Google Apps and therefor force close or react unexpectedly in certain cases.

Here comes µg GmsCore . This app provides an implementation of some Play Services .

Currently the main developer focuses his development only on the portions of play services that are used a lot:

  • LoginService : Allows you to login to a Google account (OAuth)

  • Google Cloud Messaging : GCM (that replaces C2DM ) is a push notification service that is running in background on your phone. It listens for messages, stored by apps using it, in Google's GCM servers (complemented by GsfProxy)

For this to work, your device needs to be checked-in so that apps can know for which Google account they must send their messages.

Play Services Location API

Maps API (v2) : Translates calls to Google Maps API into calls to OpenScienceMap. Displays a map thanks to a lib developed within the OpenScienceMap project.

Requirements:

Your pure AOSP ROM needs to support µg package signature faking. It is the case in Omnirom ( https://gerrit.omnirom.org/#/c/8672/ + https://gerrit.omnirom.org/#/c/13136/ ) and it's coming soon in Cyanogenmod ( http://review.cyanogenmod.org/#/c/106162/ ).

  • Alternatively FakeGApps with Xposed module.

  • 4.4+ ROM that is GAPPS-free

Download:

Fresh builds are available here: http://files.brnmod.rocks/apps/GmsCore/Latest/ . Get play-services-core-debug.apk and here: https://github.com/microg

F-Droid: now available:microG F-Droid repo (https://microg.org/download.html)

Usage:

This app creates an account provider named Google . You can setup it with a google account. Once logged in, µg GmsCore proceeds to device checkin, unless you disabled it. It creates an unique identifier for Google services and strips identifying bits other than your Google account name from this data. For some reasons, it can happen that checkin expires. Here are some independant tricks you can use to force new device checkins: Compose *#*#2432546#*#* (which stands for ##CHECKIN## ) If you don't want to dial or can't because there is no dialer on your device, use an ADB shell as root and type this:

# am broadcast -a android.provider.Telephony.SECRET_CODE -d android_secret_code://2432546

Or... you can just kill/restart µg GmsCore 's process. OS Monitor can help you to do so.

Getting apps from 'Play Store'

There are many solutions to get applications (APK) without having Google Play Store installed. However most of them rely on alternative markets, or you have to get APKs from a program installed on your computer. Even the native Playstore still works (I use it with no problems) alternatively there is blankstore.

Code: https://github.com/mar-v-in/BlankStore

Builds: https://github.com/mar-v-in/BlankStore/releases

Instructions: http://forum.xda-developers.com/showpost.php?p=29115263&postcount=84

Blankstore must be installed as a system app.

Remarks:

As Izzy suggested in comments, this is the one of the easiest ways to implement open source Google Play services and works flawlessly

I would like to express my sincere gratitude to Izzy for allowing me to include this updated information on this newer project carried over from NoGApps, and making reference to his material.

References

  1. Android without Google: microG
  2. Using Android without Google Apps
6
  • Nice sum-up, Xavier! A few suggestions, though: 1) isn't it OpenStreetMap? I never heard of OpenScienceMap :) 2) µG has its own F-Droid Repo which can be used (this is what I do). // Thanks for the credits and references :)
    – Izzy
    Apr 17, 2017 at 8:59
  • @Izzy I have revised the article, yes there is an Open Science project and I included the link Apr 17, 2017 at 10:19
  • Thanks for the update! And I stand corrected concerning OpenScienceMap. Always thought µG uses OpenStreetMap, but you seem to be correct (as a quick check confirms).
    – Izzy
    Apr 17, 2017 at 10:28
  • @Izzy but I also believe there is some openstreet implementation or maybe I am confusing with opencellid. But thanks hey! Apr 17, 2017 at 10:30
  • 1
    VLC wrote a open source replacement Chromecast lib also geoffreymetais.github.io/features/vlc-30/… Jun 20, 2018 at 9:36
7

As explicitely requested by the OP, here comes my answer – with the restriction of missing experience.

Disclaimer ahead:

I have no personal experience with the following. It's just on my "things-to-try" list for a while, so I only checked out the details.

The answer:

NOGAPPS is, according to its description, exactly what you're looking for. The project aims to provide an Android API with exactly the same interface as provided by the Google Services Framework (GSF) – with the difference that they use other services as backends. These services are really Open Source, not proprietary, and thus code can be freely investigated, and a level-of-trust be established.

Parts of the project:

  • Network Location:
    Apache license. Uses a local database (stored on SDCard), or the Apple database. I thought I remembered something of using OpenCellID here, but at least the linked XDA article doesn't state so. State: Release (i.e. stable)
  • Maps API v1:
    LGPL. Uses OpenStreetMap as backend. State: Beta
  • BlankStore:
    An open source Google Play Store client. Apache license. State: Discontinued

Not useable, but in-the-works:

  • LoginService. State: dev
  • Services Framework. State: dev
  • Maps API v2. State: unknown.

Though using other backends, NOGAPPS presents the very same interface. So apps relying on some proprietary Google code to work shouldn't notice, but transparently using the Open Source pendants offered. Of course only when available (e.g. LoginService is still unavailable, so it cannot work). I have no idea whether there're "dummy interfaces" for not-yet-completed stuff (to make the apps think e.g. the LoginService is there, but currently no server can be reached – so they don't crash but just lack the corresponding functionality).

To me, that sounds like a brilliant thing. And had I known a little earlier (before I re-flashed my last device), I had tried that instead of the GApps :)

For further information, details on ongoing development, etc., please refer to the linked XDA page of the NOGAPPS project.

NOGAPPS: Help develop an Open Source replacement for Google Play Services

5
  • 2
    PS: You might also wish to see Android without Google 5: Free your Droid!, I've started using it :)
    – Izzy
    Aug 29, 2014 at 13:21
  • It seems NOGAPPS has turned into microG: microg.org
    – Tin Man
    Dec 24, 2016 at 17:47
  • @TinMan Doesn't only seem, but is a matter of fact. The switch took place more than a year ago – but only after I posted this answer :) You can now find it at Github as well.
    – Izzy
    Dec 27, 2016 at 18:11
  • @Izzy great answer, is it okay if I make a reference to microG, I am currently using it and everything works fine including native playstore, only a bit of issues with geolocation which sometimes is not accurate? Apr 16, 2017 at 14:17
  • @xavier_fakerat µG is the successor of the NOGAPPS project. Note this answer here is from 2014, where µG didn't yet exist :) And it's much easier to install, of course :) For details, I wrote an article a while back you might wish to refer to.
    – Izzy
    Apr 16, 2017 at 16:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.