Friday, October 4, 2013

Manifest & Pascal

Manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.prakash.accounttransactionsapp"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk
        android:minSdkVersion="8"
        android:targetSdkVersion="17" />

    <application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@style/AppTheme" >
        <activity
            android:name="com.prakash.accounttransactionsapp.ExistingAccounts"
            android:label="@string/app_name"
            android:windowSoftInputMode="stateHidden|adjustResize" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <activity android:name=".AddAccount" />
        <activity android:name=".UserTransactions" />
        <activity
            android:name=".AddTransaction"
            android:windowSoftInputMode="stateHidden|adjustResize" />
         <activity
            android:name=".UpdateAccount"
            android:windowSoftInputMode="stateHidden|adjustResize" />
         <activity
            android:name=".RecentTransactions"
            android:windowSoftInputMode="stateHidden|adjustResize" />
    </application>

</manifest>


Pascal:

import java.util.*;
import java.io.*;

public class Pascal_Triangle1 {

 public static void main(String[] args) throws Exception {

     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String height=null, rowid=null,colid=null;

     try
     {
         System.out.println("Read height: " + " ");
         height=br.readLine();
         int ROW=Integer.parseInt(height);
         if(ROW<=7)
         {
       
             int[][] pascal  = new int[ROW +1][];
             pascal[1] = new int[1 + 2];
             pascal[1][1] = 1;
             for (int i = 2; i <= ROW; i++)
             {
                pascal[i] = new int[i + 2];
                for (int j = 1; j < pascal[i].length - 1; j++)
                {
                    pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];
                }
            }
            for (int i = 1; i <= ROW; i++)
            {
                for (int j = 1; j < pascal[i].length - 1; j++)
                {
                   System.out.print(pascal[i][j] + " ");
                }
                System.out.println();
            }
 
   
            System.out.print("Read row value :" + " ");
            int val1=Integer.parseInt(br.readLine());
         
            System.out.print("Read column value :" + " ");
            int val2=Integer.parseInt(br.readLine());
         
            for (int i = 1; i <= ROW; i++)
            {
                for (int j = 1; j < pascal[i].length - 1; j++)
                {
                  if((i==val1)&&(j==val2))
                       System.out.print("Requested Value is:" + pascal[i][j] + " ");
                }
            }

         }

     if(ROW>=7)
{System.out.println("Must enter row value less than height ");
}  

         else
         {
           System.out.println("Must enter row value less than height");
         }
     }
     catch(Exception e)
     {
         if(height==null)
         {
             System.out.println("Insufficient parameters.Missing valu for -height");
         }
         if(rowid==null)
         {
             System.out.println("Insufficient parameters.Missing valu for -height");
         }
         if(colid==null)
         {
             //System.out.println("Must enter col id");
         }
         if(height==null && rowid==null && colid==null)
         {
             System.out.println("Must enter height,rowid and colid of triangle");
         }
   
     }
}
}



import java.util.*; 
import java.io.*;

public class Pascal_Triangle2 { 

 public static void main(String[] args) throws Exception { 

     BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
     String height=null, rowid=null,colid=null;   
     try
     {
         System.out.println("Read height: " + " ");
         height=br.readLine();
         int ROW=Integer.parseInt(height);
         
         int[][] pascal  = new int[ROW +1][];
         pascal[1] = new int[1 + 2];
         pascal[1][1] = 1;
         for (int i = 2; i <= ROW; i++) 
         {
            pascal[i] = new int[i + 2];
            for (int j = 1; j < pascal[i].length - 1; j++) 
            {
                pascal[i][j] = pascal[i-1][j-1] + pascal[i-1][j];
            }
        }
        for (int i = 1; i <= ROW; i++) 
        {
            for (int j = 1; j < pascal[i].length - 1; j++) 
            {
               System.out.print(pascal[i][j] + " ");
            }
            System.out.println();
        }
    

        System.out.print("Read row value :" + " ");
        int val1=Integer.parseInt(br.readLine());
        
        System.out.print("Read column value :" + " ");
        int val2=Integer.parseInt(br.readLine());
        
        for (int i = 1; i <= ROW; i++) 
        {
            for (int j = 1; j < pascal[i].length - 1; j++) 
            {
              if((i==val1)&&(j==val2))
                   System.out.print("Requested Value is:" + pascal[i][j] + " ");
            }
        }
     } 
     catch(Exception e)
     {
         if(height==null)
         {
             System.out.println("Must enter height of triangle");
         }
         if(rowid==null)
         {
             System.out.println("Insufficient parameters.Missing value for -row");
         }
         
         if(colid==null)
         {
             System.out.println("Insufficient parameters.Missing value for _col");
         }
         if(height==null && rowid==null && colid==null)
         {
             System.out.println("Must enter height,rowid and colid of triangle"); 
         }
      
     }

}
}




spinner_item&transaction_item&update_account xmls


Spinner_item:

<?xml version="1.0" encoding="utf-8"?>
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
    android:id="@android:id/text1"
    android:layout_width="match_parent"
    android:layout_height="wrap_content"
    android:gravity="center_vertical"
    android:minHeight="?android:attr/listPreferredItemHeightSmall"
    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
    android:textAppearance="?android:attr/textAppearanceListItemSmall"
    android:textColor="#000000"/>


Trans_Item:

<?xml version="1.0" encoding="utf-8"?>
<TableLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="vertical"
    android:padding="10dp" >

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Acc. Name" />

        <TextView
            android:id="@+id/acc_name"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />

    </TableRow>

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Trans Date" />

        <TextView
            android:id="@+id/tr_date"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />

    </TableRow>
    
    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Trans details" />

        <TextView
            android:id="@+id/tr_details"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />

    </TableRow>

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Trans Type" />

        <TextView
            android:id="@+id/tr_type"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />

    </TableRow>

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Trans Amount" />

        <TextView
            android:id="@+id/tr_amt"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />

    </TableRow>

    <TableRow
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_marginTop="5dp"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1"
            android:text="Remarks" />

        <TextView
            android:id="@+id/remarks"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:layout_gravity="center_vertical|left"
            android:layout_weight="1" />
    </TableRow>

</TableLayout>

Update_acc
:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btn_update_acc"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.3"
            android:text="Update" />

        <Button
            android:id="@+id/btn_del_acc"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.25"
            android:text="Delete" />

        <Button
            android:id="@+id/btn_recent_trans"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="0.45"
            android:text="Transactions" />
    </LinearLayout>
    
    <View
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:background="#C1BBBB" />

    <ScrollView
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:fadingEdge="none" >

        <LinearLayout
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="vertical"
            android:padding="10dp" >

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Acc. Number" />

            <EditText
                android:id="@+id/et_ac_no"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="number" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Cust. Number" />

            <EditText
                android:id="@+id/et_cust_no"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="number" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Acc. Holder(s)" />

            <EditText
                android:id="@+id/et_ac_holder"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="textCapSentences" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Bank Name" />

            <EditText
                android:id="@+id/et_bank_name"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="textCapSentences" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Branch name" />

            <EditText
                android:id="@+id/et_br_name"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="textCapSentences" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Branch Address" />

            <EditText
                android:id="@+id/et_br_addr"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="textMultiLine"
                android:maxLines="5" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="IFSC" />

            <EditText
                android:id="@+id/et_ifsc"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="number" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="MICR" />

            <EditText
                android:id="@+id/et_micr"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="number" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Curr. Balance" />

            <EditText
                android:id="@+id/et_curr_bal"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="numberDecimal" />

            <TextView
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:text="Remarks" />

            <EditText
                android:id="@+id/et_remarks"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:inputType="text" />

        </LinearLayout>
    </ScrollView>

</LinearLayout>



all_accounts&recent_transactions_Item&Recent Transs&recent_transactions_2 xmls

All_Acc:

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical"
    tools:context=".AddAccount" >
 
    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:padding="10dp"
        android:text="Tap on the account to get details"
        android:textColor="#4C10B0" />
 
    <View
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:background="#C1BBBB" />

    <ListView
        android:id="@+id/listview"
        android:layout_width="fill_parent"
        android:layout_height="0dp"
        android:layout_weight="1"
        android:cacheColorHint="#00000000"
        android:divider="#C1BBBB"
        android:dividerHeight="1dp"
        android:fadingEdge="none" />

    <View
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:background="#C1BBBB" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <Button
            android:id="@+id/btn_add_account"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Add Account" />
        <Button
            android:id="@+id/btn_add_trans"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Add Trans" />
     
        <Button
            android:id="@+id/btn_recent_trans"
            android:layout_width="0dp"
            android:layout_height="wrap_content"
            android:layout_weight="1"
            android:text="Recent Trans" />
     
    </LinearLayout>

</LinearLayout>

Recent_trans_Item:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:padding="10dp" >

    <TextView
        android:id="@+id/txt_date"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center_vertical|left"
        android:text="Date" />

    <TextView
        android:id="@+id/txt_det"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="2"
        android:gravity="center_vertical|left"
        android:text="Details" />

    <TextView
        android:id="@+id/txt_type"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center_vertical|left"
        android:text="Type" />

    <TextView
        android:id="@+id/txt_amt"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center_vertical|right"
        android:text="Amount" />

</LinearLayout>

Recent Transs:

<?xml version="1.0" encoding="utf-8"?>
<ListView
    android:id="@+id/listview_trans"
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:cacheColorHint="#00000000"
    android:divider="#C1BBBB"
    android:dividerHeight="1dp"
    android:fadingEdge="none" />

Recent_Trans_2

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:orientation="vertical" >

    <TextView
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_margin="10dp"
        android:gravity="center"
        android:text="Recent Transactions" />

    <LinearLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="horizontal" >

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_weight="1"
            android:text="Date" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_weight="1"
            android:text="Details" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_weight="1"
            android:text="Type" />

        <TextView
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:gravity="center"
            android:layout_weight="1"
            android:text="Amount" />
    </LinearLayout>
    
    <View
        android:layout_width="fill_parent"
        android:layout_height="1dp"
        android:background="#C1BBBB" />

    <ListView
        android:id="@+id/listview_trans"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        android:cacheColorHint="#00000000"
        android:divider="#C1BBBB"
        android:dividerHeight="1dp"
        android:fadingEdge="none" />

</LinearLayout>

Acc_Item&Add_Account&Add_Trans xml files

Acc_Item:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:orientation="horizontal"
    android:padding="10dp" >

    <TextView
        android:id="@+id/bank_name"
        android:layout_width="100dp"
        android:layout_height="wrap_content"
        android:gravity="center_vertical|left"
        android:text="Bank" />

    <TextView
        android:id="@+id/acc_name"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="2"
        android:gravity="center_vertical|left"
        android:text="Details" />

    <TextView
        android:id="@+id/amount"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_weight="1"
        android:gravity="center_vertical|right"
        android:text="Amount" />

</LinearLayout>

Add Acc:

<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:fadingEdge="none"
    android:orientation="vertical" >

    <TableLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="10dp" >

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Acc. Number" />

            <EditText
                android:id="@+id/et_ac_no"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="number" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Cust. Number" />

            <EditText
                android:id="@+id/et_cust_no"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="number" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp">

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Acc. Holder(s)" />

            <EditText
                android:id="@+id/et_ac_holder"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textCapSentences" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Bank Name" />

            <EditText
                android:id="@+id/et_bank_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textCapSentences" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Branch name" />

            <EditText
                android:id="@+id/et_br_name"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textCapSentences" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Branch Address" />

            <EditText
                android:id="@+id/et_br_addr"
                android:layout_width="0dp"
                android:layout_height="60dp"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textMultiLine"
                android:maxLines="5" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="IFSC" />

            <EditText
                android:id="@+id/et_ifsc"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="number" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="MICR" />

            <EditText
                android:id="@+id/et_micr"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="number" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Curr. Balance" />

            <EditText
                android:id="@+id/et_curr_bal"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="numberDecimal" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal"
            android:layout_marginTop="5dp" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Remarks" />

            <EditText
                android:id="@+id/et_remarks"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="text" />
        </TableRow>

        <Button
            android:id="@+id/bt_add_acc"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text="Add Account" />
    </TableLayout>

</ScrollView>

Add_Trans:
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="#FFFFFF"
    android:fadingEdge="none"
    android:orientation="vertical" >

    <TableLayout
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="10dp" >

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Account" />

            <Spinner
                android:id="@+id/spn_account"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:prompt="@string/select_account" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Type" />

            <RadioGroup
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:orientation="vertical" >

                <RadioButton
                    android:id="@+id/rdo_deposit"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:checked="true"
                    android:text="Deposit" />

                <RadioButton
                    android:id="@+id/rdo_withdraw"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="With draw" />
            </RadioGroup>
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Date" />

            <LinearLayout
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_weight="1"
                android:gravity="center_vertical"
                android:orientation="horizontal" >

                <TextView
                    android:id="@+id/txt_date"
                    android:layout_width="wrap_content"
                    android:layout_height="wrap_content"
                    android:text="07-08-2013" />
               
                <ImageView
                    android:id="@+id/im_picker"
                    android:layout_width="30dp"
                    android:layout_height="30dp"
                    android:layout_marginLeft="10dp"
                    android:src="@drawable/ic_launcher" />
               
            </LinearLayout>
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Amount" />

            <EditText
                android:id="@+id/et_amount"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textCapSentences" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Cheque num" />

            <EditText
                android:id="@+id/et_chq_num"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textCapSentences" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Cheque party" />

            <EditText
                android:id="@+id/et_chq_party"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="textMultiLine"
                android:maxLines="5" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Cheque details" />

            <EditText
                android:id="@+id/et_chq_dt"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="number" />
        </TableRow>

        <TableRow
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="5dp"
            android:orientation="horizontal" >

            <TextView
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:text="Remarks" />

            <EditText
                android:id="@+id/et_remarks"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:layout_gravity="center_vertical|left"
                android:layout_weight="1"
                android:inputType="text" />
        </TableRow>

        <Button
            android:id="@+id/bt_add_trans"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:layout_marginTop="10dp"
            android:text="Add Transaction" />
    </TableLayout>

</ScrollView>



UserTransactions


User Trans:


package com.prakash.accounttransactionsapp;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

public class UserTransactions extends Activity {

private DataHelper dh;

private ListView listview_trans;

private ArrayList<String> idList;
private Intent intentObj;

private String user_id;

protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recent_transactions_2);

/***
* Initialization Block
*/

dh = new DataHelper(this);
listview_trans = (ListView)findViewById(R.id.listview_trans);
idList = new ArrayList<String>();
/***
* Getting extras from Intent
*/

Bundle extras = getIntent().getExtras();
if(extras != null)
{
user_id = extras.getString("Userid");
}

ArrayList<String> aList = dh.getAllTransactionsById(user_id);
System.out.println(aList);
ArrayList<HashMap<String, String>> hashmap = new ArrayList<HashMap<String,String>>();

HashMap<String, String> hmap;
int size = aList.size()/9;
for(int i=0;i<size;i++)
{
String cheque_details = aList.get((i*9)+5);
cheque_details = cheque_details == null?"Cheque :"+cheque_details:"Cash";
hmap = new HashMap<String, String>();
idList.add(aList.get((i*9)+0));
hmap.put("Date", aList.get((i*9)+3));
hmap.put("Details", cheque_details);
hmap.put("Type", aList.get((i*9)+2).substring(0, 1));
hmap.put("Amount", aList.get((i*9)+4));

hashmap.add(hmap);
}
String from[] =  {"Date","Details","Type","Amount"};
int to[] =  {R.id.txt_date,R.id.txt_det,R.id.txt_type,R.id.txt_amt};
SimpleAdapter adapter = new SimpleAdapter(this, hashmap,
      R.layout.recent_trans_item,from,to );

listview_trans.setAdapter(adapter);



listview_trans = (ListView)findViewById(R.id.listview_trans);

/***
* Click Events
*/


}

}

RecentTransactions&UpdateAccount

Recent Trans:

package com.prakash.accounttransactionsapp;

import java.util.ArrayList;
import java.util.HashMap;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import android.widget.Toast;

public class RecentTransactions extends Activity {

private DataHelper dh;

private ListView listview_trans;

private ArrayList<String> idList;
private Intent intentObj;


protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.recent_transactions);

/***
* Initialization Block
*/

dh = new DataHelper(this);
listview_trans = (ListView)findViewById(R.id.listview_trans);
idList = new ArrayList<String>();
/***
* Getting extras from Intent
*/

ArrayList<String> aList = dh.getAllTransactions();
System.out.println(aList);
ArrayList<HashMap<String, String>> hashmap = new ArrayList<HashMap<String,String>>();

HashMap<String, String> hmap;
int size = aList.size()/7;
for(int i=0;i<size;i++)
{
String cheque_details = aList.get((i*7)+3);
cheque_details = cheque_details == null?"Cheque :"+cheque_details:"Cash";
hmap = new HashMap<String, String>();
idList.add(aList.get((i*7)+0));
hmap.put("Bank Name", aList.get((i*7)+1));
hmap.put("Date", aList.get((i*7)+2));
hmap.put("Details", cheque_details);
hmap.put("Type", aList.get((i*7)+4).substring(0, 1));
hmap.put("Amount", aList.get((i*7)+5));
hmap.put("Remarks", aList.get((i*7)+6));

hashmap.add(hmap);
}
String from[] =  {"AccNum","Date","Details","type","Amount","remarks"};
int to[] =  {R.id.acc_name,R.id.tr_date,R.id.tr_details,R.id.tr_type,R.id.tr_amt,R.id.remarks};
SimpleAdapter adapter = new SimpleAdapter(this, hashmap,
      R.layout.transaction_item,from,to );

listview_trans.setAdapter(adapter);



listview_trans = (ListView)findViewById(R.id.listview_trans);

/***
* Click Events
*/


}

}

Update Acc:

package com.prakash.accounttransactionsapp;

import java.util.ArrayList;

import android.app.Activity;
import android.app.AlertDialog;
import android.content.DialogInterface;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class UpdateAccount extends Activity {

private DataHelper dh;
private EditText et_acc_num,et_cust_num,et_acc_holder,et_bank_name,et_branch_name,et_branch_addr,et_ifsc,et_micr,et_curr_bal,et_remarks;
private String acc_num,cust_num,acc_holder,bank_name,branch_name,branch_addr,ifsc,micr,curr_bal,remarks;
private Button btn_update_acc,btn_delete_acc,btn_recent_trans;
private String user_id;
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.update_account);
/***
* Initialization Block 
*/
dh = new DataHelper(this);
et_acc_num = (EditText)findViewById(R.id.et_ac_no);
et_cust_num = (EditText)findViewById(R.id.et_cust_no);
et_acc_holder = (EditText)findViewById(R.id.et_ac_holder);
et_bank_name = (EditText)findViewById(R.id.et_bank_name);
et_branch_name = (EditText)findViewById(R.id.et_br_name);
et_branch_addr = (EditText)findViewById(R.id.et_br_addr);
et_ifsc = (EditText)findViewById(R.id.et_ifsc);
et_micr = (EditText)findViewById(R.id.et_micr);
et_curr_bal = (EditText)findViewById(R.id.et_curr_bal);
et_remarks = (EditText)findViewById(R.id.et_remarks);
btn_update_acc = (Button)findViewById(R.id.btn_update_acc);
btn_delete_acc = (Button)findViewById(R.id.btn_del_acc);
btn_recent_trans= (Button)findViewById(R.id.btn_recent_trans);
/***
* Getting extras from Intent
*/
Bundle extras = getIntent().getExtras();
if(extras != null)
{
user_id = extras.getString("Userid");
setValues(user_id);
}
btn_update_acc.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {

if(Validate())
{
//DisplayToastMessage("Everything is fine...!");
dh.update_account(user_id,acc_num,cust_num,acc_holder,bank_name,branch_name,branch_addr,ifsc,micr,curr_bal,remarks);
ClearAll();
DisplayToastMessage("Account updated successfully..!!");
finish();
Intent n = new Intent(getApplicationContext(),ExistingAccounts.class);
startActivity(n);
}
}
});
btn_delete_acc.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {

if(Validate())
{
//DisplayToastMessage("Everything is fine...!");
AlertDialog ald = displayAlert();
ald.show();
}
}
});
btn_recent_trans.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View arg0) {

if(Validate())
{
//DisplayToastMessage("Everything is fine...!");
Intent n = new Intent(getApplicationContext(),UserTransactions.class);
n.putExtra("Userid", user_id);
startActivity(n);
}
}
});
}
private AlertDialog displayAlert()
{
AlertDialog.Builder builder = new AlertDialog.Builder(
                UpdateAccount.this);
        builder.setCancelable(true);
        builder.setTitle("Do you really want to delete "+acc_holder+" ?");
        builder.setInverseBackgroundForced(true);
        builder.setPositiveButton("Yes",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog,
                            int which) {
                        dialog.dismiss();
                        
                        dh.delete_account(user_id);
    DisplayToastMessage("Account deleted successfully..!!");
    finish();
    Intent n = new Intent(getApplicationContext(),ExistingAccounts.class);
    startActivity(n);
   
                    }
                });
        builder.setNegativeButton("No",
                new DialogInterface.OnClickListener() {
                    @Override
                    public void onClick(DialogInterface dialog,
                            int which) {
                        dialog.dismiss();
                    }
                });
        AlertDialog alert = builder.create();
return alert;
}
private void ReadValues()
{
acc_num = et_acc_num.getText().toString().trim();
cust_num = et_cust_num.getText().toString().trim();
acc_holder = et_acc_holder.getText().toString();
bank_name = et_bank_name.getText().toString().trim();
branch_name = et_branch_name.getText().toString().trim();
branch_addr = et_branch_addr.getText().toString().trim();
ifsc = et_ifsc.getText().toString().trim();
micr = et_micr.getText().toString().trim();
curr_bal = et_curr_bal.getText().toString().trim();
remarks = et_remarks.getText().toString().trim();
}
private boolean Validate()
{
boolean bool = false;
ReadValues();
if(acc_num.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter Account number!");
et_acc_num.requestFocus();
}
else if(cust_num.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter customar Number!");
et_cust_num.requestFocus();
}
else if(acc_holder.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter Account holder name!");
et_cust_num.requestFocus();
}
else if(bank_name.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter Bank Name!");
et_bank_name.requestFocus();
}
else if(branch_name.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter Branch Name!");
et_branch_name.requestFocus();
}
else if(ifsc.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter IFSC Number!");
et_ifsc.requestFocus();
}
else if(curr_bal.equals(""))
{
bool = false;
DisplayToastMessage("Please Enter current balance!");
et_curr_bal.requestFocus();
}
else
{
bool = true;
}
return bool;
}
private void setValues(String id)
{
ArrayList<String> alist = dh.getAccountDetails(id);
if(alist.size()>0)
{
et_acc_num.setText(alist.get(1));
et_cust_num.setText(alist.get(2));
et_acc_holder.setText(alist.get(3));
et_bank_name.setText(alist.get(4));
et_branch_name.setText(alist.get(5));
et_branch_addr.setText(alist.get(6));
et_ifsc.setText(alist.get(7));
et_micr.setText(alist.get(8));
et_curr_bal.setText(alist.get(9));
et_remarks.setText(alist.get(10));
}
}
private void ClearAll()
{
et_acc_num.setText("");
et_cust_num.setText("");
et_acc_holder.setText("");
et_bank_name.setText("");
et_branch_name.setText("");
et_branch_addr.setText("");
et_ifsc.setText("");
et_micr.setText("");
et_curr_bal.setText("");
et_remarks.setText("");
}

private void DisplayToastMessage(String message)
{
if(message!=null)
{
Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show();
}
}
}