Android Widget – ImageView

android

The ImageView class can load images from various sources (such as resources or content providers), takes care of computing itsmeasurement from the image so that it can be used in any layout manager, and provides various display options such as scaling and tinting. Add ImageView Open “your.xml” file, just add an ImageView and Button for demonstration. By default, imageView1 will ... Read More »

Android Widget – EditText

android

A EditText is an overlay over TextView that configures itself to be editable. It is the predefined subclass ofTextView that includes rich editing capabilities. Creating a EditText You can create a EditText instance either by declaring it inside a layout XML file or by instantiating it programmatically.Below example will cover both ways of creating a EditText in the following sections. ... Read More »

Android Widget – TextView

android

The Android TextView component is a View subclass that is capable of showing text. Being a subclass of View the TextView the component can be used in your Android app’s GUI inside a ViewGroup or as the content view of an activity. Creating a TextView You can create a TextView instance either by declaring it inside a layout XML file ... Read More »

Android Widget – Button

android

A Button is a Push-button which can be pressed, or clicked, by the user to perform an action. Button Attributes: This example will take you through simple steps to show how to create your own Android application using Linear Layout and Button. First, create a layout in your layout folder. After Than Create Activity in your main src folder : Read More »

Android Widget – ListView

android

Android ListView is a view which groups several items and display them in vertical scrollable list. The list items are automatically inserted to thelist using an Adapter that pulls content from a source such as an array or database. An adapter actually bridges between UI components and the data source that fill data into UI Component. Adapter holds the data ... Read More »

Android Gestures

android

Android provides special types of touch screen events such as pinch , double tap, scrolls , long presses and flinch. These are all known as gestures. Android provides GestureDetector class to receive motion events and tell us that these events correspond to gestures or not. To use it, you need to create an object of GestureDetector and then extend another ... Read More »

Android Creating links using Linkfy

android

Linkfy is a class that lets you create links from TextViews. You can create links not just to web sites, but to also map addresses, emails and even phone numbers. Linking to a web address TextView myWebSite = (TextView) findViewById(R.id.my_web_site); myWebSite.setText("http://http://www.google.com/"); Linkify.addLinks(myWebSite , Linkify.WEB_URLS); Linking to a phone number TextView myPhone = (TextView) findViewById(R.id.my_web_site); myPhone .setText("9999590698"); Linkify.addLinks(myPhone  , Linkify.PHONE_NUMBERS); //map ... Read More »

Android Resource images

android

Resource images are placed under <project_dir>/res/drawable Using a resource image in an image view – XML example Using a resource image in an image view – Code Example Turning the resource image to a Bitmap object Drawing the bitmap on a canvas object Clearing the bitmap data from the memory Read More »

Android Status-Bar Notifications

android

One of the ways to notify the Android user is by displaying notifications in the status bar. You can show a message, play sound add icon and more. Creating a status bar notification Read More »

Android Alerts/Dialogs

android

Toast A toast notification is a message that pops up on the surface of the window. AlertDialog AlertDialog with a List Creating Custom Dialog using layout XML file As a developer you can also create customized alert dialogs. Step 1 – Creating the Dialog XML * The dialog layout xml file is placed together with all the layout xml files ... Read More »