Book Image

Android 4: New Features for Application Development

By : Murat Aydin
Book Image

Android 4: New Features for Application Development

By: Murat Aydin

Overview of this book

<p>Recently, with the increasing popularity of mobile phones, mobile operating systems have emerged and quickly spread. Now people with smart phones can do everything that they can do with their computers. The popularity of the Android mobile operating system has increased and is widely used. In this book, new features and innovations of Android 4.0 will be discussed.<br /><br />"Android 4: New Features for Application Development" is a practical and hands-on guide for developing android applications using new features of Android Ice Cream Sandwich (Android 4.0) with a step-by-step approach and clearly explained sample codes. You will learn the new APIs in Android 4.0 with sample code.<br /><br />This book will cover the new features and APIs of Android 4.0 (Android Ice Cream Sandwich). It will show the usage of the new APIs with a step-by-step approach and clearly explained sample code.<br /><br />You will learn about the new user interface components such as Action Bar and GridLayout. You will also learn about new APIs for social media integration and accessing calendar data. We will also look at new connectivity APIs such as Wi-Fi Direct and Android Beam. Supporting multiple screen sizes and multiple versions of Android is also among the subjects that you will learn.<br /><br />You can use "Android 4: New Features for Application Development" as a reference book for developing Android applications using new features of Android 4.0 with its clearly explained, step-by-step sample codes.</p>
Table of Contents (15 chapters)

Android Beam


Devices that have NFC hardware can share data by tapping them together. This could be done with the help of the Android Beam feature. It is similar to Bluetooth, as we get seamless discovery and pairing as in a Bluetooth connection. Devices connect when they are close to each other (not more than a few centimeters). Users can share pictures, videos, contacts, and so on, using the Android Beam feature.

Beaming NdefMessages

In this section, we are going to implement a simple Android Beam application. This application will send an image to another device when two devices are tapped together. There are three methods that are introduced with Android Ice Cream Sandwich that are used in sending NdefMessages. These methods are as follows:

  • setNdefPushMessage(): This method takes an NdefMessage as a parameter and sends it to another device automatically when devices are tapped together. This is commonly used when the message is static and doesn't change.

  • setNdefPushMessageCallback(): This...