Pages

Showing posts with label ps2. Show all posts
Showing posts with label ps2. Show all posts

Thursday, February 25, 2016

Android Button Controls

Android offers three types of button controls


1. The Basic Button.

2. Image Button

3. Toggle Button.

The Basic Button:


The android standard button. It is a subclass of the TextView class so it inherits all of its properties.

<linearlayout 
android:layout_height="fill_parent"
android:layout_width="fill_parent"
android:orientation="vertical"
>
<Button
android:id="@+id/btn"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Click Me"
/>
</linearlayout>


If you want to implement the OnClick event handler for a button there are three ways to do it:
First
You can implement the OnClickListner Interface for each single button in the activity like this:

Button btn=(Button)findViewById(R.id.btn);

btn.setOnClickListener(new OnClickListener()
{
public void onClick(View v) {
Button btn=(Button)v;
btn.setText("You clicked on the button");
}
}
);

But this will lead to large code blocks with lots of redundancy cause you will do it for each button in your activity.

Second
You can use an activity that implements the OnClickListner Interface and use the onClick method by switching between the buttons IDs:
public class ButtonControls extends Activity implements OnClickListener {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);

}
public void onClick(View v) {
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.btn1:
//Do something
break;
case R.id.btn2:
// Do something
break;
}
}
}


Third
Since Android 1.6 there was a new cool feature which is the ability to define the on click handlers for the bttons from the XML layout definition. Which is similar to that in ASP.NET.

<button 
android:id="@+id/btn1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:onClick="ClickHandler"
android:text="Click Me"
/>
<button
android:id="@+id/btn2"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:onclick="ClickHandler"
android:text="Click Me too"
/>
Then you define the event handler method in your class file in the same normal way

 public void ClickHandler(View v) { 
// TODO Auto-generated method stub
switch(v.getId())
{
case R.id.btn1:
//Do something
break;
case R.id.btn2:
// Do something
break;
}
}

The ImageButton
The ImageButton control is similar to the Button except it represents a button with an image instead of the text
<linearlayout android_layout_height="fill_parent" android_layout_width="fill_parent" android_orientation="vertical" 
/>
<imagebutton
android:id="@+id/btn1"
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:src="@drawable/globe"
/>
</linearlayout>

You can set the image source property from the code like this:
ImageButton btn=(ImageButton)findViewById(R.id.btn1);
btn.setImageResource(R.drawable.globe);


TheToggleButton:
The toggle button is like a check box or radio button, it has two states: On or Off.
The default behavior of ToggleButton is Off state, it displays a gray bar and the text Off.
When in On state it displays a green bar and has the text On.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_orientation="vertical"
android_layout_width="fill_parent"
android_layout_height="fill_parent"
>
<ToggleButton
android:id="@+id/tb"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Switch On"
/>
</LinearLayout>


See that despite we specified the android:text property of the toggle button, it displays the default text “Off”.
This is because ToggleButton inherits from TextView. But practically the android:text property is useless.
Instead we define the android:textOn and android:textOff properties.

In code to check the state of the Toggle button programmatically you can define the click handler in the regular way:
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="Switch On"
android:textOn="Switch Off"
android:id="@+id/btn"
android:onClick="ClickHandler"
/>

Then check the state of it like this:
public void ClickHandler(View v)
{
ToggleButton tg=(ToggleButton)v;
if(tg.isChecked())
//Do something
else
//Do something else
}

heres what its gonna look like:
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
android_orientation="vertical"
android_layout_width="fill_parent"
android_layout_height="fill_parent"
>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="Switch On"
android:textOn="Switch Off"
/>
<ToggleButton
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textOff="Switch On"
android:textOn="Switch Off"
/>
</LinearLayout>


Read More..

Tuesday, February 16, 2016

Cara Bermain Game PPSSPP di Android dengan Joystick PC PS2 PS3

Cara Mudah Game Android Dengan Joystick PC/PS2/PS3 Dengan OTG - Selamat malam, bermain game di smartphone memang menjadi hal yang biasa apalagi di zaman sekarang ini. Apalagi semenjak hadirnya smartphone android yang kini semakin memanjakan penggunanya dengan aplikasi-aplikasi gratis tesebar luas di google playstore. Pada tutorial kali ini hallo tekno akan memberikan salah satu trik yang mungkin bagi anda belum mengetahuinya yakni tentang cara mengkoneksikan Stick PS dengan USB otg untuk memainkan game PSP ISO. Untuk memainkan game ppsspp di android ini tidaklah sulit dan terbilang mudah, asalkan anda mengikuti tutorial cara memainkan game psp di android tanpa lag dengan bantuan joystick dan usb otg.

Cara Mudah Bermain Game PPSSPP dengan Joystick PS dan USB OTG

Seperti anda ketahui harga Joystick PC itu sekitar 40.000 rupiah, untuk yang singgle, dan untuk Joystick PS2 Untuk yang kw berkisar 30-40rb, untuk ori silakan cek sendiri di toko PS, dan untuk stik PS3 pun begitu setiap toko PS beda daerah beda harga.


Cara Mudah Bermain Game Android Dengan Joystick

Alat dan Bahan :
  • HP Android yang support OTG
  • Stick PS2/PC
  • Kabel OTG
  • Konverter stick ps2 ke usb (untuk stik ps2, stik pc tinggal colok ke otg)
  • Aplikasi USB/BT Joycenter (Download DISINI)
Cara Mudah Bermain Game Android Dengan Joystick PC/PS2 Melalui OTG :
  • Pertama, Download app usb/bt joycenter di android anda kemudian anda install
  • Lalu colok stick pc atau stick ps2 yang sudah di tancepin ke konverter ot lalu colok ke hp
  • Kemudian masuk app usb/bt joycenter, lalu pencet on IME
  • Kemudian klik search, lalu jika muncul driver ex. Pc atau Ps1 dualshock/ps3 dualshock, pencet lalu nanti akan muncul mapping key, kemudian minimalkan(pencet tombol home)
  • Dan tinggal main game di ppsspp atau fpse/epsxe.

*Note : stick pc atau ps2/ps1 hanya bisa di gunakan untuk memainkan game emulator yang bisa mapping key manual, seperti epsxe, fpse, ppsspp, drastic, myboy dan lain sebagainya serta tidak bisa untuk game android apk data.


Cara Bermain game Android apk dan emulator menggunakan Stik Wireless Sixaxis PS3


Alat dan Bahan
  • HP anda sudah ROOT
  • Stick ps3(kw atau ori pabrik juga bisa)
  • Aplikasi Sixaxis Controller (ambil DISINI )
  • Kabel data stick p3
Cara menghubungkan stick PS3 dengan HP Android
  • Pertama, Instal sixaxis controller
  • Colok kabel data ps3 ke hh, kalau sudah terhubung lampu di stik bakal nyala
  • Masuk ke app sixaxis
  • Klik pair lalu oke
  • Kalau muncul tulisan master address updated, berarti sticknya sudah bisa di gunakan pakai bluetooth
  • Copot kabel data lalu tekan start di app sixaxis, kemudian tekan tombol lambang P di stick sampai di app sixaxis ada tulisan conected xxxxxcx
  • Nah sekarang tinggal menikmati gaming menggunakan stick ps3 di hh Android anda.
Demikian artikel kali ini tentang Tutorial Cara Bermain Game Android Menggunakan Joystick Tanpa Root Dan Dalam Keadaan Rooted, Cara bermain game psp dengan stick ps, cara bermian game android apk psp menggunakan stick playstation,cara memasang joy stick playstation di android, cara bermain di androis dengan joy stick pc, cara menggunakan stck/game pad pc/ps2/ps3 di android Semoga bisa berguna untuk mengembangkan tekhnologi yang ada :)
Read More..