View RSS Feed

Android Development

  1. Exploring the Different Types of Android Dialogs

    by , 02-11-2012 at 02:04 PM
    Android SDK contains different types of Dialogs. These dialogs include following:

    • Dialog: Base class for all dialogs as shown in figure. It is usually used to inform user and is the simplest form of a dialog.
    • AlertDialog: This dialog contains a number of buttons as shown in figure. It is used to get user confirmation on some specific operations like delete a file.
    • CharacterPickerDialog: It is used to pick an accented character that is associated with base character. ...
    Android Dialog
  2. Managing Android Application Permissions

    by , 02-11-2012 at 02:02 PM
    Android platform has a strong security model. It is based on Linux kernel and used its security as part of Android security model. Android application exists and run in its own virtual machine and it operates within boundaries of its Linux user account. Below figure explains this security model in depth.

    First declare access permissions in the Android manifest file before an application can access a privileged resource on its handset. It’s ensures security and enables that android ...
  3. Working with Layouts

    by , 02-11-2012 at 02:00 PM
    XML files that are called “layouts” are used to define Android application user interface screens. The XML files are a special type of resource and treated as a resource. These XML files are used to describe screen layout like how this screen will look like. This layout resource can be considered as a template. A layout resource is filled with different supported view controls which may refer to other resources like colors, strings, drawables and dimensions.

    These XML resources are ...
    Android Layout
  4. Logging Android Application Information

    by , 02-11-2012 at 01:58 PM
    Android has a powerful logging utility class that is called “android.util.Log”. Different log messages are categorized in different groups with errors being the most severe. Following table list some popular methods of the Log class.

    Name:  1.JPG
Views: 547
Size:  19.0 KB

    Android Log Table

    First parameter passed to each Log method is a tag and its data type is String. The most common practice is to define a global static string that represents the complete application ...
    Android Log
  5. Using Intents to Launch Other Applications

    by , 02-11-2012 at 01:53 PM
    Normally, activity classes within application’s package are launched. There are cases in which applications are interested in launching external activity class in other applications with suitable permissions. You can initialize applications by creating intent actions such as following:

    • Built-in web browser is launched and a URL address is supplied.
    • A web browser is launched and search string is supplied.
    • Built-in Dialer application is launched and a phone number ...
  6. Launching Activities Using the Application Context

    by , 02-11-2012 at 01:51 PM
    Call the startActivity() method of the application context. It is most commonly used to launch the activity. startActivity() method takes only one parameter which is called Intent. The below code shows a startActivity() method with an explicit intent.

    Java Code: This is the code to launch an activity
    startActivity(new Intent(getApplicationContext(),MenuActivity.class));
    In the above code, target activity is launched on request of intent, called MenuActivity. This MenuActivity class must be registered ...
  7. How to take emulator or device screenshot?

    by , 02-11-2012 at 01:46 PM
    You can take screenshots of the emulator or handsets which is very useful for debugging as shown in figure below.
    When you are using real devices, this screenshot aspect of DDMS perspective is very helpful. Follow below steps, to take a screen shot of your device and see what is happening.

    1. Select your device or emulator from DDMS perspective. The device you are selecting must be connected with USB data cable.
    2. Select your desired screen on the device or emulator. ...
  8. Launching Android Applications on a Device

    by , 02-11-2012 at 01:44 PM
    To load Android application on your device, plug your Android device using USD data cable to your computer. Also check you debugging setting to confirm that you have configured this device for debugging. Follow these steps to make sure that you are using correct settings for debugging.

    • From Java perspective, select Run -> Debug configurations.
    • Double click your configurations.
    • Change your “Deployment Target Selection Mode” to manual on Target tab. You can get ...
  9. Simulating Incoming Calls to the Emulator

    by , 02-11-2012 at 01:40 PM
    Using DDMS Emulator control tab, incoming voice calls can be simulated. It is not a real call and no voice or other data is transmitted between the 2 parties. It is just a simulation of incoming calls as shown in below figure.

    Name:  1.JPG
Views: 954
Size:  25.1 KB
    Simulating Incoming Calls to the Emulator

    Follow below steps to simulate incoming call on your emulator that is running on your server.
    • Select emulator instance to call in the DDMS perspective. ...
  10. Debugging Android Applications Using DDMS

    by , 02-11-2012 at 01:38 PM
    In Eclipse there is DDMS perspective added by ADT plug-in, in addition to other normal Debug perspective. It supports code debugging and stepping through code. When your application is running, you can view this perspective in Eclipse. Click the Android DDMS icon in top right corner to launch DDMS perspective. If you want to switch to any other perspective, simple choose it from the right top corner of the Eclipse.

    Name:  1.JPG
Views: 1306
Size:  18.4 KB
    Debugging Android Applications
    Tags: android ddms Add / Edit Tags
    Android Debug
  11. Launching Android Applications Using the Emulator

    by , 02-11-2012 at 01:36 PM
    To launch the application using Android, you can launch it by clicking the “Debug” button from launch configuration screen. Also you can launch it by clicking the button on Eclipse toolbar. Then select the created debug configuration from the list. When you will click the “Debug” button, the emulator will launch as show below. It may take some time.

    Name:  1.JPG
Views: 650
Size:  13.6 KB
    Android Emulator

    Your application will run as shown in figure below. It’s just easy ...
  12. Creating Debug and Run Configurations in Eclipse

    by , 02-11-2012 at 01:32 PM
    To run or debug an application in Eclipse, you have to create configuration for this. To create run or debug configuration, follow these steps.

    1. Select Run -> Debug Configuration from menu. Also you can select debug configuration option from the Eclipse toolbar.
    2. To create a new entry, double click Android Application item.
    3. Edit “New_configuration” entry.
    4. Rename the configuration.
    5. Click the “Browse” button and set the project.
    6. ...
  13. Android Project Files in Eclipse

    by , 02-11-2012 at 01:29 PM
    In this section we will explain different files automatically created with a new android project in eclipse.

    • AndroidManifest.xml: Main configuration’s file for the application.
    • Build file used by Eclipse and Android ADT plug-in.
    • proguard.cfg: Build file used by Eclipse, ProGuard, and the Android ADT plug-in. You can edit and configure this file to optimize your code.
    • src folder: This folder contains all the source code.
    • ...
  14. Creating Hello World Android Project in Eclipse

    by , 02-11-2012 at 01:28 PM
    In this section, we will create a simple Hello World Android Project in Eclipse. Launch you Eclipse and follow these steps to create a simple project.

    • Click File -> New -> Android Project.
    • Enter a project name. For example “Droid1”.
    • Select a folder for the project source.
    • Next you need to select build target for your Android Project. Select most suitable for your target audience and application. For example if you want to use Google Maps, then ...
  15. Performing Fragment Transactions

    by , 02-11-2012 at 01:25 PM
    You can add, remove, replace or perform actions with fragments in your activity in response to user interaction. A transaction is a set of changes you perform to an activity and these can be performed using APIs in FragmentTransaction. These transaction can be saved on back stack and allow the user to navigate these changes.

    To get an instance from FragmentManager, following code is used.

    Java Code: This is the code to create a fragment
    FragmentManager fragmentManager = getFragmentManager()
  16. Building and Running Android Application from Eclipse with ADT

    by , 02-11-2012 at 12:09 PM
    Details of the build process are hidden when using Eclipse and ADT. Build process in running continuously in background and automatically build application when you make changes to code. Following topics will explain how to run application.

    Running on the emulator

    Create an AVD when you are running your application on the Android Emulator. Follow these steps to run your application

    • From Eclipse menu bar select Run > Run (or Run > Debug) from the ...
  17. Building and Running an Android Application

    by , 02-11-2012 at 12:04 PM
    An Android project is compiled and packaged into “.apk” file. It is the container for application binary. It contains following information that is necessary to run your application on a device or emulator

    • Compiled “.dex” files
    • Binary version of Manifest file
    • Compiled resources
    • Uncompiled resource files for your application

    If Eclipse is being used as development IDE, the ADT plug-in is responsible for building your project when source ...

    Updated 02-11-2012 at 12:06 PM by Android Development

    Build Application , Run Application
  18. Android Manifest File

    by , 02-11-2012 at 12:00 PM
    Whenever an Android Application is loaded, the application's AndroidManifest.xml file also called “manifest file” is read by the Android system. All the components are declared in this file by the Android application. Also it is placed at the root of application project directory.

    Following are the major tasks that are performed by the manifest other than just declaring the application’s components.

    • User permissions such as Internet access or read access to user’s
  19. Android Application Framework

    by , 02-11-2012 at 11:58 AM
    Android Application Framework supports development of rich and innovative mobile applications. Android Application Framework is open source and uses Java Programming language. Android developers can take benefits of the hardware device, access location information, background services, alarms, ability to add notifications and many other benefits.

    Core applications uses framework APIs and developer complete rights to those APIs. The architecture of application is based on reusability ...