1.Create New Project
src
----------->drag and drop Webkit from Palette
----------------->drag and drop button and name it like go
------------------------>drag and drop Edit Text for web address
-------------------------------->create onclick method for button
2.Go to src file
src
-------------->create mecthod name from onclick
---------------->make Edit text link using find view by id
------------------->make webview link using find view by id
----------------------->enable java script and client options
coding:
private EditText edt;
private WebView web;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
edt=(EditText)findViewById(R.id.editText1);
web=(WebView)findViewById(R.id.webView1);
}
public void go(View v)
{
String s="https://" ;
String a=s+edt.getText().toString();
web.getSettings().setJavaScriptEnabled(true);
web.setWebViewClient(new WebViewClient());
web.loadUrl(a);
}
3.Add usesPermission in AndroidManifeast.xml
AndroidManifeast.xml
------------------------->add
------------------------------>usesPermission
----------------------------------->select Internet
--------------------------------------->Run your Project
(click the image)
Thankyou..........................!
Friday, 22 March 2013
SIMPLE VIDIO PLAYER
1.Create A New Project
Layout
--------------->Main_Activity
------------------>Drag and drop Button and Video View from Palette
---------------------->Make Button name Start and add onClickMethod
2.Add 3.gp into raw folder
res
----------------------->Right click res then create raw folder
---------------------------->Add 3.gp into raw
--------------------------------->src file
Click the image
coding:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
vid=(VideoView)findViewById(R.id.videoView1);
Uri uri=Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.zz);
vid.setVideoURI(uri);
vid.setMediaController(new MediaController(this));
vid.requestFocus();
}
public void play(View v)
{
vid.start();
}
3.Run your Project
-------------------->Click start button then video will be play
-------------------------->Click Video then Videocontroller will be display
Thank you...........!
Layout
--------------->Main_Activity
------------------>Drag and drop Button and Video View from Palette
---------------------->Make Button name Start and add onClickMethod
2.Add 3.gp into raw folder
res
----------------------->Right click res then create raw folder
---------------------------->Add 3.gp into raw
--------------------------------->src file
Click the image
coding:
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
vid=(VideoView)findViewById(R.id.videoView1);
Uri uri=Uri.parse("android.resource://"+getPackageName()+"/"+R.raw.zz);
vid.setVideoURI(uri);
vid.setMediaController(new MediaController(this));
vid.requestFocus();
}
public void play(View v)
{
vid.start();
}
3.Run your Project
-------------------->Click start button then video will be play
-------------------------->Click Video then Videocontroller will be display
Thank you...........!
SIMPLE AUDIO PLAYER
1.Create a new Project
Layout
--------------->Main_Activity.xml
------------------>Drag and Drop 3 image buttons from palette
--------------------->name it like play,pause,stop
------------------------>add onClick method names like play pause stop
2.Add mp3 file into raw folder
layout
--------------->right click layout
-------------------->New
----------------------->Folder ,(Name :raw)
-------------------------->type onclick method
-------------------------------->Create media player variable
(Click below image)
Run Your Project...............
Layout
--------------->Main_Activity.xml
------------------>Drag and Drop 3 image buttons from palette
--------------------->name it like play,pause,stop
------------------------>add onClick method names like play pause stop
2.Add mp3 file into raw folder
layout
--------------->right click layout
-------------------->New
----------------------->Folder ,(Name :raw)
-------------------------->type onclick method
-------------------------------->Create media player variable
(Click below image)
Run Your Project...............
Thursday, 21 March 2013
SIMPLE SQLITE DATABASE APPLICATION
1.SQL BASIC SYNTAX
Create DataBase
CREATE DATABASE database_name
Create Table
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)
InsertValues
INSERT INTO table_name
VALUES (value1, value2, value3,...)
like below
INSERT INTO Persons
VALUES (4,'Nilsen', 'Johan', 'Bakken 2', 'Stavanger')
DeleteValues
DELETE FROM table_name
WHERE some_column=some_value
like below
DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'
UpdateValues
UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value
-------------------------------------------------------------------------------------------------------------
2.
Create DataBase
CREATE DATABASE database_name
Create Table
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)
InsertValues
INSERT INTO table_name
VALUES (value1, value2, value3,...)
like below
INSERT INTO Persons
VALUES (4,'Nilsen', 'Johan', 'Bakken 2', 'Stavanger')
DeleteValues
DELETE FROM table_name
WHERE some_column=some_value
like below
DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'
UpdateValues
UPDATE table_name
SET column1=value, column2=value2,...
WHERE some_column=some_value
-------------------------------------------------------------------------------------------------------------
2.
SQLiteOpenHelper
SQLiteOpenHelper is Superclass ,Which is use for Database Operations
SIMPLE SPLASH SCREEN
1.Create Splash Screen(click image)
Layout
--------------->Activity_Main.xml
--------------------->Design Splash(insert logo and more)

2.Create Menu xml
Layout
---------------->Right click
------------------------>New
------------------------------->Android xml file
-------------------------------------->Enter Name(like menu)
-------------------------------------------->Design menu options

3.Main_Activity.java
Src
------------------>Main_Activity.java
------------------------>Create Thread
---------------------------->Call run method
------------------------------->Call sleep(4000)
---------------------------------->Surround with try catch
-------------------------------------->Call finish() method(which is useful for don`t show again the Splash)
-------------------------------------------->Call Intent(Which use for jump to other activity)

Coding:
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread t=new Thread()
{
public void run()
{
try {
sleep(4000);
finish();
Intent i=new Intent(MainActivity.this,menu.class);
startActivity(i);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
t.start();
}
4.menu.java
Src
--------------->Create Menu.java (copy Main_Activity.java and paste into Src then Name it like menu)
------------------------>Change setContentView to menu.xml

5.Add Menu Activity to AndroidManiFest.xml
-------------------------->Refer One Screen two Other Screen`s post
Thank you..................................................!
Layout
--------------->Activity_Main.xml
--------------------->Design Splash(insert logo and more)
2.Create Menu xml
Layout
---------------->Right click
------------------------>New
------------------------------->Android xml file
-------------------------------------->Enter Name(like menu)
-------------------------------------------->Design menu options
3.Main_Activity.java
Src
------------------>Main_Activity.java
------------------------>Create Thread
---------------------------->Call run method
------------------------------->Call sleep(4000)
---------------------------------->Surround with try catch
-------------------------------------->Call finish() method(which is useful for don`t show again the Splash)
-------------------------------------------->Call Intent(Which use for jump to other activity)
Coding:
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Thread t=new Thread()
{
public void run()
{
try {
sleep(4000);
finish();
Intent i=new Intent(MainActivity.this,menu.class);
startActivity(i);
} catch (InterruptedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
};
t.start();
}
4.menu.java
Src
--------------->Create Menu.java (copy Main_Activity.java and paste into Src then Name it like menu)
------------------------>Change setContentView to menu.xml
5.Add Menu Activity to AndroidManiFest.xml
-------------------------->Refer One Screen two Other Screen`s post
Thank you..................................................!
Wednesday, 20 March 2013
SIMPLE LISTVIEW WITH ARRAY ADAPTER
1.CREATE NEW LISTVIEW PROGAMME
---------->Create New Project
--------------->Drag and Drop ListView From Palette
2.CREATE ARRAY ADAPTER
Values
--------------->String.xml
--------------------->ADD
------------------------->String array elements
----------------------------->Type Name of String Array
---------------------------------->Click String Array(name will shows)
---------------------------------------->Click Add
------------------------------------------->Item
----------------------------------------------->Ok
-------------------------------------------------->Type Item Value
(click the image)
3.SOURCE CODE
Src
------------->MainActivity.java
------------------>Create ListView variable
---------------------->Create Array Adaper
-------------------------->set Adapter to listview`s variable
-------------------------------->Create ListViewOnItemClickListner
----------------------------------->Check Item Clicked or not(arg2 is ID value like 0,1,2 of array adapter )
---------------------------------------->Display Toast Message
public class MainActivity extends Activity {
private ListView li;
private ArrayAdapter<CharSequence> ar;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
li=(ListView)findViewById(R.id.listView1);
ar=ArrayAdapter.createFromResource(getApplicationContext(), R.array.adapter,
android.R.layout.simple_list_item_1);
li.setAdapter(ar);
li.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
if(arg2==0)
{
Toast.makeText(getApplicationContext(), "ANDROID", Toast.LENGTH_LONG).show();
}
}
}
);
}
Output shows like this.
Thank you................................!
---------->Create New Project
--------------->Drag and Drop ListView From Palette
2.CREATE ARRAY ADAPTER
Values
--------------->String.xml
--------------------->ADD
------------------------->String array elements
----------------------------->Type Name of String Array
---------------------------------->Click String Array(name will shows)
---------------------------------------->Click Add
------------------------------------------->Item
----------------------------------------------->Ok
-------------------------------------------------->Type Item Value
(click the image)
3.SOURCE CODE
Src
------------->MainActivity.java
------------------>Create ListView variable
---------------------->Create Array Adaper
-------------------------->set Adapter to listview`s variable
-------------------------------->Create ListViewOnItemClickListner
----------------------------------->Check Item Clicked or not(arg2 is ID value like 0,1,2 of array adapter )
---------------------------------------->Display Toast Message
Coding:
public class MainActivity extends Activity {
private ListView li;
private ArrayAdapter<CharSequence> ar;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
li=(ListView)findViewById(R.id.listView1);
ar=ArrayAdapter.createFromResource(getApplicationContext(), R.array.adapter,
android.R.layout.simple_list_item_1);
li.setAdapter(ar);
li.setOnItemClickListener(new OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
if(arg2==0)
{
Toast.makeText(getApplicationContext(), "ANDROID", Toast.LENGTH_LONG).show();
}
}
}
);
}
Output shows like this.
Thank you................................!
HOW TO CHANGE ONE SCREEN TO ANOTHER SCREEN
1.CREATE NEW PROJECT
Drag and Drop Button
------------------>Right Click Button
---------------------->EditText
---------------------------->Will be Open DialogBox
--------------------------------->NewString
------------------------------------>Type Button Name on STRING option(FirstScreen)
---------------------------------------->Type Resource Id on NEW STRING R.ID (fs1)
------------------------------------------->Click ok
now Your Button Name Will be change like FirstScreen
Now right click button ,choose properties then onClick name:call2 (refer simple project link)
2.Create Second Screen
Right click Layout folder from your project
-------------------------->New
------------------------------>Android xml file
--------------------------------->Type Name on file option(second)
Do first operation darg and drop button and edittext(SecondScreen)
3.Create Another One Activity Java file
Src
------------------>Copy MainActivity.java
------------------------>Paste Sre folder
----------------------------->Change Name :sec
---------------------------------->Change setContentView like this
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
public class sec extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
}
4.Intent Concept
Intent useful for jump One Activity to Another Activity
Src
-------------->Click MainActivity.java ,we have alredy create
Method name using ONCLICK METHOD
Name That is call2.
--------------->Create function and use the INTENT SYNTEX
5.ADD second Activity in AndroidManifest file
Click AndroidManifest.xml in your Project
------------------------>Application (bottom tap )
---------------------------->C option
---------------------------------->Activity
---------------------------------------->Add
----------------------------------------------->sec Activity
---------------------------------------------------->Ok
(Click this image for big view )
Now Run Your Project..............!
Drag and Drop Button
------------------>Right Click Button
---------------------->EditText
---------------------------->Will be Open DialogBox
--------------------------------->NewString
------------------------------------>Type Button Name on STRING option(FirstScreen)
---------------------------------------->Type Resource Id on NEW STRING R.ID (fs1)
------------------------------------------->Click ok
now Your Button Name Will be change like FirstScreen
Now right click button ,choose properties then onClick name:call2 (refer simple project link)
2.Create Second Screen
Right click Layout folder from your project
-------------------------->New
------------------------------>Android xml file
--------------------------------->Type Name on file option(second)
Do first operation darg and drop button and edittext(SecondScreen)
3.Create Another One Activity Java file
Src
------------------>Copy MainActivity.java
------------------------>Paste Sre folder
----------------------------->Change Name :sec
---------------------------------->Change setContentView like this
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
public class sec extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.second);
}
4.Intent Concept
Intent useful for jump One Activity to Another Activity
Src
-------------->Click MainActivity.java ,we have alredy create
Method name using ONCLICK METHOD
Name That is call2.
--------------->Create function and use the INTENT SYNTEX
public class MainActivity extends Activity {
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void call2(View v)
{
Intent jump=new Intent(this,sec.class);
startActivity(jump);
}
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
}
public void call2(View v)
{
Intent jump=new Intent(this,sec.class);
startActivity(jump);
}
5.ADD second Activity in AndroidManifest file
Click AndroidManifest.xml in your Project
------------------------>Application (bottom tap )
---------------------------->C option
---------------------------------->Activity
---------------------------------------->Add
----------------------------------------------->sec Activity
---------------------------------------------------->Ok
(Click this image for big view )
Now Run Your Project..............!
CREATE SIMPLE ANDROID APPLICATION
Open your eclipse
1.File
---->NewProject
------------>Choose Android Application Project
------------------------>Type Your Project Name
----------------------------------->Click Next
------------------------------------------>Click Next
------------------------------------------------>Finish
Now project show like this........
How to Drag And Drop Button into Display
2.Layout
--------------->Palette
------------------>Button
---------------------->Drop on Display
Outline Shows Button link
---------------->Button
-------------------->Right Click Propertise
-------------------------->Onclick type Function Name
See the Following Image
3.Click mail.xml options .It will Show like this

4.Now go to Src file
--------------------------->Java file
--------------------------------->Create a Function as Button Onclick funcction name
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
Button but;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
but=(Button)findViewById(R.id.button1);
}
public void callme(View v)
{
but.setText("helloButton");
}
}

5.Now you are ready to run you project
----------------->Right click the Project
------------------------>Configure
------------------------------>Android
----------------------------------->Target
----------------------------------------->Click Avd
----------------------------------------------->Apply
---------------------------------------------------->Run

6.Wait Few Seconds Auto open Emulator
----------------------------->Unlock
-------------------------------->Running Your Apps

7.Click Button

That it ......
1.File
---->NewProject
------------>Choose Android Application Project
------------------------>Type Your Project Name
----------------------------------->Click Next
------------------------------------------>Click Next
------------------------------------------------>Finish
Now project show like this........
How to Drag And Drop Button into Display
2.Layout
--------------->Palette
------------------>Button
---------------------->Drop on Display
Outline Shows Button link
---------------->Button
-------------------->Right Click Propertise
-------------------------->Onclick type Function Name
See the Following Image
3.Click mail.xml options .It will Show like this
4.Now go to Src file
--------------------------->Java file
--------------------------------->Create a Function as Button Onclick funcction name
import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
public class MainActivity extends Activity {
Button but;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
but=(Button)findViewById(R.id.button1);
}
public void callme(View v)
{
but.setText("helloButton");
}
}
5.Now you are ready to run you project
----------------->Right click the Project
------------------------>Configure
------------------------------>Android
----------------------------------->Target
----------------------------------------->Click Avd
----------------------------------------------->Apply
---------------------------------------------------->Run
6.Wait Few Seconds Auto open Emulator
----------------------------->Unlock
-------------------------------->Running Your Apps
7.Click Button
That it ......
HOW TO PLUGIN AND USE
1.android sdk Unzip file open:
it will look like:

Click sdk manager It will shows

Install version SDK platform is important to emulator
2.CONFIGURE AVD MANAGER
3.Emulator configure:

3.PLUG IN ADT WITH ECLIPSE:
Open Eclipse :
click help options in menubar ---->Install software

Name:Type ADT or something
Location:Choose downloaded ADT ZIP file





Now restart Eclipse
Eclipse look like this:

4.CHOOSE SDK LOCATION

Now you are ready to develop the android application.
it will look like:
Click sdk manager It will shows
Install version SDK platform is important to emulator
2.CONFIGURE AVD MANAGER
3.Emulator configure:
3.PLUG IN ADT WITH ECLIPSE:
Open Eclipse :
click help options in menubar ---->Install software
Name:Type ADT or something
Location:Choose downloaded ADT ZIP file
Now restart Eclipse
Eclipse look like this:
4.CHOOSE SDK LOCATION
Now you are ready to develop the android application.
DEVELOPMENT SOFTWARE DOWNLOAD
1.Java JDK download click the image
![]() |
Click |
2.Eclipse IDE
![]() |
click |
3.Android SDK
![]() |
click |
click following link.
click me
4.Icon Creator(which is need key .if you need key ,you just ask me)
![]() |
click |
If you develop android game download following software also
5. Inkscape - svg img creator
![]() |
click |
6.Gimp - graphics editor
![]() |
click |
INTRODUCTION ABOUT ANDROID
Android is a Linux-based operating system designed primarily for touchscreen mobile devices such as smartphones and tablet computers.
Programmed : C, C++, Java
Source model: Open source
Official website www.android.com
Android, Inc. was founded in Palo Alto, California in October 2003 by Andy Rubin
Google acquired Android Inc. on August 17, 2005, making it a wholly owned subsidiary of Google
Versions:
Version | Code name | Release date | API level | Distribution (March 4, 2013) |
---|---|---|---|---|
4.2.x | Jelly Bean | November 13, 2012 | 17 | 1.6% |
4.1.x | Jelly Bean | July 9, 2012 | 16 | 14.9% |
4.0.x | Ice Cream Sandwich | December 16, 2011 | 15 | 28.6% |
3.2 | Honeycomb | July 15, 2011 | 13 | 0.9% |
3.1 | Honeycomb | May 10, 2011 | 12 | 0.3% |
2.3.3–2.3.7 | Gingerbread | February 9, 2011 | 10 | 44% |
2.3–2.3.2 | Gingerbread | December 6, 2010 | 9 | 0.2% |
2.2 | Froyo | May 20, 2010 | 8 | 7.6% |
2.0–2.1 | Eclair | October 26, 2009 | 7 | 1.9% |
1.6 | Donut | September 15, 2009 | 4 | 0.2% |
Subscribe to:
Posts (Atom)