Android Fragment Tutorial

Android Fragment :

A Fragment represents a behavior or a portion of user interface in an Activity. Fragments mus be embedded with activities, they can not run independent.Single Activity can use multiple fragments and fragment usable in several activities.Each fragment has its own lifecycle, closely associated with the lifecycle of its host activity. a fragment may be a static a part of an activity or instantiated automatically during the activity’s creation or you can create(), add(), and remove() fragments dynamically in an activity at run-time.

Android Fragment tutorial example

Solution Steps Android Fragment : Implemented in Honeycomb (3.0) or Later

The primary classes related to fragments are:
android.app.Fragment
The base class for all fragment definitions
android.app.FragmentManager
The class for interacting…

Read More . . .

Android Camera API Tutorial

Android Camera :

Most Android phones today include inbuilt cameras — one at the front and one at the rear. This example shows you the way to programmatically invoke the camera to take an image and then save the image to external storage.In this Android tutorial you will learn how to use in-build android camera to take picture.

Android camera tutorial example

Solution Steps Android Camera :

In this example we will use Android camera api  (Existing android camera application api), which is use existing camera application installed on your phone.You are using an Intent object to invoke the camera, using the MediaStore.ACTION_IMAGE_CAPTURE action.

1. Create Android New project (Click here for setup new…

Read More . . .

Android Internal Storage: Read and Write text file example

Android Internal Storage :

In Android you can also save files (text file etc) directly on the device’s internal storage. By default,Saving and Loading Files to the internal storage are private to your application and different applications will not access them (nor can the user). once the user uninstalls this application, these files will automatically remove.

android read and write text file example

In Android data storage, It’s good practice to use Shared Preferences or a database to store your application data, but there are still times once you’ll need to use files directly rather than rely on Android’s managed mechanisms.

Sometime want to save data which have not be…

Read More . . .

Android Custom Listview with Image and Text using ArrayAdapter

Custom Listview with Image and Text :

The standard ListView only displays a list of items. while it may suffice when you simply need to show a list of text, it’s not enough for more refined applications. in this example, you’ll see how you’ll be able to customise the ListView so that you’ll be able to show pictures, multiple lines of text, and more.

custom listview image text

A. First Learn How to Display Image in ListView :

1. The first thing you’ll learn in this example is how to show a picture next…

Read More . . .

Android Gallery View – Displaying a List of Images

Android Gallery View :

In your application if you want display a series of images to the user, you can make use of the Gallery.The Gallery is a view that shows items (such as images) in a center-locked, horizontal scrolling list.

android Gallery View example 2

How to Create Android Gallery View:

  • Gallery is used to show Views in a horizontal list, and user will select a view , User selected view will be shown in center of the Horizontal list
  • The items of Gallery are get from an Adapter, just like ListView, in which ListView items are get from an Adapter.
  • We need to make an Adapter class that extends BaseAdapter class and override  getView() method.
  • getView() method known as…

    Read More . . .