Posts

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

Using List Component in Mobile Flex Progrmming

Image
Mobile Flex 4.5 programming : List Component in Mobile Flex Programming : output: Program: ListDemo.xml -------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.ListDemoHomeView" applicationDPI="160"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> </s:ViewNavigatorApplication> --------------------------------------------------------------------------------------------- ListDemoHomeView.mxml --------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.ado

Flex 4.5:Passing data between the mobile Views/Activity

Image
Flex 4.5 (mobile development with Flex): Passing data between the mobile Views/Activity In this Tutorial I am going to pass the data between to Activity/View/Screens.. I am taking two Views are 'Home' and 'seeName' screens   in First Screen--Home we need to create one object like object_Name:Object=new Object(); example: x:Object=new Object(); after that ,we should add the data to the object,take variable name like                                                                                                                              x.variable1 then pass the screen1(Home)  data to    that variable like                                                                                                  x.variable1=textBox.text here textBox is TextInput id. and we can use the variable1 in the next screen/View like       {data.name} main.mxml: <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:

Navigation between Screens in Mobile Flex Project 4.5

Image
Flex 4.5 (mobile development with Flex): Navigation between Screens in Mobile Flex Project Output: Use the Simple method   "navigator.pushView()" to navigate between Screens . Pass next screen view as the parameter in the method . Main.mxml: <?xml version="1.0" encoding="utf-8"?> <s:ViewNavigatorApplication xmlns:fx="http://ns.adobe.com/mxml/2009"  xmlns:s="library://ns.adobe.com/flex/spark" firstView="views.HomeView" applicationDPI="160"> <fx:Declarations> <!-- Place non-visual elements (e.g., services, value objects) here --> </fx:Declarations> </s:ViewNavigatorApplication> HomeView.mxml: <?xml version="1.0" encoding="utf-8"?> <s:View xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" actionBarVisible="false" tabBarVisible="true&

Relative Layout in android UI Design

Image
android program: Relative Layout in android UI Design open project >res>layout>main.xml  and edit as below main.xml: --------------------------------------------------------------------------------------------------------------------------------- <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:orientation="vertical" >     <TextView         android:id="@+id/my_label"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="Face Book"         android:textSize="12pt" />     <EditText         android:id="@+id/text_box"         android:layout_width="fill_parent"         android:la

Linear Layout (Horizontal & Vertical) in Android

Image
android program: Linear Layout  ( Horizontal & Vertical ) in Android open project >res>layout>main.xml  and edit as below <?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:orientation="vertical" >     <LinearLayout         android:orientation="horizontal"         android:layout_width="fill_parent"         android:layout_height="fill_parent"         android:layout_weight="1">     <Button         android:text="one"         android:layout_width="wrap_content"         android:layout_height="wrap_content"/>     <Button         android:text="two"         android:layout_width="wrap_content"         android:layout_height=&