Monday, June 18, 2012

How To Persist The State Of Data In Android





This is a sample activity which shows How to persist the state of the data i.e. if you save something on first launch it checks those setting when you relaunch the app.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a project StatePersistence.
2.) Put the following code snippet in res/layout/main.xml.
<?xml version="1.0" encoding="utf-8"?>
  <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" 

How To Draw Menu In Grid Icon View Android



This is a sample activity which shows how to draw a menu in grid icon veiw.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project ScrollView.
2.) Put the following code snippet in res/layout/main.xml.
<?xml version="1.0" encoding="utf-8"?>
<GridView xmlns:android="http://schemas.android.com/apk/res/android" 
   android:id="@+id/myGrid"

AdMob Manager In Android Application



This is a sample activity which shows how to use AdMob Manager in your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Register or login at admob.com, and download GoogleAdMobAdsSdkAndroid-4.0.4, which contains a GoogleAdMobAdsSdk.jar file.
2.) Create a project MyAdMob.
3.) In your project’s root directory create a subdirectory lib. Copy the AdMob JAR (GoogleAdMobAdsSdk.jar) file into that lib directory.

How To Develop And Control The Tabs In Android



This is a sample activity which shows How to create Tab Layout at bottom of the screen in android.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a project TabSample.
2.) Put the following code snippet in main.xml:
<?xml version="1.0" encoding="utf-8"?>
<TabHost xmlns:android="http://schemas.android.com/apk/res/android"

How To Play Video File In Android



This is a sample activity which shows How to run a video file.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project VideoViewExample.
2.) Put a video file in raw folder and keep it inside the res folder.
3.) Put the following code snippet in main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Web View In Android



This is a sample activity which shows How to invoke web browser from your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project WebViewDemo.
2.) Add the relevant permissions to your AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.sample.WebViewDemo"
     android:versionCode="1"

How To Handle Screen Orientation In Android



This is a sample activity which shows How to Handle Screen Orientation in android.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project ScreenOrientation.
2.) Put the following code snippet in res/layout/main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout 

How To Create 3D Graphics In Android



This is a sample application which shows how to create 3D graphics using OpenGL in android.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project Graphics3d.
2.) Put an image in res/drawable.
3.) Create a custom view MyGLView.java ,which will look like this:
package com.app.Graphics3d;
import android.content.Context;
import android.opengl.GLSurfaceView;

How To Get Text From Web And Display In Text View Android



This is a sample activity which shows How to get text files from the web and display them using the TextView view.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project httpsData.
2.) Add the relevant permissions to your AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.apps.httpsData"
     android:versionCode="1"
     android:versionName="1.0.0">

How To Open Browser In Android



This is a sample program to show the use of Intents. Intents are a powerful concept as they allow the creation of loosely coupled applications. Intents can be used to communicate between any installed application components on the device.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a project IntentBrowser
2.) Put the following code in layout/main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"

Downloading an image from the server and displaying it on android screen



This is a sample activity which shows how to get image files from the web and display them using the ImageView view.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project downloadImage.
2.) Add the relevant permissions to your AndroidManifest.xml file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="com.sample.downloadImage"

How To Implement Backup Manager For Saving The current State Of Your Android Application



The project describes how to implement BackupManager for your application so that you can save the current state of your game/application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project BackupManager
2.) Open and insert following in layout/backup_restore.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="match_parent"
   android:layout_height="wrap_content">

How To Create Spinner In Android



The project describes how to implement spinner (drop-down list) for your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project SpinnerExample
2.) Open and insert following in main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:padding="10dip"

How To Create List View In Android



The project describes how to implement list view for your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project ListViewExample
2.) Open and insert following in main.xml:
<LinearLayout android:id="@+id/LinearLayout01"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        xmlns:android="http://schemas.android.com/apk/res/android">

How To Show Progress Bar In Your Android Application



This is a sample program to create a progress bar for your app.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project ProgressBarExample
2.) Put the following code in res/layout/main.xml:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical"

How To Use Android Date Picker In Your Application




This is a sample activity which shows how to use Date picker control.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project DatePickerExample.
2.) Create a date_picker.xml in res/layout.
3.) Put the following code in date_picker.xml :
<?xml version="1.0" encoding="UTF-8"?>

How To Display Notification In Android




The project describes how to display notifications in your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project NotificationExample
2.) Make sure to add following in your res/values/strings.xml file:
<resources>
    <string name="info">Notification Example, press the button Notification to add a notification.</string>

How To Implement Gestures In Your Android Application




The project describes how to implement gestures for your application.

Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project GestureExample
2.) Insert following code in your main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"

How To Implement Menu Which Uses Check-able Items In Android


                     The project describes How to implement a menu which uses Check-able items.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project MyCheckBoxMenu
2.) Create and Open the res/menu/menu.xml file and insert the following:
<menu xmlns:android="http://schemas.android.com/apk/res/android">
  <item android:id="@+id/settings_title"
         android:title="@string/settings_title" />
  <item android:id="@+id/back_title"
         android:title="@string/back_title" />
  <item android:id="@+id/exit_title"
         android:title="@string/exit_title" />
</menu>
3.) Define the required strings in strings.xml.

How To Create Dialog Box In Android Application


The project describes how to draw a Dialog Box in your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project DialogExample
2.) Make sure to add following in your res/values/strings.xml file:
<resources>
    <string name="hello">Hello World, DialogExample!</string>
    <string name="app_name">DialogExample</string>

How To Implement A Drag And Drop Application In Android


The project describes how to implement an application which allows you to drop and drag UI elements.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project DragNew
2.) Open and insert following in main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
   android:orientation="vertical"
   android:layout_width="fill_parent"
   android:layout_height="fill_parent"

How To Create Image Gallery In Android


The project describes how to implement gallery for your application.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project GalleryExample
2.) Open and insert following in main.xml:
<Gallery xmlns:android="http://schemas.android.com/apk/res/android"
        android:id="@+id/gallery" android:layout_width="fill_parent"
        android:layout_height="wrap_content" />

How To Create And Hadle Custom Button Into Your Application


The project describes how to implement Custom Button and display a message when button is pressed.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project CustomButton
2.) Open and insert following in main.xml:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:orientation="vertical" android:layout_gravity="center_horizontal"
        android:gravity="center_vertical|center_horizontal"
        android:layout_width="wrap_content" android:layout_height="fill_parent">

How To Implement Option Menu Into Your Application


The project describes How to implement option menu into your application. Option menu is the primary collection of menu items for an activity, which appears when the user touches the MENU button.
Underlying Algorithm:
Basic description of algorithm in step by step form:
  1. Create a Project MyCheckBoxMenu
  2. Create and Open the res/menu/menu.xml file and insert the following:
  3. <menu xmlns:android="http://schemas.android.com/apk/res/android">
      <item android:id="@+id/settings_title"
             android:title="@string/settings_title" />

How To Implement Context Menu Into Your Application


The project describes about how you can implement context menu into your application. Context menu is a floating list of menu items that appears when the user touches and holds a view that’s registered to provide a context menu.
Underlying Algorithm:
Basic description of algorithm in step by step form:
1.) Create a Project MyMenu
2.) Open the main.xml file and insert the following:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent" android:layout_height="fill_parent"
        android:orientation="vertical">
        <ListView android:id="@+id/list" android:layout_width="fill_parent"
                android:layout_height="0px" android:layout_weight="1" />
                
        <TextView android:id="@+id/footer" android:layout_width="fill_parent"