<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
+ <service android:name=".DebounceService"/>
</application>
</manifest>
<?xml version="1.0" encoding="utf-8"?>
<resources>
- <string name="app_name">MS2Debounce</string>
+ <string name="app_name">Milestone 2 Debounce</string>
</resources>
--- /dev/null
+package de.rmdir.ms2debounce;
+
+import android.content.Intent;
+import android.app.IntentService;
+
+public class DebounceService extends IntentService {
+
+ // Create worker thread
+ public DebounceService() {
+ super("DebounceService");
+ }
+
+ @Override
+ protected void onHandleIntent(Intent intent) {
+ }
+
+ @Override
+ public void onCreate() {
+ try {
+ Process ps = Runtime.getRuntime().exec("su");
+ } catch (Exception e) {}
+ super.onCreate();
+ }
+}
import android.app.Activity;
import android.os.Bundle;
+import android.content.Intent;
public class MS2Debounce extends Activity
{
public void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
+
+ Intent debouncesvc = new Intent(this, DebounceService.class);
+ startService(debouncesvc);
+
setContentView(R.layout.main);
}
}