Android

Android

History

Android is an operating system based on the Linux kernel and other open-source software. The open-source portion is called AOSP (Android Open Source Project). Many parts of the Android ecosystem (Google Play Services, Google apps) are proprietary.

Android Inc. was founded in 2003. Google acquired Android Inc. in 2005. Android originally targeted digital cameras, then pivoted to mobile phones. The iPhone (2007) changed expectations dramatically and pushed Android to redesign itself to compete in the smartphone space.

Oracle sued Google in 2010 for using Java API structure without a license. After many years, in 2021, the U.S. Supreme Court ruled Google’s use of Java APIs was fair use.

Android’s original VM was called Dalvik. It was replaced by Android Runtime (ART) in Android 5.0 Lollipop (2014). ART provides better performance thanks to AOT compilation.

Android Studio is the official IDE for writing Android software. It was announced at Google I/O 2013. It is based on IntelliJ IDEA and replaced Eclipse ADT.

Android App Development

An Activity represents a single screen in an app.

Activities are declared in the manifest file.

1<manifest package="fr.emse.tb3pwme.android">
2  <application>
3      <activity android:name=".ExampleActivity" />
4      ...
5  </application>
6</manifest>

The Activity class is a crucial component of an Android app, and the way activities are launched and put together is a fundamental part of the platform’s application model. Unlike programming paradigms in which apps are launched with a main() method, the Android system initiates code in an Activity instance by invoking specific callback methods that correspond to specific stages of its lifecycle.

activity lifecycle

An Intent is a messaging object you can use to request an action from another app component. Although intents facilitate communication between components in several ways, there are three fundamental use cases:

  • Starting an activity

  • Starting a service

  • Delivering a broadcast