Posts

Showing posts from August, 2012

Button Clicking -Perform Action in android

Image
Button Clicking -Perform Action  in android Example : click on button will fill the some text in textField Output :   activity_main.xml <RelativeLayout 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" > <Button android:id="@+id/Generate" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:layout_centerHorizontal="true" android:layout_marginBottom="167dp" android:text="@string/generate_author_name" /> <EditText android:id="@+id/editText1" android:layout_width="wrap_content" android:layout_height="wrap_content" android

MVC Adding 2 Numbers Program

Image
MVC Architecture simple JAVA Program(MVC Adding 2 Numbers Program ) M-Model V-View C-Controller Introduction:           MVC architecture is uses in Programming languages when that program contains "user Interface components "(like buttons ,text fields, combo box).           Tutorial :         I am taking a simple example " adding two number " to demonstrate MVC Architecture.i'm going to divide the program into 4 parts   MODEL class ---MVC_Model VIEW class --- MVC_View CONTROLLER class ---MVC_Controller Intialize all above three classes in Main Method class ---GlobelMVC View class : View is only contains the user interface part (JButton, JTextField..etc) and it wouldn't  having the controllers means setting a listener for a button ( button.addActionListener(this) ). the use of the separate class for User Interface is we can modify the User Interface in Future with out changing the other functionality    /* *progr