HTC刚刚发布了OpenSense SDK: http://www.htcdev.com/devcenter/opensense-sdk
任何人都可以运行Sense SDK笔示例吗?当我尝试在我的Ubuntu计算机上运行它们时,Flyer模拟器会打开,然后应用程序崩溃并出现此logcat异常:
08-09 21:33:50.949: ERROR/AndroidRuntime(463): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.htc.demo.penmenu/com.htc.demo.penmenu.MainActivity}: android.view.InflateException: Binary XML file line #55: Error inflating class com.htc.painting.engine.HtcPaintingView
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1748)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.handleLaunchActivity(Ac tivityThread.java:1764)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.access$1500(ActivityThr ead.java:122)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread$H.handleMessage(Activit yThread.java:1002)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.os.Handler.dispatchMessage(Handler.java:99 )
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.os.Looper.loop(Looper.java:132)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.main(ActivityThread.jav a:4025)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.reflect.Method.invokeNative(Native Method)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.reflect.Method.invoke(Method.java:491)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.os.ZygoteInit$MethodAndArgsCa ller.run(ZygoteInit.java:841)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.os.ZygoteInit.main(ZygoteInit .java:599)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at dalvik.system.NativeStart.main(Native Method)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): Caused by: android.view.InflateException: Binary XML file line #55: Error inflating class com.htc.painting.engine.HtcPaintingView
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:682)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:724)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.rInflate(LayoutInflate r.java:727)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:479)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:391)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.inflate(LayoutInflater .java:347)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.android.internal.policy.impl.PhoneWindow.setCo ntentView(PhoneWindow.java:223)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.Activity.setContentView(Activity.java: 1780)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at com.htc.demo.penmenu.MainActivity.onCreate(MainAct ivity.java:42)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.Instrumentation.callActivityOnCreate(I nstrumentation.java:1048)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.app.ActivityThread.performLaunchActivity(A ctivityThread.java:1712)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): ... 11 more
08-09 21:33:50.949: ERROR/AndroidRuntime(463): Caused by: java.lang.ClassNotFoundException: com.htc.painting.engine.HtcPaintingView in loader dalvik.system.PathClassLoader[/data/app/com.htc.demo.penmenu-2.apk]
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at dalvik.system.PathClassLoader.findClass(PathClassL oader.java:251)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 40)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at java.lang.ClassLoader.loadClass(ClassLoader.java:5 00)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createView(LayoutInfla ter.java:542)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): at android.view.LayoutInflater.createViewFromTag(Layo utInflater.java:671)
08-09 21:33:50.949: ERROR/AndroidRuntime(463): ... 21 more
因此它似乎是ClassNotFoundException。
答案 0 :(得分:1)
我成功运行的唯一示例是兼容性演示。
Boo on HTC发布半生不熟的“SDK”。
答案 1 :(得分:0)
由于某种原因,模拟器不适用于opensense示例。我认为它根本不加载Sense UI。如果您使用正在构建的示例的apk(从bin文件夹中),并将其复制到您的sd内存中,您可以实际安装,并直接在手机上运行这些示例。他们使用SENSE在您的htc手机上工作。你不会在手机上强行关闭。
要在模拟器上运行这些示例,您应该可以在其上启动Sense Rom。