What is Intent?

Monday, February 27, 2012

  • Definition: Intent (android.content.Intent) is an asynchronous message mechanism used by the Android operating system to match task requests with the appropriate Activity or Service (launching it, if necessary) and to dispatch broadcast Intents events to the system at large.
  • Package: android.content.Intent.
 How it is useful for transitioning between various activities?

  • Android app have multiple entry points, No main function.
  • One activity is designated as main / launcher activity in manifest file
  • To transition from one activity to other after creating instance call startActivity() method which has “Intent” instance as argument.

Tutorial for Building Your First Android Application

Creating and Configuring a New Android Project

You can create a new Android project in much the same way as when you added the
Snake application to your Eclipse workspace.

The first thing you need to do is create a new project in your Eclipse workspace.The
Android Project Wizard creates all the required files for an Android application. Follow
these steps within Eclipse to create a new project:

1. Choose File,New,Android Project, or choose the Android Project creator icon,
which looks like a folder (with the letter a and a plus sign), on the Eclipse
toolbar.

Android Debug Bridge (ADB)

Android Debug Bridge (ADB) is a versatile command line tool that lets you communicate with an emulator instance or connected Android-powered device. It is a client-server program that includes three components:

  • A client, which runs on your development machine. You can invoke a client from a shell by issuing an adb command. Other Android tools such as the ADT plugin and DDMS also create adb clients.
  • A server, which runs as a background process on your development machine. The server manages communication between the client and the adb daemon running on an emulator or device.
  • A daemon, which runs as a background process on each emulator or device instance.

An Android Virtual Device (AVD)

An Android Virtual Device (AVD) is an emulator configuration that lets you model an actual device by defining hardware and software options to be emulated by the Android Emulator.
An AVD consists of:
  •  A hardware profile: Defines the hardware features of the virtual device. For example, you can define whether the device has a camera, whether it uses a physical QWERTY keyboard or a dialing pad, how much memory it has, and so on.
  • A mapping to a system image: You can define what version of the Android platform will run on the virtual device. You can choose a version of the standard Android platform or the system image packaged with an SDK add-on.

Dalvik Debug Monitor Server (DDMS)

The Dalvik Debug Monitor Server (DDMS) is a command-line tool that has also been integrated into Eclipse as a perspective see in below figure.This tool provides you with direct access to the device—whether it’s the emulator virtual device or the physical device.You use DDMS to view and manage processes and threads running on the device, view heap data, attach to processes to debug, and a variety of other tasks.

Android ships with a debugging tool called the Dalvik Debug Monitor Server (DDMS), which provides port-forwarding services, screen capture on the device, thread and heap information on the device, logcat, process, and radio state information, incoming call and SMS spoofing, location data spoofing, and more.

Configuring Your Development Environment

To write Android applications, you must configure your programming environment for Java development.The software is available online for download at no cost.Android applications
can be developed on Windows, Macintosh, or Linux systems.

To develop Android applications, you need to have the following software installed on
your computer:
  •  The Java Development Kit (JDK) Version 5 or 6, available for download at http://java.sun.com/javase/downloads/index.jsp.

Android Platform Differences

Android is hailed as “the first complete, open, and free mobile platform”:
  •  Complete: The designers took a comprehensive approach when they developed the Android platform.They began with a secure operating system and built a robust software framework on top that allows for rich application development opportunities.
  •  Open: The Android platform is provided through open source licensing. Developers have unprecedented access to the handset features when developing applications.

Introducing Android

The mobile development community is at a tipping point. Mobile users demand more choice, more opportunities to customize their phones, and more functionality. Mobile operators want to provide value-added content to their subscribers in a manageable and lucrative way.

Mobile developers want the freedom to develop the powerful mobile applications users demand with minimal roadblocks to success. Finally, handset manufacturers want a stable, secure, and affordable platform to power their devices. Up until now a single mobile platform has adequately addressed the needs of all the parties.