AlertDialog is a subclass of  dialog that can show a title, up to three buttons, a list of selectable items, or a custom layout. In this example we will show how to create a custom Alertdialog. Code for activity_main.xml: Code for customlayout.xml: Code in Activity:

SurfaceView  Provides a dedicated drawing surface embedded inside of a view hierarchy. You can control the format of this surface and, if you like, its size; the SurfaceView takes care of placing the surface at the correct location on the screen The surface is Z ordered so that it is behind the window holding its

Knowing the current location in an android mobile will solve peoples daily problem. For developing location aware application in android, it needs location providers. There are two types of location providers, GPS Location Provider Network Location Provider. Any one of the above providers is enough to get current location of the user or user’s device.

TimeZone represents a time zone, primarily used for configuring a Calendar or SimpleDateFormat instance. Most applications will use getDefault() which returns a TimeZone based on the time zone where the program is running. If you do need to do date computations manually, there are two common cases to take into account: Somewhere like California, where

A ListView typically contain more data then the number of displayed rows. If the user scrolls the list then rows and their associated Views will be scrolled out of the visible area. The Java objects which represents the rows can be reused for newly visible rows. If Android determines that a View which represents a

Tagged under: , ,

Most Android devices allow to determine the current geolocation. This can be done via a GPS (Global Positioning System) module. The LocationManager class provides access to the Android location service. This services allows to access location providers, to register location update listeners and proximity alerts and more. The LocationProvider class is the superclass of the

JSON is the best alternative to XML for storing data in files. It is easy to parse and access data stored in JSON format. Data structures in JSON are based on key / value pairs. The key is a string, the value can be a numerical value, a boolean value (true or false) or an

AudioManager  provides access to volume and ringer mode control.Context.getSystemService(Context.AUDIO_SERVICE) is used to get an instance of this class. In this example we use two buttons to start a stop mediaplayer and we also use a seekbar to change media volume. A SeekBar is an extension of ProgressBar that adds a draggable thumb. The user can

A style is a collection of properties that specify the look and format for a View or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout. To

A style is a collection of properties that specify the look and format for a View or window. A style can specify properties such as height, padding, font color, font size, background color, and much more. A style is defined in an XML resource that is separate from the XML that specifies the layout. To

TOP