祝大家有美好的一天。我对android开发相当陌生。您对此问题的答复将不胜感激。
在我的项目中,我必须接收和发送短信。对于接收部分,我使用广播接收器,对于发送部分,我使用普通活动。在这里,Broadcast Receiver 接收短信并将一些数据传输到我刚才提到的 Activity。然后活动执行一些任务并产生一些结果。我需要将这些结果作为短信发送。
我在清单文件中使用了 SEND_SMS 和 RECEIVE_SMS 使用权限。但是这个应用程序在模拟器上给了我一个例外。但是当我在 2 个单独的项目中测试发送部分和接收部分时,它工作正常,没有任何例外。所以我猜代码(或逻辑)没有问题。现在,为什么会抛出这个异常?是否可以让 SEND_SMS 和 RECEIVE_SMS 使用同一个项目(同一个清单)的权限?我使用 SmsManager 发送短信。您的回复将不胜感激。
这是 LogCat 的详细信息:
11-22 12:26:00.355: ERROR/Zygote(33): setreuid() failed. errno: 2
11-22 12:26:09.295: ERROR/Zygote(33): setreuid() failed. errno: 17
11-22 12:26:11.125: ERROR/BatteryService(66): usbOnlinePath not found
11-22 12:26:11.125: ERROR/BatteryService(66): batteryVoltagePath not found
11-22 12:26:11.125: ERROR/BatteryService(66): batteryTemperaturePath not found
11-22 12:26:11.155: ERROR/SurfaceFlinger(66): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake
11-22 12:26:32.497: ERROR/EventHub(66): could not get driver version for /dev/input/mouse0, Not a typewriter
11-22 12:26:32.605: ERROR/EventHub(66): could not get driver version for /dev/input/mice, Not a typewriter
11-22 12:26:33.756: ERROR/System(66): Failure starting core service
11-22 12:26:33.756: ERROR/System(66): java.lang.SecurityException
11-22 12:26:33.756: ERROR/System(66): at android.os.BinderProxy.transact(Native Method)
11-22 12:26:33.756: ERROR/System(66): at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
11-22 12:26:33.756: ERROR/System(66): at android.os.ServiceManager.addService(ServiceManager.java:72)
11-22 12:26:33.756: ERROR/System(66): at com.android.server.ServerThread.run(SystemServer.java:184)
11-22 12:26:38.805: ERROR/SoundPool(66): error loading /system/media/audio/ui/Effect_Tick.ogg
11-22 12:26:38.815: ERROR/SoundPool(66): error loading /system/media/audio/ui/KeypressStandard.ogg
11-22 12:26:38.815: ERROR/SoundPool(66): error loading /system/media/audio/ui/KeypressSpacebar.ogg
11-22 12:26:38.825: ERROR/SoundPool(66): error loading /system/media/audio/ui/KeypressDelete.ogg
11-22 12:26:39.035: ERROR/SoundPool(66): error loading /system/media/audio/ui/KeypressReturn.ogg
11-22 12:26:50.545: ERROR/ThrottleService(66): Could not open GPS configuration file /etc/gps.conf
11-22 12:26:57.865: ERROR/logwrapper(150): executing /system/bin/tc failed: No such file or directory
11-22 12:26:57.995: ERROR/logwrapper(152): executing /system/bin/tc failed: No such file or directory
11-22 12:26:58.005: ERROR/logwrapper(153): executing /system/bin/tc failed: No such file or directory
11-22 12:27:12.875: ERROR/ActivityManager(66): ANR in com.android.settings
11-22 12:27:12.875: ERROR/ActivityManager(66): Reason: Broadcast of Intent { act=android.intent.action.CLOSE_SYSTEM_DIALOGS cmp=com.android.settings/.widget.SettingsAppWidgetProvider (has extras) }
11-22 12:27:12.875: ERROR/ActivityManager(66): Load: 2.93 / 0.78 / 0.26
11-22 12:27:12.875: ERROR/ActivityManager(66): CPU usage from 10994ms to 2618ms ago:
11-22 12:27:12.875: ERROR/ActivityManager(66): ronsoft.openwnn: 209% = 122% user + 86% kernel / faults: 3908 minor 5 major
11-22 12:27:12.875: ERROR/ActivityManager(66): m.android.phone: 168% = 84% user + 84% kernel / faults: 3177 minor 7 major
11-22 12:27:12.875: ERROR/ActivityManager(66): system_server: 150% = 118% user + 31% kernel / faults: 428 minor 3 major
11-22 12:27:12.875: ERROR/ActivityManager(66): ndroid.launcher: 118% = 65% user + 52% kernel / faults: 2921 minor 3 major
11-22 12:27:12.875: ERROR/ActivityManager(66): ndroid.settings: 118% = 47% user + 70% kernel / faults: 2956 minor 7 major
11-22 12:27:12.875: ERROR/ActivityManager(66): bootanimation: 18% = 15% user + 2% kernel
11-22 12:27:12.875: ERROR/ActivityManager(66): app_process: 13% = 9% user + 4% kernel / faults: 241 minor
11-22 12:27:12.875: ERROR/ActivityManager(66): adbd: 11% = 0% user + 11% kernel
11-22 12:27:12.875: ERROR/ActivityManager(66): TOTAL: 100% = 70% user + 29% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): ANR in jp.co.omronsoft.openwnn
11-22 12:27:22.035: ERROR/ActivityManager(66): Reason: Executing service jp.co.omronsoft.openwnn/.OpenWnnJAJP
11-22 12:27:22.035: ERROR/ActivityManager(66): Load: 3.31 / 0.94 / 0.32
11-22 12:27:22.035: ERROR/ActivityManager(66): CPU usage from 10962ms to 1406ms ago:
11-22 12:27:22.035: ERROR/ActivityManager(66): system_server: 47% = 34% user + 12% kernel / faults: 511 minor
11-22 12:27:22.035: ERROR/ActivityManager(66): app_process: 15% = 14% user + 1% kernel / faults: 420 minor
11-22 12:27:22.035: ERROR/ActivityManager(66): ronsoft.openwnn: 9% = 7% user + 1% kernel / faults: 394 minor
11-22 12:27:22.035: ERROR/ActivityManager(66): ndroid.launcher: 9% = 6% user + 2% kernel / faults: 741 minor
11-22 12:27:22.035: ERROR/ActivityManager(66): bootanimation: 6% = 5% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): m.android.phone: 6% = 4% user + 1% kernel / faults: 267 minor
11-22 12:27:22.035: ERROR/ActivityManager(66): adbd: 1% = 0% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): logcat: 1% = 0% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): events/0: 0% = 0% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): servicemanager: 0% = 0% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): -ndroid.settings: 0% = 0% user + 0% kernel
11-22 12:27:22.035: ERROR/ActivityManager(66): TOTAL: 100% = 75% user + 25% kernel
11-22 12:27:33.342: ERROR/HierarchicalStateMachine(66): TetherMaster - unhandledMessage: msg.what=3