Tampilkan postingan dengan label button. Tampilkan semua postingan
Tampilkan postingan dengan label button. Tampilkan semua postingan

Android Emulator Shortcuts

Posted by Unknown Jumat, 20 September 2013 0 komentar
Emulated Device KeyKeyboard Key
HomeHOME
Menu (left softkey)F2 or Page-up button
Star (right softkey)Shift-F2 or Page Down
BackESC
Call/dial buttonF3
Hangup/end call buttonF4
SearchF5
Power buttonF7
Audio volume up buttonKEYPAD_PLUS, Ctrl-F5
Audio volume down buttonKEYPAD_MINUS, Ctrl-F6
Camera buttonCtrl-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/offF8
Toggle code profilingF9 (only with -trace startup option)
Toggle fullscreen modeAlt-Enter
Toggle trackball modeF6
Enter trackball mode temporarily (while key is pressed)Delete
DPad left/up/right/downKEYPAD_4/8/6/2
DPad center clickKEYPAD_5
Onion alpha increase/decreaseKEYPAD_MULTIPLY(*) / KEYPAD_DIVIDE(/)

Baca Selengkapnya ....

HTML Tag - Scripting

Posted by Unknown Selasa, 03 September 2013 0 komentar
<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>.


Baca Selengkapnya ....

HTML Tag - Forms

Posted by Unknown Rabu, 28 Agustus 2013 0 komentar
<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:











Personal Details:
User Name:

Email:

Date of birth:





</body>
</html>

Baca Selengkapnya ....

Custom Toggle Button in ANDROID

Posted by Unknown Kamis, 20 Juni 2013 0 komentar
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 :







Baca Selengkapnya ....

Delete A row in ListView with Animation

Posted by Unknown Senin, 17 Juni 2013 0 komentar
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 :
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");
all_rowtext.add("Playground");
all_rowtext.add("For");
all_rowtext.add("All");
all_rowtext.add("Android");
all_rowtext.add("Coderz");
// Create ArrayAdapter using the planet list.
listAdapter = new ArrayAdapter<String>(this, R.layout.singlerow,
all_rowtext);
// Set the ArrayAdapter as the ListView's adapter.
mainListView.setAdapter(listAdapter);
mainListView
.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent,
View rowView, int positon, long id) {
Toast.makeText(rowView.getContext(), "" + positon,
Toast.LENGTH_LONG).show();
removeListItem(rowView, positon);
}
});
}

protected void removeListItem(View rowView, final int positon) {
final Animation animation = AnimationUtils.loadAnimation(
SimpleListViewActivity.this, android.R.anim.slide_in_left);
rowView.startAnimation(animation);
Handler handle = new Handler();
handle.postDelayed(new Runnable() {

public void run() {
all_rowtext.remove(positon);
listAdapter.notifyDataSetChanged();
}
}, 1000);
}}

Baca Selengkapnya ....

Customize The Title Bar in Android

Posted by Unknown Rabu, 23 Januari 2013 0 komentar
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/apk/res/android"
android:id="@+id/RelativeLayout1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:background="@drawable/redbg" >
< include
android:id="@+id/head"
layout="@layout/titlebaar" />
< LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_below="@+id/head"
android:padding="5dp" >
--- ---- --- ---- --- --- -- --
--- --- ---- --- --- --- --- --
< /LinearLayout>
< /RelativeLayout>
in java class:

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
setContentView(R.layout.show_image);

TextView t1 = (TextView) findViewById(R.id.txtvew_title);
t1.setText("Custom Title Bar");
t1.setTextColor(Color.RED);
}

Baca Selengkapnya ....

How to use RadioButtonGroup in Android?

Posted by Unknown 0 komentar
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"
android:checked="true"
android:text="Google" />
< RadioButton
android:id="@+id/ms"
android:text="Microsoft" />
< RadioButton
android:id="@+id/apple"
android:text="Apple" />
< RadioButton
android:id="@+id/nokia"
android:text="Nokia" />
< RadioButton
android:id="@+id/samsung"
android:text="Samsung" />
< /RadioGroup>
< TextView
android:id="@+id/choice"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:padding="10dp"
android:text=""
android:textSize="25dp" />
< Button
android:id="@+id/clear"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Clear CheckBoxes" />
< /LinearLayout>
in Java Class:

public class Page Flipping extends Activity implements
RadioGroup.OnCheckedChangeListener, View.OnClickListener {

private TextView mChoice;
private RadioGroup mRadioGroup;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_page_flipping);
mRadioGroup = (RadioGroup) findViewById(R.id.menu);
// test listening to checked change events
mRadioGroup.setOnCheckedChangeListener(this);
mChoice = (TextView) findViewById(R.id.choice);
// test clearing the selection
Button clearButton = (Button) findViewById(R.id.clear);
clearButton.setOnClickListener(this);
}

public void onCheckedChanged(RadioGroup group, int checkedId) {
if (checkedId == R.id.google) {
mChoice.setText("Selected Google");
}
if (checkedId == R.id.ms) {
mChoice.setText("Selected Microsoft");
}
if (checkedId == R.id.apple) {
mChoice.setText("Selected Apple");
}
if (checkedId == R.id.nokia) {
mChoice.setText("Selected Nokia");
}
if (checkedId == R.id.samsung) {
mChoice.setText("Selected Samsung");
}
}

public void onClick(View v) {
mRadioGroup.clearCheck();
}
}

Baca Selengkapnya ....

ContextMenu in Android

Posted by Unknown Kamis, 17 Januari 2013 0 komentar
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)
{
System.out.println("item1 clicked");
}
if(item.getItemId()==R.id.item2)
{
System.out.println("item2 clicked");
}
if(item.getItemId()==R.id.item3)
{
System.out.println("item3 clicked");
}
if(item.getItemId()==R.id.item4)
{
System.out.println("item4 clicked");
}
return super.onContextItemSelected(item);
}}

Context Menu Xml:

< ?xml version="1.0" encoding="utf-8"?>
< menu xmlns:android="http://schemas.android.com/apk/res/android">
< group android:checkableBehavior="single">
< item android:id="@+id/item1" android:title="Item 1" />
< item android:id="@+id/item2" android:title="Item 2" />
< item android:id="@+id/item3" android:title="Item 3" />
< item android:id="@+id/item4" android:title="Item 4" />
< /group>
< /menu>
in 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"
android:gravity="center">
< Button
android:id="@+id/button1"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Button" />
< /RelativeLayout>
         

Baca Selengkapnya ....

Custom AlertBox in Android

Posted by Unknown Rabu, 16 Januari 2013 0 komentar
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_width="210dp"
android:layout_height="232dp"
android:padding="40dp"
android:src="@drawable/flower" />

< TextView
android:id="@+id/textView1"
android:layout_width="147dp"
android:layout_height="wrap_content"
android:text="This is a flower"
android:textSize="20dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginBottom="10dp"/>

< /LinearLayout>
in java file:

Button b= (Button) findViewById(R.id.button1);
b.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Dialog d=new Dialog(CustomdialogActivity.this);
d.setContentView(R.layout.dialog);
d.setTitle("This is important");
d.show();
}
});


Baca Selengkapnya ....

Disabling the Touch of an Activity

Posted by Unknown Senin, 07 Januari 2013 0 komentar

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(MainActivity.this,android.R.style.Theme_Panel);
overlayDialog.setCancelable(true);
overlayDialog.show();
} }

Baca Selengkapnya ....
« Postingan Lama Beranda
Trik SEO Terbaru support Online Shop Baju Wanita - Original design by Bamz | Copyright of android populer.