@@ -31,14 +31,14 @@ public class Hardware {
31
31
/**
32
32
* Vibrate for s seconds.
33
33
*/
34
- static void vibrate (double s ) {
34
+ public static void vibrate (double s ) {
35
35
Vibrator v = (Vibrator ) context .getSystemService (Context .VIBRATOR_SERVICE );
36
36
if (v != null ) {
37
37
v .vibrate ((int ) (1000 * s ));
38
38
}
39
39
}
40
40
41
- static SensorEvent lastEvent = null ;
41
+ public static SensorEvent lastEvent = null ;
42
42
43
43
static class AccelListener implements SensorEventListener {
44
44
public void onSensorChanged (SensorEvent ev ) {
@@ -55,7 +55,7 @@ public void onAccuracyChanged(Sensor sensor , int accuracy) {
55
55
/**
56
56
* Enable or Disable the accelerometer.
57
57
*/
58
- static void accelerometerEnable (boolean enable ) {
58
+ public static void accelerometerEnable (boolean enable ) {
59
59
SensorManager sm = (SensorManager ) context .getSystemService (Context .SENSOR_SERVICE );
60
60
Sensor accel = sm .getDefaultSensor (Sensor .TYPE_ACCELEROMETER );
61
61
@@ -72,7 +72,7 @@ static void accelerometerEnable(boolean enable) {
72
72
}
73
73
74
74
75
- static float [] accelerometerReading () {
75
+ public static float [] accelerometerReading () {
76
76
if (lastEvent != null ) {
77
77
return lastEvent .values ;
78
78
} else {
@@ -86,22 +86,22 @@ static float[] accelerometerReading() {
86
86
/**
87
87
* Get display DPI.
88
88
*/
89
- static int getDPI () {
89
+ public static int getDPI () {
90
90
return metrics .densityDpi ;
91
91
}
92
92
93
93
/**
94
94
* Show the soft keyboard.
95
95
*/
96
- static void showKeyboard () {
96
+ public static void showKeyboard () {
97
97
InputMethodManager imm = (InputMethodManager ) context .getSystemService (Context .INPUT_METHOD_SERVICE );
98
98
imm .showSoftInput (view , InputMethodManager .SHOW_FORCED );
99
99
}
100
100
101
101
/**
102
102
* Hide the soft keyboard.
103
103
*/
104
- static void hideKeyboard () {
104
+ public static void hideKeyboard () {
105
105
InputMethodManager imm = (InputMethodManager ) context .getSystemService (Context .INPUT_METHOD_SERVICE );
106
106
imm .hideSoftInputFromWindow (view .getWindowToken (), 0 );
107
107
}
@@ -111,7 +111,7 @@ static void hideKeyboard() {
111
111
*/
112
112
static List <ScanResult > latestResult ;
113
113
114
- static void enableWifiScanner ()
114
+ public static void enableWifiScanner ()
115
115
{
116
116
IntentFilter i = new IntentFilter ();
117
117
i .addAction (WifiManager .SCAN_RESULTS_AVAILABLE_ACTION );
@@ -129,7 +129,7 @@ public void onReceive(Context c, Intent i) {
129
129
130
130
}
131
131
132
- static String scanWifi () {
132
+ public static String scanWifi () {
133
133
134
134
// Now you can call this and it should execute the broadcastReceiver's
135
135
// onReceive()
0 commit comments