Hier ist noch mal meine Activity.java
1package Geraeteid.auslesen;
2
3import java.util.UUID;
4
5import android.app.Activity;
6import android.content.Context;
7import android.os.Bundle;
8import android.telephony.TelephonyManager;
9import android.view.View;
10import android.view.View.OnClickListener;
11import android.widget.Button;
12
13public class GeraeteidActivity extends Activity
14implements OnClickListener{
15 /** Called when the activity is first created. */
16
17 private Button Geraete_ID;
18
19 @Override
20 public void onCreate(Bundle savedInstanceState) {
21 super.onCreate(savedInstanceState);
22 setContentView(R.layout.main);
23
24 Geraete_ID = (Button)findViewById(R.id.button1);
25 Geraete_ID.setOnClickListener(this);
26
27 }
28 public void onClick(View v)
29 {
30 final TelephonyManager tm = (TelephonyManager) getBaseContext().getSystemService(Context.TELEPHONY_SERVICE);
31
32 final String tmDevice, tmSerial, androidId;
33 tmDevice = "" + tm.getDeviceId();
34 tmSerial = "" + tm.getSimSerialNumber();
35 androidId = "" + android.provider.Settings.Secure.getString(getContentResolver(), android.provider.Settings.Secure.ANDROID_ID);
36
37 UUID deviceUuid = new UUID(androidId.hashCode(), ((long)tmDevice.hashCode() << 32) | tmSerial.hashCode());
38 deviceUuid.toString();
39
40 }
41}
laut eclipse ist die auch fehlerfrei und
sollte laufen.
mein LogCat sagt aber
02-13 12:46:18.854: E/Zygote(32): setreuid() failed. errno: 2
02-13 12:46:32.764: E/Zygote(32): setreuid() failed. errno: 17
02-13 12:46:35.044: E/BatteryService(68): usbOnlinePath not found
02-13 12:46:35.044: E/BatteryService(68): batteryVoltagePath not found
02-13 12:46:35.044: E/BatteryService(68): batteryTemperaturePath not found
02-13 12:46:35.075: E/SurfaceFlinger(68): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
02-13 12:46:35.284: E/SensorService(68): couldn't open device for module sensors (Invalid argument)
02-13 12:46:42.485: E/System(68): Failure starting core service
02-13 12:46:42.485: E/System(68): java.lang.SecurityException
02-13 12:46:42.485: E/System(68): at android.os.BinderProxy.transact(Native Method)
02-13 12:46:42.485: E/System(68): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
02-13 12:46:42.485: E/System(68): at android.os.ServiceManager.addService(ServiceManager.java:72)
02-13 12:46:42.485: E/System(68): at com.android.server.ServerThread.run(SystemServer.java:207)
02-13 12:46:42.514: E/EventHub(68): could not get driver version for /dev/input/mouse0, Not a typewriter
02-13 12:46:42.514: E/EventHub(68): could not get driver version for /dev/input/mice, Not a typewriter
02-13 12:46:42.894: E/SoundPool(68): error loading /system/media/audio/ui/Effect_Tick.ogg
02-13 12:46:42.894: E/SoundPool(68): error loading /system/media/audio/ui/KeypressStandard.ogg
02-13 12:46:42.894: E/SoundPool(68): error loading /system/media/audio/ui/KeypressSpacebar.ogg
02-13 12:46:42.904: E/SoundPool(68): error loading /system/media/audio/ui/KeypressDelete.ogg
02-13 12:46:42.904: E/SoundPool(68): error loading /system/media/audio/ui/KeypressReturn.ogg
02-13 12:46:44.404: E/ThrottleService(68): Could not open GPS configuration file /etc/gps.conf
02-13 12:46:48.566: E/logwrapper(172): executing /system/bin/tc failed: No such file or directory
02-13 12:46:48.604: E/logwrapper(174): executing /system/bin/tc failed: No such file or directory
02-13 12:46:48.694: E/logwrapper(175): executing /system/bin/tc failed: No such file or directory
02-13 12:47:57.845: E/AndroidRuntime(347): FATAL EXCEPTION: main
02-13 12:47:57.845: E/AndroidRuntime(347): java.lang.RuntimeException: Unable to start activity ComponentInfo{Geraeteid.auslesen/Geraeteid.auslesen.GeraeteidActivity}: java.lang.ClassCastException: Geraeteid.auslesen.GeraeteidActivity
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1647)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1663)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:931)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.os.Handler.dispatchMessage(Handler.java:99)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.os.Looper.loop(Looper.java:130)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread.main(ActivityThread.java:3683)
02-13 12:47:57.845: E/AndroidRuntime(347): at java.lang.reflect.Method.invokeNative(Native Method)
02-13 12:47:57.845: E/AndroidRuntime(347): at java.lang.reflect.Method.invoke(Method.java:507)
02-13 12:47:57.845: E/AndroidRuntime(347): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
02-13 12:47:57.845: E/AndroidRuntime(347): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
02-13 12:47:57.845: E/AndroidRuntime(347): at dalvik.system.NativeStart.main(Native Method)
02-13 12:47:57.845: E/AndroidRuntime(347): Caused by: java.lang.ClassCastException: Geraeteid.auslesen.GeraeteidActivity
02-13 12:47:57.845: E/AndroidRuntime(347): at Geraeteid.auslesen.GeraeteidActivity.onCreate(GeraeteidActivity.java:24)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-13 12:47:57.845: E/AndroidRuntime(347): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1611)
02-13 12:47:57.845: E/AndroidRuntime(347): ... 11 more
— geändert am 14.02.2012, 07:05:30
Jedem das Seine, doch Mir das Meine
Empfohlener redaktioneller Inhalt
Mit Deiner Zustimmung wird hier ein externer Inhalt geladen.
Mit Klick auf den oben stehenden Button erklärst Du Dich damit einverstanden, dass Dir externe Inhalte angezeigt werden dürfen. Dabei können personenbezogene Daten an Drittanbieter übermittelt werden. Mehr Infos dazu findest Du in unserer Datenschutzerklärung.