loading
3Instructables22,823Views15Comments

Tell us about yourself!

Complete Your Profile

Achievements

10K+ Views Earned a bronze medal
Show 0 More »
  • topstarcreations commented on dex3844's instructable Bluetooth Headset Hack1 week ago
  • Continuity Tester (Using Android Phone)

    using multimeter

    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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal=&quo...see more »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" android:paddingBottom="@dimen/activity_vertical_margin" android:paddingLeft="@dimen/activity_horizontal_margin" android:paddingRight="@dimen/activity_horizontal_margin" android:paddingTop="@dimen/activity_vertical_margin" tools:context=".MainActivity" > <TextView android:id="@+id/textView1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerHorizontal="true" android:layout_centerVertical="true" android:text="0" android:textSize="100sp"/></RelativeLayout>

    MainActivity.javapackage com.topstarcreations.continuitytestersample;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.widget.TextView;public class MainActivity extends Activity {TextView valueChange;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);valueChange = (TextView)findViewById(R.id.textView1);} @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {switch (keyCode) {case KeyEvent.KEYCODE_HEADSETHOOK:event.startTracking();valueChange.setText("1");return true;}return super.onKeyDown(keyCode, event); } @Overridepublic boolean onKeyUp(int keyCode, KeyEvent event) {switch (keyCode) {case KeyEvent.KEYCODE_HEADSETHOOK:event.star...see more »MainActivity.javapackage com.topstarcreations.continuitytestersample;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import android.widget.TextView;public class MainActivity extends Activity {TextView valueChange;@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);valueChange = (TextView)findViewById(R.id.textView1);} @Overridepublic boolean onKeyDown(int keyCode, KeyEvent event) {switch (keyCode) {case KeyEvent.KEYCODE_HEADSETHOOK:event.startTracking();valueChange.setText("1");return true;}return super.onKeyDown(keyCode, event); } @Overridepublic boolean onKeyUp(int keyCode, KeyEvent event) {switch (keyCode) {case KeyEvent.KEYCODE_HEADSETHOOK:event.startTracking();valueChange.setText("0");return true;}return super.onKeyUp(keyCode, event); } // catches the long press button event (longer than 2 seconds) @Override public boolean onKeyLongPress(int keyCode, KeyEvent event) { return true; }}

    This is the Output

    View Instructable »