我是 android 开发的新手,遇到了一个我似乎无法解决的问题。我的 android 应用程序应该能够与我的 arduino 设备通信,向我的设备发送信息和从我的设备检索信息。我已经使用蓝牙设备在两者之间建立了连接,并且我正在使用 amarino 来促进通信。
现在我可以连接 amarino 并发送数据和接收数据,现在我想从我的应用程序中执行此操作。当我输入这一行时,问题就来了:
private static final String DEVICE_ADDRESS = "07:12:04:16:68:18";
Amarino.connect(this, DEVICE_ADDRESS);
该数字是连接到我的 arduino 设备的蓝牙适配器的 MAC 地址。一旦我在手机上运行我的应用程序,它就会由于意外错误而强制关闭。现在正如我所说,我对 android 有点菜鸟,所以我安装了 logCat 来尝试从中获取一些日志信息。我从中得到的只是这个有点无益的错误消息:
com.example.projectgreetv3/.StartingPlace 10-24 15:22:55.140 E/AndroidRuntime(4906): java.lang.RuntimeException: 无法实例化活动 ComponentInfo{com.example.projectgreetv3/com.example.projectgreetv3.StartingPlace}: java.lang.ClassNotFoundException: com.example.projectgreetv3.StartingPlace 在加载器 dalvik.system.PathClassLoader[/data/app/com.example.projectgreetv3-1.apk] 10-24 15:22:55.140 E/AndroidRuntime(4906) :引起:java.lang.ClassNotFoundException:com.example.projectgreetv3.StartingPlace in loader dalvik.system.PathClassLoader[/data/app/com.example.projectgreetv3-1.apk] 10-24 15:22:55.148 W/ ActivityManager(539): 强制完成活动 com.example.projectgreetv3/.StartingPlace 10-24 15:21:51.726 I/UinboxLogger(4585): [UinboxReceiver] onReceive() >> intent.getData() : com.example.projectgreetv3 10-24 15:21:52.382 I/UninstallAppProgress(4575): 完成卸载 pkg: com.example.projectgreetv3 10-24 15:22:52.523 D/PackageManager(539): 扫描包 com.example.projectgreetv3
我希望有人可以帮助我解决这个问题,因为我已经束手无策了。
有关以下信息的更多信息:- Arduino:- http://www.arduino.cc/ - Amarino: http ://www.amarino-toolkit.net/