Thursday, 10 April 2014

ViewAnimator Creation in Android Application



main.xml

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="20dp"
        android:text="View Animator"
        android:textColor="#336633"
        android:textSize="20sp"
        android:textStyle="bold" />


Wednesday, 9 April 2014

ViewSwitcher Functionality in Android Application Development



main.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_gravity="center"
        android:layout_marginTop="20dp"
        android:text="View Switcher"
        android:textColor="#336633"
        android:textSize="20sp"
        android:textStyle="bold" />

Tuesday, 8 April 2014

How to Switch Data Using TextSwitcher Widget in Android Apps


This blog describe about TextSwitcher functionality in android application development. Using TextSwitcher widget can get next and previous data by click on next and prev button.


main.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >

Monday, 7 April 2014

How to Create StackView in Android Application Development

This blog is describe about StackView functionality. This functionality depend upon Last in-First out or First in-Last out data structure activity.This means when we open 1st activity and then open 2nd activity, then 3rd activity, 3rd activity will in front and other 1st and 2nd activity will run in background. After click on back button 3rd activity will destroy and 2nd activity will resume. Similarly again clivk on back button 2nd activity will destroy and 1st activity will resume this functionality is also known as "Back Stack" functionality in Android.

main.xml


Tuesday, 1 April 2014

Touch Event ViewFlipper Functionality in Android Application Development

This blog describe about ViewFlipper functionality in android app development. Through ViewFlipper widget can navigate from one view to another view by click event or touch event also. Through click event need Next and Previous button. through touch event need to create four animation file within animation folder.

Fundamental of touch event with X and Y co-ordinate:
onTouchEvent () method  called when User performs any touch event on screen
when a User swaps from Left to Right or Right to left
user first touches on the screen ( lets say first x coordinate is x1) holds ,swaps  then leaves the screen  (lets say second x coordinate is x2)





so if x2> x1  it means Left to Right sweep has been performed and
     if x2<x1   it means Right to Left sweep has been performed

Similarly we can track UP to Down and Down to UP swap

if  y2> y1  it means UP to Down sweep has been performed and
if  y2<y1   it means Down to UP sweep has been performed




main.xml


<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical" >