ANDROID BASICS

    Open File Chooser With Camera Option In Webview File Option

In this example opening url in webview and showing progress Dialog for page. Show file chooser option on clicking file option for web form . Open new link from webview to external browser. For any url open new activity or do other task.

 


Views: 136470  |   Date: 03-Feb-2014  |   Download Source CodeRead more...
    Android Session Management Using SharedPreferences - Android Example

In this example showing how to maintain session in login page and after login to other activities using shared preferences.

 


Views: 143518  |   Date: 19-Jan-2014  |   Download Source CodeRead more...
    Android SharedPreferences Basics

You can save and retrieve key, value pair data from Shared preferences.
SharedPreferences values will persist across user sessions. Data in shared preferences will be persistent even though user closes the application.

 


Views: 133629  |   Date: 28-Dec-2013Read more...
    Show Loader To Open Url In WebView - Android Example

WebView is a View that displays web pages.If want to display html as the part of your UI then you can use WebView in your APP.

 

In ths example : :

   1. Opening url in webview.
   2. Showing loader before page load.
   3. Click opened url any link and again open page in webview.

 


Views: 152305  |   Date: 24-Dec-2013  |   Download Source CodeRead more...
    Play Video File - Android Example

In this example showing code to play video. Taking a video(3gp) file inside application raw folder and playing in on activity.

 


Views: 198406  |   Date: 09-Nov-2013  |   Download Source CodeRead more...
    Camera Video Capture And Save On SDCard - Android Example

In this example capturing video by inbuild camera in android and save captured video on sdcard. Using camera intent to record video and after record the video again come back on activity and show captured video path on activity.

 


Views: 183405  |   Date: 08-Nov-2013  |   Download Source CodeRead more...
    Get Contact Emails By Content Provider - Android Example

In this example reading contact emails from phone. showing visual reprsentation of contact data to how data stored and how we can fetch data by contant provider.

 


Views: 185190  |   Date: 22-Oct-2013  |   Download Source CodeRead more...
    Content Provider Basic

ContentProvider used to get data from central repository. Android application contains content provider to provide data to other applications. you can also create your custom content provider to get data from database / sdcard / media etc.

Content providers create an abstraction layer between its repository of data and external application that are using data.

External Application can call Content Provider methods with the use of ContentResolver.
ContentResolver work as ContentProvider client object, with the use of Content Resolver object we can get data from Content Provider.
ContentProvider and ContentResolver (provider clients) used together to create a interface for data to handles inter-process communication and access data in secure way.

 


Views: 245663  |   Date: 11-Oct-2013Read more...
    Dynamically Create View Elements - Android Example

In this example creating some UI elements on screen on run time. Creating textview , buttons dynamically and creating onclick listener for buttons. After click on button show index(id).

 


Views: 140802  |   Date: 30-Sep-2013  |   Download Source CodeRead more...
    Global Variable Or Application Context Variable - Android Example

In this example defining variable in application context and you can use this variable as a Global variable. You can set value in this variable and get value on any activity / broadcast reci\\eiver / service in application context(environment).
In Further examples you will see good use of this way to follow SINGALTON pattern and MVC pattern in android.


Views: 118348  |   Date: 27-Sep-2013  |   Download Source CodeRead more...
    Splash screen - Android Example

Splash screen is an activity that will show for set time when your app is starting and after set time period redirect to application main scre

 

Example :

Lets splash screen show set time is 15 sec then in mean time when splash screen showing you can do these tasks...

   1. You can download resources(images) from webserver to your phone.
   2. You can make server call and get data from server.
   3. Get data from network and save in database.

   4. Show something about your app/company/brand on Splash screen.

 

 


Views: 114636  |   Date: 26-Sep-2013  |   Download Source CodeRead more...
    Check Current Running Activity | Task | Application - Android Example

In this example detecting current running activity from top of the activity stack. In this way we can find out current running application and task.

 

Use :

   1. Suppose you have a task like , when user opens message/phone call/any application screen then your app performs an action like start a music or vibration etc....

 


Views: 55260  |   Date: 05-Sep-2013  |   Download Source CodeRead more...
    Get Registered Email Accounts - Android Example

In this example getting registered email Accounts in android phone.

Getting primary(google) mail account and all registered acconts. Showing accounts on screen.

 

NOTE :

This android example will work in real device.

 


Views: 33715  |   Date: 05-Sep-2013  |   Download Source CodeRead more...
    Custom Expandable ListView Tutorial - Android Example

In this example creating a custom Expandable ListView with parent and child rows. parent rows contains texts,images and a checkbox. child rows contains texts,images. Creating custom adapter to create Expandable ListView rows .

 

Steps :

1.   Create Model classes for parent rows(Parent.java) and for child rows(Child.java). These classes will use to store parent rows and child rows data.
2.   Create xml files for parent rows(grouprow.xml) and for child rows(childrow.xml). These classes will use to create GUI for parent rows and child rows.
3.   Create dummy data in parent and child model objects and Store objects in an ArrayList.
4.   Create custom Adapter MyExpandableListAdapter class and inflate grouprow.xml file for parent rows() and childrow.xml for child rows. Use Models Parent.java and Child.java to create data for rows.

 


Views: 100724  |   Date: 16-Jul-2013  |   Download Source CodeRead more...
    Show Phone Contacts In AutoComplete Suggestions - Android Example

In this example reading Phone Contacts and showing these contacts name as Auto suggestions for TextView. After AutoComplete value selection showing selected contact phone number in alert.

AutoCompleteTextView is an editable text view that shows suggestions automatically while the user is entering characters. The list of suggestions is displayed from which the user can choose an item.

 


Views: 40197  |   Date: 12-Jul-2013  |   Download Source CodeRead more...
    Show AutoComplete Suggestions - Android Example

In this example taking array of strings and showing these strings as Auto suggestions for TextView. After AutoComplete value selection showing selected value in alert.

AutoCompleteTextView is an editable text view that shows suggestions automatically while the user is entering characters. The list of suggestions is displayed from which the user can choose an item.

 


Views: 32045  |   Date: 11-Jul-2013  |   Download Source CodeRead more...
    Tab Layout | TabBar - Android Example

In this example creating a tab layout to show different screen for each tab.
Creating three tabs and setting different images and screens for each tab.

 

- To Create Tab and Tab change listner Extend TabActivity and implements OnTabChangeListener.
- Create tabhost object to create tabs.
- Create three tabs name FOOD , GAME , SPORT and set background images.
- Create three activities add these tabs.
- Add Tabs to tabhost.


Views: 77980  |   Date: 08-Jul-2013  |   Download Source CodeRead more...
    Create Notification Alert - Android Example

In This example creating Notification Alerts with the use of NotificationManager.

 

Some times we have requirement to show alert user from background services or from broadcast reciever then best way to notify user by Notification Alert

 


Views: 50155  |   Date: 06-Jul-2013  |   Download Source CodeRead more...
    Restful Webservice Call And Get And Parse JSON Data- Android Example

In This example calling restful webservice to get json data and parse that json data.

 

Steps :

   1. Call php file (php) from server and create JSON data in php.

   2. Consume JSON data by android and show on activity.

   3. Parse JSON data and Show parsed data on screen(activity).

 


Views: 116256  |   Date: 05-Jul-2013  |   Download Source CodeRead more...
    Dot Net Webservice Call - Android Example

In This example calling dot net webservice to get/send data to server. Using ksoap2-android-assembly-2.4-jar-with-dependencies.jar to make soap call.
Accessing a live web service ConvertWeight from http://www.webserviceX.NET/ which convert weight from one unit to another.

Steps :

   1. Add jar ksoap2-android-assembly-2.4-jar-with-dependencies.jar in your project.
  2. Creating class WebserviceCall.java and define webservice namespace and url and make soap call. Accessing a live web service ConvertWeight from http://www.webserviceX.NET/ which convert weight from one unit to another.
   3. Call WebserviceCall.java object to call getConvertedWeight method.
   4. Showing response in a toast(alert) and on screen.

 


Views: 47480  |   Date: 04-Jul-2013  |   Download Source CodeRead more...
    Check Internet Connectivity

In this example we will see how to check internet connectivity.
When we have requirement to call file on server or call webservice then  first check internet connctivity.
If internet connection is showing connected then we will call file on server or call webservice.
Required ACCESS_NETWORK_STATE permission in mainfest.xml file.


Views: 16370  |   Date: 25-Jun-2013  |   Download Source CodeRead more...
    FTP File Upload From Sdcard to server

First Time User Please check previous example for normal file upload by server script( php | java | .net | coldfusion )
Upload File To Server - Android Example ( http://androidexample.com/Upload_File_To_Server_-_Android_Example/index.php?view=article_discription&aid=83&aaid=106 )

 

In this example uploading file on server by ftp client ( with the use of ftp4j-1.6.jar ).

Steps :

   1.  Using ftp4j-1.6.jar from sauronsoftware repository. Download and Add ftp4j-1.6.jar as library.
  
   2.  Must be required a Server Dedicated IP for FTP File upload.

 


Views: 32483  |   Date: 22-Jun-2013  |   Download Source CodeRead more...
    Skew Or Bind Image On SDCARD - Android Example

In This example taking a image from sdcard and skew / bind image with the use of matrix.


Views: 7443  |   Date: 20-Jun-2013  |   Download Source CodeRead more...
    Swipe screen left right top bottom

In This example creating a Swipe screen example .Swipe screen left / right / top / bottom , an alert will show.


Views: 58204  |   Date: 07-Jun-2013  |   Download Source CodeRead more...
    Create Repeating Alarm Start After Each 2 Minutes

In This example creating a simple repeating alarm system with the use of AlarmManager. Alarm will start after each 2 mins.

 

Steps :

   1.  Using AlarmManager class to repeating and called a PendingIntent after each 2 min.
   2.  Call a media file on PendingIntent and start media file.
   3.  So after each 2 min AlarmManager will call PendingIntent a media file start.


Views: 20549  |   Date: 30-May-2013  |   Download Source CodeRead more...
    Screen Wake Sleep Event Listner Service - Android Example

In this example broadcasting screen wake / sleep event with a service.

Some times we  have requirement to make less battery consumption then you can stop your services when phone is going to sleep mode and again start your services when phone is going to wake.

 

Steps :

   1. Create a service inside main activity to get screen wake / sleep broadcast events.
   2. Create a broadcast receiver inside service to get screen wake / sleep events.
   3. Send screen wake/sleep value from broadcast receiver to Service.


Views: 18488  |   Date: 01-Apr-2013  |   Download Source CodeRead more...
    Scan wifi connections or Get number of available wifi connections

In this example scaning for number of available wifi connections , Creating a broadcast receiver which will called when number of wifi connections changed.

 

 


Views: 24307  |   Date: 26-Mar-2013  |   Download Source CodeRead more...
    In this example creating a date picker to pick day month year of date.

In this example creating a date picker to pick day , month , year of date.


Views: 43482  |   Date: 26-Mar-2013  |   Download Source CodeRead more...
    Custom Dialog - Android Example

In this example creating a custom dialog with image,text and button.

Dialog is like a popup window to show some options to users(options like accept/decline).

Using class android.app.Dialog to create dialog.

Using dialog.xml file to create custom dialog layout.


Views: 51976  |   Date: 05-Mar-2013  |   Download Source CodeRead more...
    Custom Toast Alert - Android Example

In this example creating a custom toast alert with one image and text.

Toast alert is a notification message that display for certain amount of time, and automtaically fades out after set time.

Use it to show alert message to user.
Use it for debugging your application.

android.widget.Toast class used to create toast alert message.
 


Views: 20644  |   Date: 04-Mar-2013  |   Download Source CodeRead more...
    Time Picker With AM_PM Values - Android Example

In this example creating time picker with 12 hours format with AM/PM values.

android.widget.TimePicker class to create time picker.

Use OnTimeChangedListener to get time picker event.


Views: 22755  |   Date: 04-Mar-2013  |   Download Source CodeRead more...
    Time Picker Basics Part 1 - Android Example

In this example creating time picker. time picker is used for selecting the time of day, in either 24 hour or AM/PM mode. The hour, each minute digit, and AM/PM (if applicable) can be conrolled by vertical spinners.


Views: 8483  |   Date: 03-Mar-2013  |   Download Source CodeRead more...
    Custom Spinner With Image And Text - Android Example

In this Example creating custom spinner with one image and two texts.

After spinner item selection showing selected item text on screen.

Steps :

       1.  Create Model (SpinnerModel.java) to store data for each spinner row.
       2.  Create a ArrayList to store Model (SpinnerModel.java) objects.
       3.  Store data in Models and Store Model objects in Arraylist.
       4.  Pass Model object Arraylist to custom adapter.
       5.  Custom Adapter use Arraylist data (Model Objects) and create rows for Spinner.
       6.  Create listener for Spinner and show spinner item selected values on activity.


Views: 57811  |   Date: 01-Mar-2013  |   Download Source CodeRead more...
    Upload File To Server - Android Example

In this example uploading an image from sdcard to web server.

Steps :

      1.  place an image on sdcard.
      2.  place sdcard image path and image name in UploadToServer.java. ( see below )
      3.  create a php script (UploadToServer.php) at server. ( see below )
      4.  place php script path in UploadToServer.java. ( see below )
      5.  create folder name uploads on server where you have placed php script.
      6.  give permission 777 (read/write/execute) to uploads folder.


Views: 150294  |   Date: 28-Feb-2013  |   Download Source CodeRead more...
    Spinner Basics - Android Example

In this example creating a simple spinner (Dropdown list).

Creating listener for spinner item selection and showing selected option in alert.

Creating listener for button to show selected spinner item.


Views: 71167  |   Date: 28-Feb-2013  |   Download Source CodeRead more...
    Custom Checkbox With The Use Of Selectors And Shapes

In this example creating a checkbox and using selectors and shapes to give custom look.

Using selectors to call checkbox checked state xml and unchecked state xml.

Using xml file to create shape with the use of gradient,stroke tags to give custom look for checkbox checked and unchecked state.


Views: 10878  |   Date: 25-Feb-2013  |   Download Source CodeRead more...
    Checkbox Basics With Example

In This example creating checkbox and listener to listen checkbox click and show selected checkbox value.

Create a CheckBox in your layout. Checkbox options allows the user to select multiple items, each checkbox is managed separately and you must register a click listener for each one.


Views: 22029  |   Date: 25-Feb-2013  |   Download Source CodeRead more...
    Radio Button Basics

In this example showing Radio buttons with a radio group and determining which radio button is selected.

Radio buttons are normally used together in a RadioGroup. When several radio buttons live inside a radio group, checking one radio button unchecks all the others.


Views: 24260  |   Date: 25-Feb-2013  |   Download Source CodeRead more...
    Camera Photo Capture And Show Captured Photo On Activity

In This example capturing photo by camera and showing captured image and image details on activity.

 

 


Views: 53524  |   Date: 18-Feb-2013  |   Download Source CodeRead more...
    Custom Grid Layout - Android Example

  In this example making a grid view with a custom adapter.
 
 GridView give flexibility to arrange components in a two-dimensional scrolling grid.

 


Views: 29409  |   Date: 17-Feb-2013  |   Download Source CodeRead more...
    Grid Layout - Android Example

 In this example making a grid view with very basic example.
 
 GridView give flexibility to arrange components in a two-dimensional scrolling grid.

 

 


Views: 38481  |   Date: 17-Feb-2013  |   Download Source CodeRead more...
    Table Layout - Android Example

In this example creating  a basic layout then a login screen.

In Android, TableLayout let you arranges components in rows and columns, just like the standard table layout in HTML, <tr> and <td>.

In this tutorial, we show you how to use TableLayout to arrange button, textview and edittext in rows and columns format, and also demonstrates the use of “android:layout_span” to span view in 2 cells, and “android:layout_column” to display the view in specified column.


Views: 80930  |   Date: 17-Feb-2013  |   Download Source CodeRead more...
    Relative Layout Basics - Android Example

In this example we learn how to create a RELATIVE LAYOUT and how it will adjust components.

1.    Creating a Login screen.

The RelativeLayout is very flexible. RelativeLayout give flexbility to position your component base on the relative or sibling component’s position. It’s the most flexible layout, that allow you to position your component to display in anywhere you want.


Views: 16922  |   Date: 17-Feb-2013  |   Download Source CodeRead more...
    Linear Layout Basic- Android Example

In this example we will learn about LINEAR LAYOUT.

1.   How to create Linear Layout.
2.   Created example to place comonents vertical and horizontal order.
3.   Created one example ( Login form ) to use both vertical and horizontal orientation property of LINEAR LAYOUT.


Views: 27622  |   Date: 16-Feb-2013  |   Download Source CodeRead more...
    JSON Parsing - Android Example

In this example we will learn how to parse JSON in android.

For better understanding taking a simple and static JSON to parse.


Views: 76244  |   Date: 12-Feb-2013  |   Download Source CodeRead more...
    XML Parsing - Android Example

 

In this example we will learn how to parse xml in android. 
 
For better understanding taking a simple and static xml to parse.

Views: 51463  |   Date: 11-Feb-2013  |   Download Source CodeRead more...
    GPS Basic - Android Example

In this Example creating class to get GPS data. Very basic way to get GPS data.


Views: 73923  |   Date: 09-Feb-2013  |   Download Source CodeRead more...
    How To Create A Custom Listview - Android Example

In this Android Example creating a custom adapter to create a custom ListView.

Showing how to show images and data in each list row.

 

 


Views: 101198  |   Date: 09-Feb-2013  |   Download Source CodeRead more...
    Create Listview With ListActivity - Android Example

In this android example creating a simple listview with ListActivity to display a array values.

 

 


Views: 39797  |   Date: 07-Feb-2013  |   Download Source CodeRead more...
    Create A Simple Listview - Android Example

In this android example creating a simple listview to display a array values.

 

 


Views: 203358  |   Date: 07-Feb-2013  |   Download Source CodeRead more...
    How To Make HTTP POST Request To Server - Android Example

 

In this example we will learn how to make POST method request to server in android.
 
 
 

Views: 70604  |   Date: 06-Feb-2013  |   Download Source CodeRead more...
    How To Make HTTP Get Request To Server - Android Example

In this example we will learn how to make Get request to server in android.


Views: 53773  |   Date: 06-Feb-2013  |   Download Source CodeRead more...
    Incomming SMS Broadcast Receiver - Android Example

In this android example we are showing ,when any new SMS event brodcasted ( When new SMS received ) then how to create receiver to read Incomming SMS data.

 

 


Views: 72452  |   Date: 04-Feb-2013  |   Download Source CodeRead more...
    Incomming Phone Call Broadcast Receiver - Android Example

In this android example we are showing ,when any new call event brodcasted ( When new call come ) then how to create receiver to read phone call states.


Views: 35013  |   Date: 02-Feb-2013  |   Download Source CodeRead more...
    Introduction To Broadcast Receiver Basics

1.  A broadcast receiver is an Android component which allows to register and listen for device orientation changes like sms messsage recieved , phone call recieved/pick/cut ,battery status changed, the Wi-Fi came on.

2.  Android operating system and even other applications time to time broadcast messages about things that are happening like sms messsage recieved , phone call recieved/pick/cut ,battery status changed, the Wi-Fi came on.

3.  With the help of broadcast receiver you will catch Android operating system specific events and then you can code your application for that event.


Views: 20078  |   Date: 01-Feb-2013Read more...
    AsyncroTask Example To Get Server Data - Android Example

1.  AsyncTask provide easy way to use of the UI thread.
 

 2.  Perform background operations and publish results on the UI thread without having to     manipulate threads and/or handlers.

  3.  AsyncTask is designed to be a helper class around Thread and Handler and does not use a generic threading framework.


Views: 34468  |   Date: 31-Jan-2013  |   Download Source CodeRead more...
    Thread With Handlers - Android Example

When we install an application in android then it create a thread  for that application called MAIN UI Thread, All activities run inside that thread , By the android single thread model rule we can not access UI elements (bitmap , textview etc..) directly for another thread defined inside that activity.
 
 So if want to access Main UI Thread elements by another thread then we will use  handlers.


Views: 82532  |   Date: 30-Jan-2013  |   Download Source CodeRead more...
    Thread Basics

Java defines two way to create thread
  1.  You can extends the Thread class
  2.  You can implement the Runnable interface.


Views: 7917  |   Date: 29-Jan-2013Read more...
    SQLite Database Manipulation Class - Android Example

In this Android Example we will learn how to create sqllite database manipulation class. How to open SQLite Database in Syncronize way to Insert, Update, Delete database records.

I am taking an example of storing user data in SQLite database. I am using a table called User to store user data. This table contains three columns id (INT), name (TEXT), email(TEXT).


Views: 28200  |   Date: 24-Jan-2013  |   Download Source CodeRead more...
    SQLite Basic Commands

SQLite Basic Commands,  SQLite Data Types,  SQLite sql creation


Views: 9887  |   Date: 24-Jan-2013Read more...
    SQLite in Android

SQLite is an Open Source Database which is embedded into Android. SQLite is available on every Android device.

SQLite require very less memory  at runtime (approx. 250 KByte)

Enternally SQLite database creates filesystem so this may be slow, Therefore it is recommended to perform database operations inside the AsyncTask class.


Views: 13830  |   Date: 24-Jan-2013Read more...
    Service Basics

** A Service runs with the main application thread , so some time user interaction will lock the current application . Use Service inside a separate thread, you will reduce the risk of Application Not Responding (ANR) errors . So  application's main thread can remain dedicated to user interaction with your activities.

** If you are starting service inside any activity then it will block activity so when created service done then only your activity will unlock. in this mean time if user will interacting to activity then Application Not Responding (ANR) errors will come.

** If you want user interaction on when activity is visible and also some server or time taking tasks(performs intensive or blocking operations) then you might create a thread in onCreate(), start running it in onStart(), then stop it in onStop(). Also consider using AsyncTask or HandlerThread, instead of the traditional Thread class


Views: 8491  |   Date: Read more...
    How To Create Button Android Example

Create button, Button click listener, setOnClickListener


Views: 6582  |   Date: Read more...
    Change Package Name Of Android Application

Copy application with new package name, Rename Android project, Rename an Android package


Views: 6033  |   Date: Read more...
    Starting an Activity for a Result Video

Start an Activity for a Result,startActivityForResult,onActivityResult


Views: 3873  |   Date: Read more...
    Android Manifest Basics Video

Android Manifest Introduction, Android Manifest Basics Video


Views: 4081  |   Date: Read more...
    Activity Life Cycle Basics Video

import android.app.Activity;
import android.os.Bundle;

public class ActivityBasics extends Activity {

      @Override
      public void onCreate(Bundle savedInstanceState) {
             super.onCreate(savedInstanceState);
             setContentView(R.layout.main);
       }
}
 

 


Views: 4958  |   Date: Read more...
    Activity Basics

 An Activity is an application component that provides a screen with which users can interact in order to do something, such as dial the phone, take a photo, send an email, or view a map. Each activity is given a window in which to draw its user interface.


Views: 5332  |   Date: Read more...
    Introduction To Xml Layout In Android

Introduction Video to describe Xml Layout in Android


Views: 7045  |   Date: Read more...
    Android Application Development Video Tutorial

Android Application Development Video Tutorial,Download and Install the Java JDK,Installing Eclipse and Setting up the ADT,Installing Android SDK and Set up Emulator,Setting up an Android Project


Views: 6182  |   Date: Read more...
    How to Setup Android Development Environment - Part 1

There are many ways to develop for Android and because of all the options it is sometimes a little daunting getting your environment setup.


Views: 6118  |   Date: 02-Jan-2013Read more...
videos