Showing posts with label Android. Show all posts
Showing posts with label Android. Show all posts

Toast Tutorial

          Toast is a simple pop-up notification message, that automatically fades away after a certain amount of time. Toasts are used to notify user of a completion of certain operation, for example, if you are working on a task management application, toast can be used to tell your user that a task has been successfully saved. 

Relative Layout Tutorial

       In RelativeLayout all views are positioned relatively to each other. This means that you can create an EditText element and then create a button and say that you want this button to be positioned to left of the EditText. View can be positioned relatively to its sibling elements or to its parent layout. 
        Many say that RelativeLayout is the hardest to master, but I honesty don't think so at all. RelativeLayout is very flexible and I am sure that if you spend some time just playing around with it, you'll find it very easy to use as well ;)

Linear Layout Tutorial


      Using LinearLayout all layout elements are aligned alongside, horizontally or vertically. In this view group all its children are placed one after another, which means that there can only be one child in each row, regardless of its width.

      Layout's orientation is set using android:orientation attribute. Here are two examples of horizontal and vertical LinearLayout:

Android AutoCompleteTextView Example

     
AutoCompleteTextView
AutoCompleteTextView
AutoCompleteTextView is an editable text view that automatically shows completion suggestions while the user is typing. The suggestion list will appear in a drop down menu, allowing the user to choose one of the options and place it in the text box. This useful feature can make your application a lot more user friendly and easy to use. 





Android ProgessBar Example


Hi, in this tutorial you will learn how to use a ProgressBar element in your Android application. ProgessBar is a visual element that show a progress that has been made in some operation. It is known as good practice to use this element if you have any long lasting operations in your application, this way you can notify your user of how far the operation has progressed. 

Animation in Android Using XML files


In this tutorial you will learn how to create animation in Android using tween animation. Tween animation is an animation defined in XML that performs transitions such as rotating, fading, moving, and stretching on a graphic. We will be using rotate element, which is used to create rotation animations and translate element, which creates a vertical or horizontal motion animation.

Making a Phone Call in Android


In this tutorials you will learn how to make a phone call in Android.




Android Options Menu Example


Android Options Menu
In this tutorial you will learn how to create an options menu in Android. Options menu is most commonly used, this menu is presented when a user presses the Menu button on the device.  "On Android 3.0 and higher, items from the options menu are presented by the action bar as a combination of on-screen action items and overflow options. Beginning with Android 3.0, the Menu button is deprecated (some devices don't have one), so you should migrate toward using the action bar to provide access to actions and other options."

Drawing 2D objects in Android


 

In this tutorial you will learn to dynamically draw the following 2D objects: oval, rectangle, star and rectangle with rounded corner.

Android RadioButton Example


In this tutorial you will learn how to create a RadioButton, which allows user to choose one of several options. Putting multiple RadioButton elements in one container makes it impossible to choose more than one option, which means that when user toggles one button it automatically cancels the previous one. There is only two things that you will need to do to have a RadioButton element in your application: 1. Add RadioButton element to xml layout file and 2. Add onClick() event handler to your activity class.

Android Context Menu Example


           In this tutorial I will show you how to create a context menu. A context menu is a menu that appears when a user long-presses a view.
           I am assuming that you already have a list of items that you will use, but if you don't you can quickly create one following the three steps of my ListView tutorial here:

Android ListView Example


In this tutorial I will show how to create a ListView and fill it with data. 
1. Creating a row layout

             First thing that we need to do is to create a row layout that will specify the way each row of our ListView is going to look like. To do that we need to create a new xml file (ringht click on the res folder of your project New->Android xml file) and name it row. Add the following code to your new row.xml file:

 <?xml version="1.0" encoding="utf-8"?>  
 <TextView   
      xmlns:android="http://schemas.android.com/apk/res/android"  
      android:textIsSelectable="true"  
      android:id="@+id/r_text"   
      android:layout_width="fill_parent"  
      android:layout_height="fill_parent"  
      android:padding="10dip"  
      android:textColor="#ffffff"  
      android:textSize="17sp"/>  

Android Button Example


In this tutorial you will learn:
  • How to add a button element to your application layout
  • How to change button's color
  • How to react to user pressing a button.

Android Spinner


    
 In this tutorial I'll show you three things: 
  • How to add a spinner to your application layout;
  • How to populate your spinner with an array from strings.xml file;
  • How to handle user's selection.

Lets get started then:)

Android ImageButton Example

       

         The name of this element speaks for itself, ImageButton is basically just a clickable image:) There are three things that you are going to need to create an ImageButton:

1. Design your button

         To do this you can use any software that you are comfortable with, it can be Paint or Microsoft Word, or Photoshop and PagePlus for something more sophisticated:) You can also find some very nice ready to use buttons on the internet (for example http://www.iconarchive.com is a good place to take a look at), just make sure to check the licence:) I have created a very simple button, that looks like this: