Hiding the Activity title in Android

The requestWindowFeature(Window.FEATURE_NO_TITLE) method of Activity must be called to hide the title. But, it must be coded before the setContentView method. You can also hide the title of an activity if desired (such as when you just want to display a status update to the user). To do so, use the requestWindowFeature() method and pass it the …

Architecture of Android

In order to understand how Android works, take a look at Figure 1-1, which shows the various layers that make up the Android operating system  (OS).   The Android OS is roughly divided into five sections in four main layers: ➤      Linux kernel — This is the kernel on which Android is based. This layer …

Features of Android

As Android is open source and freely available to manufacturers for customization, there are no fixed hardware and software configurations. However, Android itself supports the following   features: ➤      Storage — Uses SQLite, a lightweight relational database, for data storage. Chapter 6 discusses data storage in more detail. ➤      Connectivity — Supports GSM/EDGE, IDEN, CDMA, EV-DO, …

What is Android?

Android is a mobile operating system that is based on a modified version of Linux. It was originally developed by a startup of the same name, Android, Inc. In 2005, as part of its strategy to enter the mobile space, Google purchased Android and took over its development work (as well as its develop- ment …

AlertDialog in Android

Like a Toast,  an AlertDialog is a window that provides feedback to the user.  Unlike a  Toast that fades by itself, however, an AlertDialog shows indefinitely until it loses focus.   In addition, an AlertDialog can contain up to three buttons and a list of selectable items. A button added to an AlertDialog can be connected …

Android App Basics

Here we can take an example of GeoQuiz application will consist of an activity and a layout: • An activity is an instance of Activity, a class in the Android SDK. An activity is responsible for managing user interaction with a screen of information. You write subclasses of Activity to implement the functionality that your …

Providing Messaging for Auto in Android

Staying connected through messages is important to many drivers. Chat apps can let users know if a child need to be picked up, or if a dinner location has been changed. The Android framework enables messaging apps to extend their services into car dashboards using a standard user interface that lets drivers keep their eyes …

Creating A Layout Programmatically

The most common way to create a layout is by using an XML file, as you have seen in the examples in this chapter. However, it is also possible to create a layout programmatically, by instantiating the layout class and passing it to the addContentView method in an activity class. For instance, the following code is …