1.0: Introduction to Android

Contents:

What is Android?

Android is an operating system and programming platform developed by Google for smartphones and other mobile devices (such as tablets). It can run on many different devices from many different manufacturers. Android includes a software development kit for writing original code and assembling software modules to create apps for Android users. It also provides a marketplace to distribute apps. All together, Android represents an ecosystem for mobile apps. Android for Smartphones

Why develop apps for Android?

Apps are developed for a variety of reasons: addressing business requirements, building new services, creating new businesses, and providing games and other types of content for users. Developers choose to develop for Android in order to reach the majority of mobile device users.

As the world's most popular mobile platform, Android powers hundreds of millions of mobile devices in more than 190 countries around the world. It has the largest installed base of any mobile platform and is still growing fast. Every day another million users power up their Android devices for the first time and start looking for apps, games, and other digital content. Popular Apps on Android

Best experience for app users

Android provides a touch-screen user interface (UI) for interacting with apps. Android's user interface is mainly based on direct manipulation, using touch gestures such as swiping, tapping and pinching to manipulate on-screen objects. In addition to the keyboard, there’s a customizable virtual keyboard for text input. Android can also support game controllers and full-size physical keyboards connected by Bluetooth or USB. App Icons on the Home Screen (left)

The Android home screen can contain several pages of app icons, which launch the associated apps, and widgets, which display live, auto-updating content such as the weather, the user's email inbox or a news ticker. Android can also play multimedia content such as music, animation, and video. The figure above shows app icons on the home screen (left), playing music (center), and displaying widgets (right). Along the top of the screen is a status bar, showing information about the device and its connectivity. The Android home screen may be made up of several pages, between which the user can swipe back and forth.

Android is designed to provide immediate response to user input. Besides a fluid touch interface, the vibration capabilities of an Android device can provide haptic feedback. Internal hardware such as accelerometers, gyroscopes and proximity sensors, are used by many apps to respond to additional user actions. These sensors can detect rotation of the screen from portrait to landscape for a wider view or it can allow the user to steer a virtual vehicle in a racing game by rotating the device as if it were a steering wheel.

The Android platform, based on the Linux kernel, is designed primarily for touchscreen mobile devices such as smartphones and tablets. Since Android devices are usually battery-powered, Android is designed to manage processes to keep power consumption at a minimum, providing longer battery use.

Easy to develop apps

Use the Android software development kit (SDK) to develop apps that take advantage of the Android operating system and UI. The SDK includes a comprehensive set of development tools including a debugger, software libraries of prewritten code, a device emulator, documentation, sample code, and tutorials. Use these tools to create apps that look great and take advantage of the hardware capabilities available on each device.

To develop apps using the SDK, use the Java programming language for developing the app and Extensible Markup Language (XML) files for describing data resources. By writing the code in Java and creating a single app binary, you will have an app that can run on both phone and tablet form factors. You can declare your UI in lightweight sets of XML resources, one set for parts of the UI that are common to all form factors, and other sets for features specific to phones or tablets. At runtime, Android applies the correct resource sets based on its screen size, density, locale, and so on.

To help you develop your apps efficiently, Google offers a full Java Integrated Development Environment (IDE) called Android Studio, with advanced features for developing, debugging, and packaging Android apps. Using Android Studio, you can develop on any available Android device, or create virtual devices that emulate any hardware configuration.

Android provides a rich development architecture. You don’t need to know much about the components of this architecture, but it is useful to know what is available in the system for your app to use. The following diagram shows the major components of the Android stack — the operating system and development architecture. The Android Stack

In the figure above:

  1. Apps: Your apps live at this level, along with core system apps for email, SMS messaging, calendars, Internet browsing, or contacts.
  2. Java API Framework: All features of Android are available to developers through application programming interfaces (APIs) written in the Java language. You don't need to know the details of all of the APIs to learn how to develop Android apps, but you can learn more about the following APIs, which are useful for creating apps:
  3. Libraries and Android Runtime: Each app runs in its own process and with its own instance of the Android Runtime, which enables multiple virtual machines on low-memory devices. Android also includes a set of core runtime libraries that provide most of the functionality of the Java programming language, including some Java 8 language features that the Java API framework uses. Many core Android system components and services are built from native code that require native libraries written in C and C++. These native libraries are available to apps through the Java API framework.
  4. Hardware Abstraction Layer (HAL): This layer provides standard interfaces that expose device hardware capabilities to the higher-level Java API framework. The HAL consists of multiple library modules, each of which implements an interface for a specific type of hardware component, such as the camera or bluetooth module.
  5. Linux Kernel: The foundation of the Android platform is the Linux kernel. The above layers rely on the Linux kernel for underlying functionalities such as threading and low-level memory management. Using a Linux kernel enables Android to take advantage of key security features and allows device manufacturers to develop hardware drivers for a well-known kernel.

Many distribution options

You can distribute your Android app in many different ways: email, website or an app marketplace such as Google Play. Android users download billions of apps and games from the Google Play store each month (shown in the figure below). Google Play is a digital distribution service, operated and developed by Google, that serves as the official appstore for Android, allowing consumers to browse and download apps developed with the Android SDK and published through Google. Google Play Store on an Android Smartphone

Android versions

Google provides major incremental upgrades to the Android operating system every six to nine months, using confectionery-themed names. The latest major release is Android 7.0 "Nougat".

Code name

Version number

Initial release date

API level

N/A

1.0

23 September 2008

1

N/A

1.1

9 February 2009

2

Cupcake

1.5

27 April 2009

3

Donut

undefined

1.6

15 September 2009

4

Eclair

undefined

2.0 – 2.1

26 October 2009

5–7

Froyo

undefined

2.2 – 2.2.3

20 May 2010

8

Gingerbread

undefined

2.3 – 2.3.7

6 December 2010

9–10

Honeycomb

undefined

3.0 – 3.2.6

22 February 2011

11–13

Ice Cream Sandwich

undefined

4.0 – 4.0.4

18 October 2011

14–15

Jelly Bean

undefined

4.1 – 4.3.1

9 July 2012

16–18

KitKat

undefined

4.4 – 4.4.4

31 October 2013

19–20

Lollipop

undefined

5.0 – 5.1.1

12 November 2014

21–22

Marshmallow

undefined

6.0 – 6.0.1

5 October 2015

23

Nougat

undefined

7.0

22 August 2016

24

See previous versions and their features at The Android Story.

The Dashboard for Platform Versions is updated regularly to show the distribution of active devices running each version of Android, based on the number of devices that visit the Google Play Store. It's a good practice to support about 90% of the active devices, while targeting your app to the latest version.

Note: To provide the best features and functionality across Android versions, use the Android Support Library in your app. This support library allows your app to use recent platform APIs on older devices.

The challenges of Android app development

While the Android platform provide rich functionality for app development, there are still a number of challenges you need to address, such as:

  • Building for a multi-screen world
  • Getting performance right
  • Keeping your code and your users secure
  • Remaining compatible with older platform versions
  • Understanding the market and the user.

Building for a multi-screen world

Android runs on billions of handheld devices around the world, and supports various form factors including wearable devices and televisions. Devices can come in different sizes and shapes that affect the screen designs for UI elements in your apps. Smartphone and Tablet Screens

In addition, device manufacturers may add their own UI elements, styles, and colors to differentiate their products. Each manufacturer offers different features with respect to keyboard forms, screen size, or camera buttons. An app running on one device may look a bit different on another. The challenge for many developers is to design UI elements that can work on all devices It is also the developer’s responsibility to provide an app’s resources such as icons, logos, other graphics, and text styles to maintain uniformity of appearance across different devices.

Maximizing app performance

An app's performance—how fast it runs, how easily it connects to the network, and how well it manages battery and memory usage—is affected by factors such as battery life, multimedia content, and Internet access. You must be aware of these limitations and write code in such a way that the resource utilization is balanced and distributed optimally. For example, you will have to balance the background services by enabling them only when necessary; this will save battery life of the user’s device.

Keeping your code and your users secure

You need to take precautions to secure your code and the user’s experience when using your app. Use tools such as ProGuard (provided in Android Studio), which detects and removes unused classes, fields, methods, and attributes, and encrypt all of your app's code and resources while packaging the app. To protect your user's critical information such as logins and passwords, you must secure the communication channel to protect data in transit (across the Internet) as well as data at rest (on the device).

Remaining compatible with older platform versions

Consider how to add new Android platform version features to an app, while ensuring that the app can still run on devices with older platform versions. It is impractical to focus only on the most recent Android version, as not all users may have upgraded or may be able to upgrade their devices.

Learn more

results matching ""

    No results matching ""