Skip to main content

Posts

Showing posts from October, 2014

Android Swipe Views with Tabs

In this post we are going to learn about how to integrate the android tab view with the fragments using ViewPager and ActionBar class. For displaying the tabs on the top of the screen you need to interact with the android action bar, this is because the tab views is connected with the action bar. Ads by Google In this example application we make three tabs called "java", "php" and ".Net" and there are three seperate fragement view for each of these tabs. First you need to add the ViewPager into the activity_main.xml file. <android.support.v4.view.ViewPager xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/pager" android:layout_width="match_parent" android:layout_height="match_parent" > </android.support.v4.view.ViewPager> Now create three layout files for the fragments. 1. java_layout.xml <?xml version="1.0" encod

Android Chat Bubble tutorial

In this post we will discus about how to create a simple android chat application graphical user interface and how the data is displayed in it.   Before going to create this application, you need to know about the 9 patch images. A 9 patch image is a normal png image with 1 dp pixels extra wide border.  In a chat application you can notice that the length and width of the chat bubble (image displayed at the background of the chat message) is automatically stretched based on its contents like shown below. Such type of an image is called a 9 patch image. You can save the 9 patch images in the drawable folder of your application with file extension .9.png . Ads by Google You have a lot of on-line tools are available to make 9 patch images and of-course you can use Photoshop to create your own 9 patch image. You can also use the draw9patch tool available with the android sdk. You can find this tool in the tools folder of your android sdk. Watch video How to create 9 patch

Android Expandable ListView

CLICK HERE TO DOWNLOAD THIS PROJECT activity_main.xml <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     xmlns:tools="http://schemas.android.com/tools"     android:layout_height="match_parent"     android:layout_width="wrap_content"     android:paddingLeft="16dp"     android:paddingRight="16dp"     android:paddingTop="16dp"     android:paddingBottom="16dp"     > <ExpandableListView     android:id="@+id/exp_list"     android:layout_height="match_parent"    android:layout_width="match_parent"   android:indicatorLeft="?android:attr/expandableListPreferredItemIndicatorLeft"     android:divider="#A4C739"     android:dividerHeight="0.5dp"      ></ExpandableListView>     </RelativeLayout> parent_layout.xml <?xml version="1.0" encoding="utf