All Episodes

October 4, 2022 42 mins

On this episode of Android Bytes, we take the wraps off Google Play Services, the wonder app that powers many features and APIs you probably thought were native to Android.

What does Google Play Services do and how does it do it? Why is it so important and what happens when it's missing from your device? We spoke with German developer Marvin Wißfeld to find out. Marvin is the creator of microG, a "free-as-in-freedom re-implementation of Google's proprietary Android user space apps and libraries" for devices running AOSP.

  • 02:59 - What is Google Play Services (GMSCore) and how is it delivered to Android devices?
  • 04:14 - What are some of the features powered by Google Play Services?
  • 07:27 - What are the most commonly used APIs provided by Google Play Services?
  • 08:23 - How do Play Services' location APIs (Network Location Provider [NLP] and Fused Location Provider [FLP]) work? Why do many apps use Google's location APIs?
  • 11:20 - What advantages do apps have in using Google's Firebase Cloud Messaging (FCM) over alternative push notification APIs?
  • 13:28 - How are push notifications handled in the Chinese market where Google services are banned?
  • 18:07 - How do apps tend to behave on devices without Google Play Services?
  • 23:02 - What is microG and how does it help work around some of the issues with running apps on AOSP?
  • 26:40 - How do users install microG and why is signature spoofing needed?
  • 31:00 - How does the modular nature of Google Play Services optimize its app size?
  • 34:57 - Have any Google APIs eventually made their way to AOSP?
  • 36:43 - Are there any Google APIs that work on AOSP?

Android Bytes is hosted by Mishaal Rahman, Senior Technical Editor, and David Ruddock, Editor in Chief, of Esper.


Esper enables next-gen device management for company-owned and managed tablets, kiosks, smart phones, IoT edge devices, and more.

For more about Esper:


New from the Esper blog:


Our music is "19" by HOME and is licensed under CC BY 3.0.

Mark as Played
Transcript

Episode Transcript

Available transcripts are automatically generated. Complete accuracy is not guaranteed.
Mishaal (00:02):
Welcome to Android bites, powered by Esper, the podcast diving
deep into the world of Android.
I'm your host, Michelle Ramon.
My co-host David Ruddick wasunable to make it this time.
So you'll be hearing evenmore from me this time around.
Fortunately, we've got a greattopic and guest I've been wanting to
talk to for a very, very long time.
We're finally dedicating an episodeto talking about Google place
services and that it's so complicated.

(00:23):
It's basically Android's black box.
This one app powers.
So many different features, peoplethink are actually part of AOS
P and provides so many crucialAPIs, which many apps depend on.
It's a single biggest differentiatorbetween AOS P and GMs, Android, and
is both how Google is able to provideso many different features, services
and APIs across Android devices, aswell as lock those devices into their

(00:44):
ecosystem that lock in is somethingtoday's guest takes issue with.
On today's show.
I'd like to introduce Marvin Feld,the principal maintainer of MicroG a
free and open source reimplementationof Google place services.
Welcome to the show, Marvin.

Marvin (01:00):
Hi, thanks for the introduction Rashi.

Mishaal (01:03):
Yeah.
So before we dive into thistopic, I wanted to ask you to
tell us a bit about yourself.
What do you do right now?
And how did you get your start in?

. Marvin (01:11):
Right now I'm basically an open source developer.
, my main job is reallyopen source development.
I'm also freelancer for allowing meto , get some more income so that I,
can focus on open source development,which is not that well paid.
And I'm mostly working on two projects.
MicroG which you just mentioned and Dino,which is an instant messaging app, and
yeah, in the development I started, Ithink around 2011, I got my first standard

(01:36):
Android phone which was a HTC desire HDin case anyone remembers that device.
And yeah, I seen begin thinking with itand playing around and , things like that.
And yeah started also developing, first steps at that time.
And.
Around I think 2012, I already completelyditched Google services from my phone.

(02:00):
, that was basically also the time whereI started also developing what could
be considered , the first precursorsof MicroG which is an alternative to
the network based location providerand an open source implementation
of the Google lock in service.
So, yeah, that's , how I started into this

Mishaal (02:18):
2011 was a wild time in that, era of Android.
I think most of us in this, the techindustry who cover Android, , for a
living nowadays, we all started outlike, Shopping around on XTA because the,
stock Android experience on phones backthen was just generally not very great.
So, custom ROMs and all sorts of wildmodifications were, really hot back then.

(02:41):
But, , nowadays it's not as popular.
There are still a thriving communityof users who want to DEO their
devices and they want to, , own the,the software running on their phone.
So MicroG is a crucial project inenabling users to DEO their devices.
But before we dive into MicroG, I wantedto lay down some background information.

(03:02):
So our listeners areall on the same page as.
So Google play services, it'spresent on all GMs and Android
devices without exception.
It's part of GMs core services.
And in fact, Google evencalls it GMs core internally.
So we've talked extensively about howGMs is licensed and why OEMs choose
to license GMs in previous episodes.
So I won't be retreading old ground here.

(03:24):
All you need to know is that Googleplay services is basically ubiquitous.
In fact, whenever Google provides anestimate of how many Android devices are
in the wild back at IO, they said therewas about 3 billion active devices in use.
They're likely using Google playservice to make that estimation
because it's literally installedon nearly every consumer, Android
device out there with the exception.

(03:45):
Devices that are soldby Huawei for reasons.
You can look up that are morepolitical than anything else, as
well as devices sold in China, whichis a long standing, , Complication
with Google services in China.
, Google services it's present on everydevice and it powers so many features
that user may not have been aware of.
Like there are features that it's actuallypart of Google based services, but the

(04:09):
user may think it's part of the nativeOS or it's just built into their phone.
Can you list some of the features thatusers may not be aware are actually,
Google place services powered.

, Marvin (04:19):
I guess for this, we want to just, split up those kind of services
that Google play services provideand categorize them a little bit
because there's four types of thingsthat can be found in place services.
So one is the APIs.
it does provide two third partyapplications so that they can
have the developers of third partyapplications can make use of some APIs.

(04:42):
Then there's APIs that arespecifically meant only for Google
apps or good partners that are notpublicly documented anywhere, but
still exist inside play services.
Then play services also extendsthe operating system directly by
hooking into Some functions , thatAOSP provides allowing to extend

(05:02):
features of the operating system.
And then play services also hasfeatures that I would say are more
like standalone features, which any appcould technically provide, but for some
reason, integrated into play services.
So for each of them, there'sprobably , a few things that
people , are not that familiar with.
, for , the public APIs that are oftenused by applications I think the one

(05:24):
that people most often do not haveinsight that this actually is Google
things happening on that device iswhen applications have the QA code
reader like, any, I dunno, share.
Bike app or whatever.
Then you have to unlocked the bike withthe app and you're scanning the QR code
and that part already ISS play services.
So there's , no obvious linkto Google technology here or

(05:46):
anything related to Google, butstill it is running play services.

Mishaal (05:50):
Oh, sorry.
I just wanted , to step in here justto list some user facing features,
like I prepared a laundry list offeatures, cuz I kind of wanna give.
A picture of just how massive thissingle app is and how, much it does.
, if you're familiar with the fine, mydevice feature, which is a way for you
to locate your lost or stolen device,there's an app for that on Google play.

(06:10):
But all that app is just a frontend, the actual service that does
the location tracking and, syncswith the Google servers is built into
play services, Google pay and wallet.
Sure.
There's an app for that, but theactual service that handles adding
your card and holding your wallet andmaking contactless payments, that's
all in place services, the autofill service that's place services,

(06:32):
parental controls, the family link app.
You can download all that doesis let you manage settings.
You have the backup support.
So whenever you're setting upa device or you're making a
backup that's play services.
QR code scanner and Android 13, orthe one that apps can integrate.
As Marvin mentioned, fast playservices, fast pair nearby share

(06:53):
Google cast, the new game dashboard,Android, 13 Chromebook syncing,
Google security, checkups, smart lock.
There's just so much thatGoogle play services does.
That usually may not even be awareare actually provided by the app.
And of course these are user facingfeatures, so that's not really an issue
if they compete with functionality offeredby other applications, but there are also

(07:14):
a lot of APIs that it offers that I thinkwill, you'll start to understand why
it's beneficial and a downside to haveGoogle play services centralize all this.
, can you list some of these APIsthat , you were about to get into that?
Marvin, can you list some ofthe most commonly used APIs
provided by play services?

Marvin (07:34):
So I think , the most popular API is probably the push notification
API and the Google maps API.
So whenever a map is displayedinside an application then that's
a Google map's API typically.
And whenever you yeah, somehowreceive push notifications and
that's the Google cloud messagingAPI for push notifications.
So nowadays called firebased cloud messaging.

(07:56):
Those are really, really popular APIsthen also the fire base API set of
fire base functionality set is handed.
Through place services as well.
So, that's applications making use of ofFirebase authentication, Firebase database
, and a lot of these functionality that'sprovided by Google, which is for the
Firebase SDK, which is meant to allow easycross-platform application development.

(08:18):
All of these functionalitiesrely on on play services as.

Mishaal (08:23):
So you mentioned earlier about you originally started out
MicroG as providing an implementationof the location provider.
Can you explain what exactly, Google based services deals
with in terms of location?
Like what does it offer to apps?

Marvin (08:36):
Okay.
So, basically there's two parts tothe location story and play service.
First the operating system has someextension point where technically
the operating system provider,which on a normal end device
actually is the device manufacturer.
Can inject some network location provider,which then when applications would like to
request the operating systems or ask theoperating system for, for what the current

(09:00):
location of the devices they can eitheruse the GPS or they can use , the result
from that network location provider.
And then play services obviouslyprovides one network location provider.
But often enough the networklocation provider is actually
overwritten or a different oneis used by the operating system.
Interestingly Qualcomm as one ofthe major manufacturers provides an

(09:21):
alternative and many devices, actually,Yemen manufacturers decide to ship that
and on their device instead of havingGoogle play services enabled by default.
That's why at some point Google made anew API called ause location provider
API, which is basically an API that hasthe same feature set as a system location
API, but would never use the systemprovider network location provider, but

(09:43):
always use the Google location provider.
So Google will learn about all networklocation requests and all of them goes
through the Google API and never throughany manufacturer decided network location.

Mishaal (09:54):
So I can understand why developers would jump on using the
maps API provided by place services.
I mean, I think we can all agreethat the quality of Google maps
is just significantly betterthan other mapping services.
But when it comes to push notificationsthrough fireplace cloud messaging
and, location, access through views,location provider, like I don't think

(10:16):
it's leaps and bounds better than.
services.
So why do so many applications?
Use these APIs instead of, alternatives,what is the benefit for app
developers and why do they use them?

Marvin (10:29):
So, for app developers say app, the benefit that if they use the
play services API , or , the Googleprovided APIs here, then , they
basically have some good documented, and already provided code for that.
So that's Google reallyhas the advantage of.
By providing the official Androiddocumentation, they can easily
get developers into using alsotheir not open parts , of Android.

(10:54):
, for example, look into the locationprovider API, the an a S P and the
documentation for that you would actuallythen just directly in the head, I
get an like the upper part, get someinformation that says basically,
yeah, that C and not that good API,please use location provider API
from Google play services instead.
So, Google is really making obviouslyuse here of being the , first party for

(11:16):
any information about the platform.
And then the other partfor push notifications.
It's also the part that the playservices provider for push notifications
is already installed on every device.
So, you already have that installedand you cannot easily Have set up an
alternative push notification providerbecause those need to run always in the
background and the aggressive batterysafety measures of Android will make

(11:40):
it impossible for certain parties toprovide a push notification provider.
So the only option that you actually haveas a developer or the only really good
option is to use the one from Google.
, it's also to some degree, just nothaving , any options or any choice here.
There's even libraries for developers thatallow you to use the push notifications
of Google or any other provider thatis installed so that if you are on one

(12:06):
of the few devices that have somethingelse, you could actually use something
else, but in practice, it will alwaysbe the Google push notifications.
Anyway.

Mishaal (12:14):
Right.
I kind of wanted to, follow up on thepoint about push notifications because
it's a really complicated subject.
, on a desktop PC, you can assume basicallyyou have unlimited power, so you could
have any number of push notificationframeworks running, and it wouldn't
really impact the overall system healthall that much, but on an Android device,
which you assume to be battery powered.

(12:35):
If you have 10 different push notificationservices, all running, foreground
services , and, having these alerts comein, you want them to be real time alerts.
If you have so many different thingsrunning at the same time, you will.
Less of a chance for the deviceto enter its device idle state,
or do mode as Google calls it.
And so with Google play services,which is, allow listed from do

(12:58):
mode and, any kind of networkbattery saver mode, it's able to.
Actually react to push notificationevents in real time without having
to be restricted by Androids, do modeand battery saving features, which
are intended to save battery life.
It's both.
Reducing power usage, consolidatingpush notification services.
But at the same time, it forces everyoneto use fire based cloud messaging,

(13:22):
which also means that push notificationsbecome entirely dependent on Google.
And there's one market wherethis is completely not true.
And that's the Chinese market.
And I wanted to ask you, Marvin,do you have any insights about the
situation in the Chinese market?
, can you talk about.
The decentralized push notificationthe other APIs there, because
, Chinese and your devices don'thave Google play services.

(13:44):
So can you talk a bit about that?

, Marvin (13:46):
I'm also definitely not an expert on that, but I know , there's
several basically push providersin the Chinese market , and often
enough apps just provide theirown version of a push provider.
Or the, also the operating systemcomes even with multiple push
providers installed already.
Then the application can connectto those and have an option which
push provider they want to use.
But on the other hand that makes all the.

(14:07):
Other Chinese custom versions of Androidoften having very weird behavior when
it comes , to battery optimization.
So it can easily be that an applicationthat works great on our GMs Android
device will just not work properly , onthis Chinese branded ROMs because.
, the battery saving measuresjust, work completely different.
That then basically causes maybeeven more issues than just having

(14:31):
, the OID way, how Google does it.
But I wanted all to chip in on the issueof push notification on the battery.
I think there's generally a little bit.
Misconception that if you have multiplepush notification providers that would
not significantly actually increasethe battery usage because each of
them, as long as it's only a pushnotification provider could be , a good,

(14:53):
well done efficient push notificationprovider, similar to how a DMS.
Actually is in the, at least forthe push notification part , is
very good in, in battery efficiency.
But doing that three times orrunning that three times will not
have any significant impact on thebattery because basically that.
A push notification provider that runsalways in the background would just

(15:14):
rarely actually cause any network orCPU activity because you just have to
keep a persistent connection , to thepush notification server side and for
a connection to be kept persistent.
You just have to send some pingpacket around two times an hour.
, waking up the device two times an hour tosend just a single packet as obviously
not a lot of resources, but doing that10 times and sending , 10 packets would

(15:36):
also not be an issue if at least those10 packets are sent at roughly the same
time, because then you still have halfof the hour that you can be in those
mode , and just wake up, send 10 picketsand then sleep another half an hour.
And then basically you still havethe same battery consumption or
similar battery consumption thanif you have just one push provider.
So the issue is less that multiple pushproviders would need needing more energy.

(16:01):
The issue is more that mostalternative push providers
that exist are just far less.
Well done than the Google one.
And that then obviously has otherissues because the operating
system would already take care.
So AOS P already takes careof synchronizing those network
requests so that they are at thesame time those ping requests.
So that would already be possible.

Mishaal (16:23):
Okay.
Yeah.
Thanks for the insight.
I wasn't really sure of how quantifiable, the power use actually is from having
multiple push notification providers.
But I guess , the user experience mightbe impacted because to have each of those.
Per running persistently, even if thebattery drain is negligible, they'd
still require foreground services.
Right.
And that would thus require themto have, persistent notifications.

(16:45):
And then you have all these different,notifications running for each app that
needs to have notifications being sent.
And then, , notificationspanel becomes kind of a mess.
And yeah, I can see why, like a lotof OEMs, Chinese OEMs, reacted so
aggressively with their battery savingmeasures because , they can't really
guarantee that a user is only usingmaybe one or two highly efficient

(17:09):
push notification services or theirapps are using are using those
efficient push notification services.
So they kind of respond with these highlyaggressive background management features
that are often enabled by default and.
Those features are often enabledeven on the international
versions of their devices.
So you have Western reviewerscomplaining about their apps, not working

(17:29):
because app developers are expectinga S P like behavior, but then they're
encountering these Battery savingmeasures that aren't really comporting.
They aren't really , following CTS andwhat you would expect on an AOSP device.
So if you're wondering, the rootcause of these aggressive battery
saving measures on mostly Chinesebranded OEM devices, this whole.

(17:53):
Decentralized nature of the Chinese marketwithout access to Google play services is
, the root cause it's to blame, but that'snot being said, that is one benefit.
One like tangible benefit tohaving a centralized, Google
play services provider, providingall these APIs and services.
But of course the downside is that.

(18:13):
In the west, at least kindof most app developers.
You kind of assume that if you'redealing with an enter device, it has
Google play services installed, andthat's not going to be true on every
device, especially if you are a poweruser and you opt to install, an a O S P.
Custom RO or you DEO your device or,you'd like to customize an off the shelf

(18:33):
device for, enterprise use, then you'renot going to have Google play services
installed, but because most app developersassume it's there, they don't use the,
libraries that Marvin mentioned thatallow the app to actually change providers
based on what's available on the device.
So I wanted to ask youMarvin, can you talk.
The experience of actually using anapp that depends on play services

(18:57):
on an AOSP device that doesn't havesomething like MicroG installed.
What can users expect from theirexperience of using these apps?

Marvin (19:04):
Well, if the app really completely relies on play services, then often
enough just start trying to solve.
It will basically , the app will justshow in dialogue saying you need to
update or install, play services.
And if.
Say yes or, okay.
It will , try to open the play store,which then doesn't happen because
the play store is not installedand then will just not work at all.

(19:25):
Some applications are a bit let's saymore, resilient to that situation.
But the behavior often isnot, much better so often.
For example, if if you have an applicationthat shows Google map, API embedded
normally, and then if play service isnot installed and you are trying to open
the part of the app where the map isshown, it would just crash instantly.
So that's one thing that you can.

(19:47):
Then obviously you have to issuethat if the application silently
ignores the fact that it does notreceive push notifications, then
the behavior of the applicationmight make it completely unusable.
Think of maybe WhatsApp, justwithout getting a notification
for incoming messages.
I mean, that would be completelyuseless as an application.
If you always would have to openWhatsApp just to check if there's a new

(20:09):
message or some applications even worse.
Rely on the push notificationsystem to actually show the
notification to the user.
So even if you would be opening theapp manually, you would still not
see the information that would becoming through the push notification.
So some apps , are really badin supporting non GMs devices
and . behavior can vary lot.

(20:30):
What you see a lot is really applicationsshowing , some popup saying you need to
update, play services that are common.
And then if you ignore that popupthen , what happens afterwards
, can be basically anything.
, and you're on your own ifyou try , to use the app in

Mishaal (20:44):
that situ.
Yeah.
And just to reiterate play services,the APIs it provide, it's not
just push notifications and alocation provider and the maps API.
There's a laundry list of APIs thatit provides also including Fido.
So for authentication purposes, thenew ultra wide band API ML kit , you
can provide in like a barcode scanner,as Marvin mentioned, play games.

(21:05):
So if you're, wanna synchronize or storegames, data, Google servers, safety net
at a station the wearable API, if youwant to transfer data to a wears device,
Google fit, and any apps that use, firebase for analytics data, although, play
services, doesn't directly provide it.
Those SDKs do depend on playservices being installed.

(21:26):
So you might have an app that's completelynonfunctional or just crash on launch
because they don't have an exception.
For in the case of play services, notbeing installed, you might have an app
that's just missing some functionality.
Like, as Marvin mentioned, you notgetting notifications, or you might
just have some, one or two obscure bugsthat you don't even realize until you

(21:47):
actually try to, enable the feature.
Your mileage is going togreatly vary because they.
Don't really account for the situationwhere play services is not present.
They kind of assume it's there.
The vast majority of, appsdistributed on Google play assume
you have play services installed.
And when you don't, you're on yourown, you gotta figure things out.
And there are websites andtools you can use to figure out,

(22:10):
Will this app actually work?
Will it work well on my, a SB device?
You could install an AO S P build on intheor or a GSI on a real device and then
run it and then just see what happens.
See what's working and what doesn't work.
You could also, inspect the APKto see if there's any, included
permissions or libraries that,relate to GMs functionality.

(22:32):
There are third party sites likeplexus that, are user contributed and
Exodus, which, analyzes, trackers.
, you could see if there's any firebase or any GMs or Google ad services.
Like.
Libraries integrated, but overallreally you're on your own.
You gotta test the app.
You just gotta, if you know the app,and if , you develop the app, then you

(22:52):
probably know what you're using, but ifyou're a user of an app, then it's tough
to actually work around and getting alot of your favorite apps up and running.
One thing you can do is installMicroG and while it doesn't
provide every feature and API thatGoogle play services provides.
It does provide some of the corefunctionality or reimplement,

(23:14):
some of the core functionality.
So I wanted to ask you, Marvin, can youtell our listeners exactly what is MicroG
and how does it, solve the issue of a lotof apps being completely broken or having
key functionality missing on AOSP devices?

Marvin (23:28):
Sure.
So, Myrie is basically just to completereimplementation of the play services.
But obviously it's not complete.
So, it's currently only implementing asupset and it's very likely that it will
never provides the full functionalityjust because Google is also constantly
adding new functionality to play services.
So, will be impossible , tokeep catch at any point.

(23:48):
But at, at least for , the APIsprovided to a third party it's basically
already good enough to have many appsworking far from supporting every app.
But yeah.
also heavily depends on thefunctionality needed by the application.
So just to , give an idea which APIshave provided obviously push notification
is provided so that applications usingGoogle cloud messaging or fire based cloud

(24:11):
messaging can receive push notificationa location providers available Google
maps, implementation based on actuallyopen street map data design, and.
original Google web data becausethat's not available to set parties
functionality for safety net, which isused by a lot of banking implications.
, the QR code scanner that I mentioned isalso available and then a few smaller

(24:34):
parts where we try to at least have some.
Stop implementation, implementation thatis incomplete, or doesn't actually do
something useful, but we'll make surethat the application trying , to use that
API will at least behave , more usefulthan than if it wasn't present at all.
So for example, if an applicationwants to use, Google drive API to

(24:56):
access your Google drive contents.
Then we would just return thatyour Google drive is always
empty, which is still better thanhaving the application crashing.
Of course.
So, yeah, , that's , something that,is in, in MicroG for APIs that are
not actually properly supported.
And yes, that's all thefeatures, , basically the idea
of what MicroG can provide.
So that third party applicationsget, , the functionality back that

(25:19):
they originally were meant to have.
We are really focusing , on thethird party APIs and not the
other parts of play services.
Although it's always alsointeresting to look into those and.
It's always motivation to also lookinto maybe implementing some of
them but supporting applicationsor , that wanna use the third party.
APIs is , much more important right now.

Mishaal (25:42):
Yeah.
So, first of all, I wanna really applaudyou guys, you and whoever else contributes
to MicroG because play services, asI mentioned is a complete black box.
It is proprietary and closed sourceand there is no public documentation
for all the features that it offers.
So like being able to actually.
Peel back the layers of playservices and provide some of the same

(26:06):
functionality in a way that's transparentapps is a really impressive feat.
And , it's a constant challengeto actually keep up with play
services because through playservices, Google is able to just
roll out new features like that.
The earthquake alerts, the air raidalerts, , the COVID 19 exposure
notifications is a big one wherethey, within a matter of months, we're
able to roll out this feature to.

(26:27):
Billions of devices around theworld nearby sheriff is another one.
And like all these features it's likebeing able to keep up with Google
is not an easy feat, especiallybecause , none of these are open source.
So, yeah.
Great job on MicroG.
I did wanted to ask you though, , youimplied this basically that apps don't
really have to actually support MicroG.

(26:47):
They don't really knowthat it's MicroG installed.
They're using the same Google driveAPI call, but instead MicroG will
feed them that the drive is empty.
So instead of crashing, they'll justreturn empty, receive empty data.
So this kind of implies that you're kind.
Replacing Google play servicestransparently, but I wanted to
ask you about this actual process.

(27:08):
Like how do you actually installMicroG in a way that makes apps think
they're talking to play services, butthey're actually talking to MicroG.

Marvin (27:16):
Yeah, sure.
So, , maybe some history here.
I mentioned I was doing the networklocation and Google look in manager.
And also back then, what was calledthe Google services framework.
And for all of those services, theywork, they, came pre-installed
on the device, of course.
And they basically had.
API, which on Android is basicallyspecified using a service name

(27:40):
and appropriate Android interface,definition, language file, which is.
Then used to specify howto connect to that service.
All of these services that Googleprovided previously had those
available, and that was howapplications were meant to access it.
So basically replacing those.
Was super easy because I would just haveto provide the server side of those and

(28:02):
install my application to, or my veryend of that Google service to the system
petition just like, the original one was.
And then the applicationwould just pick up that one.
And because I provided a service whichruns on the same intense filter.
, that's absolutely no issue.
And when they introduced playservices, they had the issue, they

(28:22):
were doing something that was new.
So, back then play services was notshipped on the device , nowadays it's
part of the system as well as anyother Google system part, but when
they originally introduced it, , inthe times of, I don't know, Android
four got something, I don't know.
Then They had to installit as a new application.
Basically it was automatically installedthrough the play store, but still it

(28:42):
was a new application that was notshipped with the operating system.
And for that reason, they had to dosomething new to protect applications
from using , some malicious versionof play services that could exist that
Would then be installed the same waythat play services installed, which is
just a normal application at that time.
So anyone could actually install, play,or in any play services thing could be

(29:05):
installed because you could also justlike a normal application, uninstall play
services and then install another one.
For that, they introducedsome signature checks.
So.
Application that the third partyapplication that tries to use play
services will first before accessingas our APIs, which also are not
that easily documented anymore, butthat's another a story I would say.

(29:26):
Before they did allow doing that theyactually, connect to the service provided
as a normal Android service they wouldcheck the signature of the APK that claims
the package name , of play services.
And . That became a major issue , fordeveloping something like MicroG
because if MicroG would just take placethere, the signature would not match.
So the third party application wouldsay, okay, the signature does not

(29:48):
match and behaves basically as if.
MicroG was not installed.
So we had that issue.
And the solution that I came up withis basically a small patch to the
operating system that when the specificcall that the applications or the place
services, SDK, that applications use.
To find figures out just the, thesignature basically replacing that

(30:10):
call or changing that call such thatit returns the, the Googled signature,
even . When the MICG version ofthe, of play services is installed.
So that is very good way , to workaround that issue, but unfortunately
requires modifying the operating system.
So installing becames much harder becauseit's not just, pushing some APK on your
system petition thing, but it became.

(30:32):
Modifying a S P itself.
So yeah, but that's how we canbasically transparently act
as if we will play services.
We're providing just the very sameAPI and through that modification
that is called signatures proofing.
the application that normally woulduse play services , the operating
service system will just tell.
That the MicroG version is the same as ifit was the original play services version.

(30:55):
So that's how we cando it completely trans.

Mishaal (30:58):
Awesome.
Thanks for that explanation.
We've actually talked about this brieflyin our previous episode where we invited
a developer from graph OS to talk abouttheir sandbox or , they mentioned their
sandbox play services implementation.
So I recommend going backand listening to that.
It's a alternative.
To the MicroG approach, butboth are completely valid.

(31:20):
And so I don't reallywanna, compare them here.
I did wanna ask , , if you can sharesome additional insights into the play
services app itself, because from allwe've talked about, this laundry list
of features and APIs and servicesthat it offers yet on my pixel six
pro the app itself only takes up.
550 megabytes of storage.

(31:40):
And, I'm kind of surprised by how muchit's able to offer without being way
bigger than I thought it would be.
So can you talk a bit about the actualstructure or place services, how is
it able to offer so much and yet, nottake up multiple gigabytes of space.

Marvin (31:59):
Okay.
So I, guess if you're talking about500 megabytes of space, then that's
probably already including the datapart of the app, because I think , the
APK download itself is probably goingto be, 100 or 200 megabytes only right.
I'm following that.
I'm not following that theamount, but should be around that.
And that's because.
other parts of play servicescan also be fetched later.
So, Google invented some system herethat allows to basically load modules of.

(32:24):
From the Google server with statusthat do not come with the APK itself.
And those modules can also beremoved if they are not used anymore.
Although that typicallydoes not happen a lot.
So once you have an application thatuses an API that is only provided
through module, that is an externalmodule, then obviously , you typically
continue to use that application andthen there's no way to uninstall.

(32:45):
Module again.
But yeah, basically they have apackage manager inside place services
to make sure that the neededfeatures are there when needed.
But that you do not need the full spacefor all the features all the time.
But I also think that another trick thatthey do is , what you already mentioned
that , for many of the features, likefind my device, things like that., they
have an extra app for actually using it.

(33:07):
So while the core technology itself,the logic , of the service is inside
play services . Also big parts ofapplications, which is, assets like
images, user interfaces, and so on.
That's not part of play services or oftenonly parts of it part of play services.
So that makes it easier for Google to.
Ship all of these basically have findmy device installed on your device

(33:27):
already inside the play services.
But if you want to use it andyou need the user interface, then
you'll download another package.
And that can give you anotherfew megabytes , storage just for
the launcher application as tosay because that has the assets
that are needed to, define mydevice and the same applies to
other functionalities as well.
Like, the Google pay, for example,it's a similar situation there.

Mishaal (33:49):
Yeah.
And often from what Isee, Google tries to.
Make these features appear as if they're,natively integrated into the Android OS
by, some mechanism in the settings appitself that allows other system apps
to inject their preferences by havinglike a special intent filter defined.
And then, Google goes the extra milein theming, a lot of these activities.

(34:10):
So they feel like they'rebuilt into settings.
, a lot of these features, even though.
Part of it is provided by play services.
Part of it's provided by another app.
You download, it all feels cohesive andpart of Android itself, even though if you
download a OSP, all of these are missing.
, there's just so much provided bythis gargantuan mega app that you

(34:30):
just probably will never be aware isactually provided by play services.
Although it is quite easy totell, is something play services
or is it this actual app?
Like if you open a settings page and thenyou just swipe up to the recents app,
And then you long press on the app icon.
If it says play services, thatmeans it's part of play services.
So it's actually pretty easyto find out what apps actually
providing the functionality.

(34:51):
Although it, it gets a little Meier.
Once you start digging into the details ofsome of , the backend APIs and services.
I wanted to ask you, Marvin do you knowof any APIs or features that were first
baked into play services, but eventuallywere open sourced and added to AOS P
like, do you know of anything like that?

Marvin (35:09):
we've seen quite a bunch of the other way around, like I mentioned
location is basically just the situation.
There's also GA fencing whichbasically allows you listen for
the event of, being at home or atsome certain spot in the world.
That also was originallyprovided as a, a S P API.
And I think technically it still is, butit just doesn't work on the as P API.

(35:31):
So you have to use the Fu locationprovider for that as well.
So when location we see is pretty muchthe opposite side but I, I'm not sure
if there's really anything , wherethey did it the other way around.
They promised it to do, forexample, for the exposure
notifications, , the COVID 19 API.
Which when originally they said, yeah,we do it in play services because
because you wanna ship it as fast aspossible, but we will make it open to

(35:53):
and put it in ASP in the next release.
And then that never happened becausenobody really was asking for that.
And obviously they were notreally interested , in doing.
Because they were already happy withthe situation inside place services.
So there was no need.
So, I'm not really aware ofGoogle opening things up that,
they previously made close.
So that's, that's somethingI, don't think would be

(36:15):
really much in their interest.
Although there could be somethingwhich I don't have in mind, right.

Mishaal (36:21):
Now that you mention it, you do remind me of announcement.
They made at Google IO about thecross device SDK, which was just
released for developers as a beta.
That's provided through placeservices right now, but at IO, they
did mention that that was going tobe added to a O S P with Android 14.
So we'll see if that ends uphappening year from now , before we.

(36:41):
Move on, to the closing things that Iwanted to ask you, we've kind of made
an assumption that if in SDK is offeredthrough Google place services and an
app tries to use it, and Google playservice is not installed on the device.
That, that functionalitywon't be possible.
It won't be usable.
Are there any SDKs that, an app canactually integrate, they can have

(37:01):
a thin client for, and that even ifplay services is not installed, that
functionality will still work regardless.
Can you name any examples?

Marvin (37:09):
Yes, there's actually a few of those where if the app developer knows
how to do that, then they can have it.
, and for some of them it's alsothe default or Google really
pushes developers to do that.
And I think the one where theyreally do that is , the mobile ads.
So that the advertisements are also shownon , non GMs devices because that's also
good for Google if those ads are shown.
So they are interested in having that SDKshipped on as many devices as possible.

(37:33):
And third party providers doingthat for them's also good for them.
So, that's why they do it at, forthe mobile that, but there's also
few, I think the the ML kit can dothat, which is used for the uh,.
RI for example also Googleanalytics can do that.
, if the app is using Google analyticsor Firebase analytics for many
of the Firebase services, that'sactually technically possible, but

(37:53):
many application developers do not.
Make use of that or . Maybe it'sjust not possible because they
are not releasing the packages.
So, at least from, what I cansee , on the MicroG side, how
the requests are done I know thattechnically it could also be bonded for
basically all of the fire base APIs.
So, yeah, generally bundling some of theSDKs directly with the application is
something that's possible for, some ofthe APIs, not all of them, of course.

(38:15):
But yeah beside, for the mobilethat I don't think it would really
push us or lets developers knowthat this , maybe a good idea.
They would just not tell theuser or make it a smaller site.
And then they just have that featurebecause it might be just, it's a
requirement for more providing that APIfor, I don't know, maybe some government
or things like that, so they have it.
But they don't reallypush developers to use it.

Mishaal (38:38):
Right.
And this is the part where I'm goingto be plugging Esper, because if you've
been listening through this entireepisode, then I'm sure you'll agree.
That play services is really, reallycomplicated and it's not easy figuring
out whether or not you actually.
Need to have it installed on your device.
And if you're an enterprise that asksquestions about whether or not your
fleet of dedicated devices needs playservices and thus Google mobile services,

(39:02):
come talk to us at Esther deploying GMs.
Android may help you avoid appcompatibility issues, but it's
not always a fast, straightforwardor cost effective solution.
And it's certainly not one werecommend navigating yourself.
If you have a kiosk point of saleterminal or exercise machine, it
doesn't need full Google play access.
But an app you want to deploy to thosemachines may need some APIs that are

(39:23):
provided by play services, or it may not.
We at Esper have extensive experiencewith building and deploying
AOSP onto dedicated devices.
So we can help you deal with any appcompatibility issues or questions
you might have on this front.
Visit our website@esper.io to learnhow to transform your device fleet.
So, Marvin, before we callsoff this episode, I wanted to
ask where people can find you.

(39:44):
Do you have any social media handlesmessaging at profiles or any chat
rooms where people can find you in.

Marvin (39:50):
I am on, MasterONE.
So, if you are happen to be aMasterONE user, which is an open
federated alternative to Twitterthen you can follow me there my
nickname Lama, which is L a RMA.
If you uh, want to do something else.
Technically, I'm also available forchat , on the X and P, which is also

(40:11):
federated tech network for, for chatsystems or instant messaging systems.
So I'm available there as well.
And , you can probably figure out underwhich name and yeah, but , you won't
find me on any of the big social mediaplatforms, because I just don't use them.

Mishaal (40:26):
Yeah, you really adhere to the, Dego life I had to install Dino.
I am on WSL on my windows PC, just,to chat with you for this call.
And I'm glad you responded though.
I was kind of worried.
I wouldn't be able to reach you.,but thank you for taking the
time to join us on Android bys.
And one last thing, if people wanna learnmore about MicroG, where can people go to,

(40:48):
maybe download it or just read up on it?

Marvin (40:50):
Yeah, we have a very small, probably not so good website.
It's microg.org.
But you can also from there, goto our, and there, they it's.
Implementation of GMs core.
That's a nice, nice Wiki where you canget some information you can also find a
lot of information on third party sites.
So that's we, we are kind of a bit weak, on good documentation, to be honest.

(41:13):
Also, especially for developers thatwanna join If you happen to be a person
that is interested in contributing to, toMicroG, then that's also very good reason
to just get in touch with me directly.
, on X and PPP or using Masteronor if you're not on that, , you
can probably also find myemail address on the internet.

Mishaal (41:29):
Yeah.
And if you are looking to DEO your deviceMicroG is definitely one of the top.
Solutions you'll be looking at, alongwith, maybe a few custom ROMs, like
graph OS that we've talked about beforeor lineage OS which is another popular
option, but there are many different waysyou can, take control of your device.
It's whether or not it, you gottaevaluate your own threat model, your

(41:51):
own privacy needs and, consider , isthis a route you want to take?
And , there are some challenges involved.
But there's a vibrant communityof people who have gone through
this already who have, documentedsome of the worst offenders when
it comes to AOSP compatibility.
But I say this is someone who has useda Huawei device, which completely lacks

(42:15):
any GMs, compatibility that it is usable.
, it's not something I'd recommend tomy parents, but it's something I could
definitely use on a day to day basis.
So give it a shot.
If you are interested in, removingaccess to Google play services or
GMs, or just de Googling your life.
And thank you again, Marvin for joiningus and thank you to everyone for listening
to another episode of Android bites.
Advertise With Us

Popular Podcasts

Stuff You Should Know
Dateline NBC

Dateline NBC

Current and classic episodes, featuring compelling true-crime mysteries, powerful documentaries and in-depth investigations. Follow now to get the latest episodes of Dateline NBC completely free, or subscribe to Dateline Premium for ad-free listening and exclusive bonus content: DatelinePremium.com

On Purpose with Jay Shetty

On Purpose with Jay Shetty

I’m Jay Shetty host of On Purpose the worlds #1 Mental Health podcast and I’m so grateful you found us. I started this podcast 5 years ago to invite you into conversations and workshops that are designed to help make you happier, healthier and more healed. I believe that when you (yes you) feel seen, heard and understood you’re able to deal with relationship struggles, work challenges and life’s ups and downs with more ease and grace. I interview experts, celebrities, thought leaders and athletes so that we can grow our mindset, build better habits and uncover a side of them we’ve never seen before. New episodes every Monday and Friday. Your support means the world to me and I don’t take it for granted — click the follow button and leave a review to help us spread the love with On Purpose. I can’t wait for you to listen to your first or 500th episode!

Music, radio and podcasts, all free. Listen online or download the iHeart App.

Connect

© 2025 iHeartMedia, Inc.