Professional Documents
Culture Documents
Hadmama Final
Hadmama Final
Spring 2022
Reichman University
Written By Eran Katsav (All rights reserved)
COURSE STAFF
Week 13 Non-UI Related tasks - Services, Job Services and Work Manager
TODAY TOPICS
• Android is an open source operating system for mobile devices and a corresponding open source project
led by Google.
• You can download the source code from here and create custom variants of the Android OS and you
don’t need to report back.
• free to download, free to alter, free to build into a product that can power just about anything for
Samsung and for everyone else.
• It’s part of Google’s Agenda that everyone should have internet with them.
• Even Google's own phones aren't using an open-source version of Android.
• When each manufacture wants also the Google mobile and play services (which includes the location
service, speech recognition, as set of default applications like photos and Gmail and much more), He has
to adhere the Google as a partner, accept its terms (through these rules google is making money).
• By providing Android as source code anyone can use instead of a standalone product like Windows,
Google can reap the benefits while another company does the work of building and maintaining a living
operating system.
GOOGLEANDROID
MOBILE &OPEN
PLAY SOURCE
SERVICESPROJECT
(AOSP)
• Android is an open source operating system for mobile devices and a corresponding open source project
• The GMS
led by(Google
Google.Mobile Services) Core goes hand-in-hand with Google Play Services and what are also
known as can
• You GApps (Google's
download Apps).code from here and create custom variants of the Android OS and you
the source
don’tCore
• The GMS need is
to the
report back.part of the Android OS
un-free
• freePlay
• Google to download,isfree to alter, free to build into a product that can power just about anything for
SamsungServices an app
and for everyone that
else. connects to the GMS framework and provides a set of APIs that developers
can use to enhance their apps and to make them perform the same across multiple different versions of
• It’s part of Google’s Agenda that everyone should have internet with them.
Android.
• EvenasGoogle's
• It works a set of own phones
API that aren't
is built in using an open-source
a client-server modelversion of Android.
and allows developers to use things like Location,
Maps to show
• When eachthemanufacture
location required,
wants alsoSpeech recognition
the Google mobileused
and by
playallot of other
services apps,
(which Google
includes theDrive to store data
location
service,
like game speechor
progress recognition, as set
use even use of default
Google applications like photos and Gmail and much more), He has
Sign-in.
to adhere the Google as a partner, accept its terms (through these rules google is making money) and
• Appsmake
like Gmail,
the OSChrome, Search
support any andapplication
other even more need
found in these services
the Google playsostore.
that they will work.
By providing
• To •install the GMSAndroid
yourselfasrequires
source code anyone
system can use to
permission instead of a into
put files standalone
foldersproduct like running
inside the Windows,system, and
Google can reap the benefits while another
you can't replace or overwrite files that are in use. company does the work of building and maintaining a living
operating system.
ANDROID PLATFORM
ARCHITECTURE
VIRTUAL MACHINES
• Nowadays Android replaced DVM with ART and added to JIT(Just In Time) the AOT(Ahead-of-Time) compilation
• In ART, During the app’s installation phase, AOT compilation statically translates the DEX bytecode into machine
code and stores in the device’s storage (the app is compiled only once and not on each launch).
• ART benefits:
• Apps run faster as DEX bytecode translation done only during installation.
• Reduced startup time of applications as native code is directly executed.
• Improved battery performance as power utilized to interpreted byte codes line by line is saved.
• Improved garbage collector (will be discussed later on)
• ART with only AOT takes long installation time and space So from Android 7.0 ART is Hybrid and uses also JIT
• Now with ART and the new JIT the application installation is faster. The new JIT constantly does profiling and
improves applications as they run.
ART GARBAGE COLLECTOR
• As we know the Garbage collector is the one responsible to free up memory by deallocating unmapped objects.
• Although GC event is quite fast in a wrong time it can affect performance.
• We want to be efficient about the events so the ART divides the objects into generations.
• A newly created object belong to the young generation and the longer it survives then it moves to the old
generation and there also the permanent generation (usual for the VM objects).
• The idea is that each generation has a limit, when we reach that limit a GC event is trigged this way we can
minimize the GC events. The GC event cause the system to stop executing the current process.
• When the young generation fills up, this causes a minor garbage collection. A young generation full of dead objects
is collected very quickly.
• Eventually the old generation needs to be collected. This event is called a major garbage collection.
• Make sure your code isn’t polluting the memory heap with allot of object since GC events can affect performance.
NATIVE ANDROID DEVELOPMENT
https://www.youtube.com/watch?v=xT8oP0wy-A0
ANDROID JETPACK AND ANDROIDX