Book Image

Android Development Tools for Eclipse

By : Khirulnizam Abd Rahman, Sanjay Shah
Book Image

Android Development Tools for Eclipse

By: Khirulnizam Abd Rahman, Sanjay Shah

Overview of this book

<p>The increase in Android's popularity with every passing day cannot be understated. This has resulted in a large programmer base willing to contribute to its success. Eclipse has a powerful IDE and has been adopted widely by programmers across the globe. The focus of ADT is to use existing familiar territory and ease development of Android applications. In this sense, ADT provides a one stop solution for Android application development.</p><p>Android Development Tools for Eclipse is a step-by-step guide that provides you with hands-on, practical, and to the point discussion and steps for using Eclipse tools for developing, debugging, and signing Android applications for distribution. It also teaches you to incorporate advertisements to monetize your applications. Every concept and its usage has been demonstrated in this book by implementing them via real world applications.</p><p></p><p>Android Development Tools for Eclipse starts with the installation of ADT, and then discusses important tools before guiding you through Android application development from scratch, demonstrating different concepts and implementation before finally helping you distribute your applications in the Android market. You will start the development of your first application, explore project structure, and add different widgets including multimedia ones.</p><p></p><p>You will learn everything about developing, debugging, testing, distributing, and monetizing your Android application using Eclipse ADT.</p>
Table of Contents (10 chapters)
9
Index

Intent and Activity

Intent is an abstract description of an operation to be performed. To be more specific, it is an asynchronous call which allows the application to request functionality from other Android components, for example, services/activities. It can be used with the startActivity() command to launch an activity. The previous code in SimpleNumb3r5.java is the main activity (or class) for this application. We've just created the second activity (class) in the file Info.java. In order for the second activity to appear, it has to be started using an intent.

We have decided to use the button btninfo as the trigger to invoke the second activity. Again, open the file SimpleNumb3r5.java and add the following lines to invoke another activity. These lines must be added to the btninfo button's onClick method. Notice that an instance of Intent is created as info. The main class is able to call the second class using the startActivity() method. The Info.class argument is referring...