Skip to main content

Posts

Showing posts from May, 2012

Multi-Page template in JQuery Mobile

In my previous post I had talked about single page template in jQuery mobile. This is my another simple example for creating multiple page template using JQuery mobile. JQuery Mobile Multi Page TemplateHeader This is page1Move To Second Page Footer Header This is page2Move To First Page Footer  Here the init() method is my onload function, In this function I have registered the on click event for two buttons. The button "moveToPage2" present in page1 is redirect you to second page and the button "moveToPage1" button present in second page is redirect you to first page. Basically these two click event just called the "pageToMove" function with different page id. The actual redirection is happening in "pageToMove()" function. The function $.mobile.changePage function is used for redirecting you to next page, It needs the id of the page and transition as input. The following types of transition available in jQuery mobile.
1. none 2. fade 3. flip 4. flow …

Android - The radio group creation and event handler mechanism

This is very simple example for creating check box in android application. Here I have created the new android project and I have modified the main.xml file with following code.
 Here I have created the one radio grop and I have added some games names as option. Now I am going to display the selected game with using TextView. For getting this effect I have modified the main activity java file with following code. import android.app.Activity; import android.os.Bundle; import android.widget.RadioGroup; import android.widget.RadioGroup.OnCheckedChangeListener; import android.widget.TextView; public class RadioBoxActivity extends Activity implements OnCheckedChangeListener{ /** Called when the activity is first created. */ RadioGroup radioGroup; TextView textView; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); radioGroup = (RadioGroup)findViewById(R.id.radi…

Android - The check box creation and event handler mechanism

This is simple example for creating check box in android application. I have created the new android project and I have modified the main.xml file present in the layout folder with following code.
 Here I have just drag and drooped the check box control and I have changed the text value as "The Checkbox is unchecked". Now I am going to add the on change listener for this check box. I have changed the main java file and this is my code.
import android.app.Activity; import android.os.Bundle; import android.widget.CheckBox; import android.widget.CompoundButton; import android.widget.CompoundButton.OnCheckedChangeListener; public class BasicInputsActivity extends Activity implements OnCheckedChangeListener{ /** Called when the activity is first created. */ CheckBox checkBox1; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); checkBox1 = (CheckBox)findViewBy…

Single page template in JQuery mobile

The following code is simple example for creating mobile pages using JQuery mobile. For developing JQuery mobile pages you needs to include the jquerymobile.css, jquerymobile.js and jquery.js files. You can able to download these file from jquery site. This is my single page template.
<!DOCTYPEhtml> <html> <head> <metacharset="ISO-8859-1"> <metaname="viewport"content="width=device-width, initial-scale=1"> <title>JQuery Mobile Single Page Template</title> <scripttype="text/javascript"src="js/jquery.js"></script> <scripttype="text/javascript"src="js/jquery.mobile-1.1.0.min.js"></script> <linkrel="stylesheet"type="text/css"  href="css/themes/default/jquery.mobile-1.1.0.css"/> </head> <body> <divdata-role="page"> <divdata-role="header"> <h3>Header</h3> </div> <divdata-r…