Skip to main content

Posts

Showing posts with the label button

What is XAML in Windows Phone Development?

Here we will talk about the purpose and nature of XAML, comparing it to C# This works almost as HTML XAML is a special usage of XML. XAML has something to do with defining a user interface in our Phone's interface. So in that regard, it feels very much like HTML. But there’s a big difference … XAML is actually used to create instances of classes and set the values of the properties. So, for example, I'm defining a Button control in XAML: <Button Name = "Sample" Width="200" Height="200" HorizontalAlignment="Left" Verticalalignment="Top" Background="Red" Click="Sample_Click" > </Button>

Android Emulator Shortcuts

Emulated Device Key Keyboard Key Home HOME Menu (left softkey) F2  or  Page-up button Star (right softkey) Shift-F2  or  Page Down Back ESC Call/dial button F3 Hangup/end call button F4 Search F5 Power button F7 Audio volume up button KEYPAD_PLUS, Ctrl-F5 Audio volume down button KEYPAD_MINUS, Ctrl-F6 Camera button Ctrl-KEYPAD_5, Ctrl-F3 Switch to previous layout orientation (for example, portrait, landscape) KEYPAD_7, Ctrl-F11 Switch to next layout orientation (for example, portrait, landscape) KEYPAD_9, Ctrl-F12 Toggle cell networking on/off F8 Toggle code profiling F9 (only with  -trace  startup option) Toggle fullscreen mode Alt-Enter Toggle trackball mode F6 Enter trackball mode temporarily (while key is pressed) Delete DPad left/up/right/down KEYPAD_4/8/6/2 DPad center click KEYPAD_5 Onion alpha increase/decrease KEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

HTML Tag - Scripting

<script> This tag is used to define a client-side script, such as a javascript. <noscript> This tag is used to define an alternate content for users that have disabled scripts in their browser or have a browser that doesn't support script.The <noscript> can be used in both <head> and <body>.

HTML Tag - Forms

<form> This tag is used to create a HTML form for user input. <input> This tag specifies an input field where the user can enter data. <textarea> This tag defines a multi-line input control. <select> This tag is used to create a drop-down list. <option> This tag defines a option in a select list. <optgroup> This tag is used to group related options in a drop-down list. <button> This tag defines a clickable button. <label> This tag defines a label for an input element. <fieldset> This tag is used to group related elements in a form. <legend> This tag defines a caption foe the <fieldset> element. <html> <body> First name: Last name: Male Fill these details and submit it it.....!!!!!!!!!!! Personal Details: User Name: Email: Date of birth: ABC PQR XYZ SRT Submit it! </body> </html>

Custom Toggle Button in ANDROID

Toggle Button is a special button that has two states  for eg :"on" and "off".It can be an alternative to Radio Buttons. Method to create a Custom Toggle Button is given below : in custom_btn.xml in style.xml : in custom_toggle_bg.xml : in custom_toggle_btn.xml :                                              

Delete A row in ListView with Animation

Listview is simply a group of view that displays a list of scrolling items. "Adapters" are used to insert list items to the list.By default we are able to provide only text as list items.In order to delete a row from listview, copy or download this javacode and try yourself. Also see here : Android – Bullets in ListView ListView in Alphabetic Order in ANDROID Single Selection ListView in android Simple ListView in Android java file : public class SimpleListViewActivity extends Activity { private ListView mainListView; private ArrayAdapter<String> listAdapter; ArrayList<String> all_rowtext = new ArrayList<String>() ; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); // Find the ListView resource. mainListView = (ListView) findViewById(R.id.mainListView); all_rowtext.add("Angel"); all_rowtext.add("Mark"); all_rowtext.add("Coding...

Customize The Title Bar in Android

xml for custom title bar: < ?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:background="@drawable/titlebar> < TextView style="@style/MyRedTextAppearance" android:padding="7dp" android:id="@+id/txtvew_title" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_weight="1" android:textColor="#FFFFFF" android:textSize="20dp" android:textStyle="bold" android:gravity="center"/> < /LinearLayout> main.xml: Include the above xml to the main xml as given below... < RelativeLayout xmlns:android="http://schemas.android.com/a...

How to use RadioButtonGroup in Android?

in xml page: < ?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" > < TextView android:id="@+id/tv" android:layout_width="wrap_content" android:layout_height="wrap_content" android:text="Which company do you like the most?" android:textSize="25dp" android:textStyle="bold" /> < RadioGroup android:id="@+id/menu" android:layout_width="fill_parent" android:layout_height="wrap_content" android:checkedButton="@+id/lunch" android:orientation="vertical" > < RadioButton android:id="@+id/google" ...

ContextMenu in Android

Long click on the button to open the menu. in java class: public class ContextmenuActivity extends Activity { /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); Button b=(Button)findViewById(R.id.button1); registerForContextMenu(b); } //create the menuuu====================== @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { // TODO Auto-generated method stub super.onCreateContextMenu(menu, v, menuInfo); MenuInflater inflater=getMenuInflater(); inflater.inflate(R.layout.contextmenu, menu); } //click to each menu====================== @Override public boolean onContextItemSelected(MenuItem item) { // TODO Auto-generated method stub if(item.getItemId()==R.id.item1) ...

Custom AlertBox in Android

in main.xml file: < ?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" > < Button android:id="@+id/button1" android:layout_width="120dp" android:layout_height="wrap_content" android:text="Button" /> < /LinearLayout> in dialog.xml :(xml for custom dialog box) : < ?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" > < ImageView android:id="@+id/imageView1" android:layout_widt...

Disabling the Touch of an Activity

On a button click we are creating the same class as a dialog so that the touch is not received public class MainActivity extends Activity { Dialog overlayDialog; EditText edt; Button bt; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); edt=(EditText)findViewById(R.id.editText1); bt=(Button)findViewById(R.id.button1); bt.setOnClickListener(new OnClickListener() { @Override public void onClick(View arg0) { // TODO Auto-generated method stub disableAnyInput(); } }); } public void disableAnyInput(){ Toast.makeText(getApplicationContext(), "This will disable any input. Click the backbutton " + "to enable any input.", Toast.LENGTH_LONG).show(); overlayDialog = new Dialog(MainActi...