Monday, August 15, 2011

necessitas setup and test raycasting #QT demo on #android

I wanted to test the qt raycasting demo on my android and here are some steps and missteps that i have done in my research

I follow the sdk instructions from here

http://sourceforge.net/p/necessitas/wiki/How%20to%20install%20Necessitas%20SDK/

Download necessitas sdk for me is something like necessitas-0.2.1-online-sdk-installer-linux
chmod +x necessitas-0.2.1-online-sdk-installer-linux
./necessitas-0.2.1-online-sdk-installer-linux
I have enabled all options to be downloaded even the android ndk/sdk
my path is something like /home/mariuz/work/necessitas

Setup finished and downloaded all the files
next is to configure the qt creator
http://sourceforge.net/p/necessitas/wiki/Setup%20QtCreator/

The only changes that i needed to do is to add ant path in (is custom downloaded from apache.org and unziped in /opt)

Tools -+- Options -+- Android -+- Ant location : /opt/apache-ant-1.8.1/bin/ant



The other are left untouched
I have loaded the raycasting example
but i get an error and even if i downloaded the Ministro app from the google market (and QtCore is installed)
Starting remote process ...
Can't find eu.licentia.necessitas.industrius.example.raycasting process


Seems that :
The libraries downloaded by Ministro are different from the libraries in the Necessitas SDK (the dynamic linker in the emulator had problems that were fixed when I overwrote the Ministro libraries with the (stripped) libraries from the Necessitas SDK) – is this a known problem and will it be fixed?


So i have checked to deploy and copy the necessitas libs to the target when i run the app
but again it failed

Starting remote process ...
D/dalvikvm( 6883): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
I/dalvikvm( 6883): Unable to dlopen(/data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so): Cannot load library: link_image[1722]:  1125 could not load needed library 'libQtGui.so' for 'libraycasting.so' (load_library[1052]: Library 'libQtGui.so' not found)
I/Qt JAVA ( 6883): Can't load 'raycasting'
I/Qt JAVA ( 6883): java.lang.UnsatisfiedLinkError: Library raycasting not found
I/Qt JAVA ( 6883): 	at java.lang.Runtime.loadLibrary(Runtime.java:489)
I/Qt JAVA ( 6883): 	at java.lang.System.loadLibrary(System.java:557)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.loadBundledLibraries(QtApplication.java:97)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApplication(QtActivity.java:92)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.access$000(QtActivity.java:62)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1$1.run(QtActivity.java:149)
I/Qt JAVA ( 6883): 	at android.app.Activity.runOnUiThread(Activity.java:3652)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1.libs(QtActivity.java:146)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApp(QtActivity.java:221)
I/Qt JAVA ( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.onCreate(QtActivity.java:297)
I/Qt JAVA ( 6883): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.access$2200(ActivityThread.java:123)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
I/Qt JAVA ( 6883): 	at android.os.Handler.dispatchMessage(Handler.java:99)
I/Qt JAVA ( 6883): 	at android.os.Looper.loop(Looper.java:123)
I/Qt JAVA ( 6883): 	at android.app.ActivityThread.main(ActivityThread.java:4370)
I/Qt JAVA ( 6883): 	at java.lang.reflect.Method.invokeNative(Native Method)
I/Qt JAVA ( 6883): 	at java.lang.reflect.Method.invoke(Method.java:521)
I/Qt JAVA ( 6883): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
I/Qt JAVA ( 6883): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
I/Qt JAVA ( 6883): 	at dalvik.system.NativeStart.main(Native Method)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libwebcore.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libmedia_jni.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libexif.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libtextrendering.so' for 'startQtAndroidPlugin' (wrong CL)
D/dalvikvm( 6883): +++ not scanning '/system/lib/libsrec_jni.so' for 'startQtAndroidPlugin' (wrong CL)
W/dalvikvm( 6883): No implementation found for native Leu/licentia/necessitas/industrius/QtApplication;.startQtAndroidPlugin ()V
D/AndroidRuntime( 6883): Shutting down VM
W/dalvikvm( 6883): threadid=3: thread exiting with uncaught exception (group=0x40026160)
E/AndroidRuntime( 6883): Uncaught handler: thread main exiting due to uncaught exception
E/AndroidRuntime( 6883): java.lang.UnsatisfiedLinkError: startQtAndroidPlugin
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.startQtAndroidPlugin(Native Method)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtApplication.startApplication(QtApplication.java:158)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApplication(QtActivity.java:132)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.access$000(QtActivity.java:62)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1$1.run(QtActivity.java:149)
E/AndroidRuntime( 6883): 	at android.app.Activity.runOnUiThread(Activity.java:3652)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity$1.libs(QtActivity.java:146)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.startApp(QtActivity.java:221)
E/AndroidRuntime( 6883): 	at eu.licentia.necessitas.industrius.QtActivity.onCreate(QtActivity.java:297)
E/AndroidRuntime( 6883): 	at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2466)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2519)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.access$2200(ActivityThread.java:123)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1870)
E/AndroidRuntime( 6883): 	at android.os.Handler.dispatchMessage(Handler.java:99)
E/AndroidRuntime( 6883): 	at android.os.Looper.loop(Looper.java:123)
E/AndroidRuntime( 6883): 	at android.app.ActivityThread.main(ActivityThread.java:4370)
E/AndroidRuntime( 6883): 	at java.lang.reflect.Method.invokeNative(Native Method)
E/AndroidRuntime( 6883): 	at java.lang.reflect.Method.invoke(Method.java:521)
E/AndroidRuntime( 6883): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
E/AndroidRuntime( 6883): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
E/AndroidRuntime( 6883): 	at dalvik.system.NativeStart.main(Native Method)
E/SemcCheckin( 6883): Get crash dump level : java.io.FileNotFoundException: /data/semc-checkin/crashdump
I/dalvikvm( 6883): threadid=7: reacting to signal 3
E/dalvikvm( 6883): Unable to open stack trace file '/data/anr/traces.txt': Permission denied
I/Process ( 6883): Sending signal. PID: 6883 SIG: 9
'eu.licentia.necessitas.industrius.example.raycasting' died


Starting remote process ...
Can't find eu.licentia.necessitas.industrius.example.raycasting process

Read the section with local libs
So i started clean with the smallest qt demos (simple editor with menu that comes with qt)

The secret to start it is to make sure for emulator that arm5 is choosen
also the run Project options should contain that necessitas libs should be delpoyed with the project at once

After that i did rebuild project and run
voila




After that i have tested the raycasting using the same staps as above arm5+ delploy local qt libs +use local qt libs
and it ran !



It started on sony xperia 8 but of course there is no buttons setup , and this should be the part two of the article :)

Starting remote process ...
D/dalvikvm( 8338): Trying to load lib /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): No JNI_OnLoad found in /data/local/qt/lib/libQtCore.so 0x45910998
D/dalvikvm( 8338): Trying to load lib /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): No JNI_OnLoad found in /data/local/qt/lib/libQtGui.so 0x45910998
D/dalvikvm( 8338): Trying to load lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45910998
I/Qt      ( 8338): qt start
D/dalvikvm( 8338): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45910998
D/dalvikvm( 8338): Added shared lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45910998
I/Qt      ( 8338): qt start
D/Qt      ( 8338): startQtApp 
D/Qt      ( 8338): environmentString "HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	QT_IMPORT_PATH=/data/local/qt/imports	QT_PLUGIN_PATH=/data/local/qt/plugins" ("HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "QT_IMPORT_PATH=/data/local/qt/imports", "QT_PLUGIN_PATH=/data/local/qt/plugins") 
D/Qt      ( 8338): paramsString "QtApp	-platform	android" 
W/Qt      ( 8338): WARNING: QApplication was not created in the main() thread.
I/Qt JAVA ( 8338): surfaceChanged: 480,295
D/Qt      ( 8338): QAndroidPlatformIntegrationPlugin::create "android" 
D/Qt      ( 8338): QFbScreen::setPhysicalSize QSize(119, 79) 
D/Qt      ( 8338): QFbScreen::setGeometry QRect(0,0 480x295) 
D/Qt      ( 8338): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
D/dalvikvm( 8338): GC freed 1092 objects / 78856 bytes in 481ms
D/Qt      ( 8338): createPlatformWindow false 
D/Qt      ( 8338): setFullScreen false 
D/Qt      ( 8338): keyDown 
D/Qt      ( 8338): keyUp 
D/Qt      ( 8338): keyDown 
I/Qt JAVA ( 8338): surfaceDestroyed 
W/IInputConnectionWrapper( 8338): showStatusIcon on inactive InputConnection

'eu.licentia.necessitas.industrius.example.raycasting' died

Starting remote process ...
D/dalvikvm( 8615): Trying to load lib /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): No JNI_OnLoad found in /data/local/qt/lib/libQtCore.so 0x45768998
D/dalvikvm( 8615): Trying to load lib /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): No JNI_OnLoad found in /data/local/qt/lib/libQtGui.so 0x45768998
D/dalvikvm( 8615): Trying to load lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/local/qt/plugins/platforms/android/libandroid-5.so 0x45768998
I/Qt      ( 8615): qt start
D/dalvikvm( 8615): Trying to load lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
D/dalvikvm( 8615): Added shared lib /data/data/eu.licentia.necessitas.industrius.example.raycasting/lib/libraycasting.so 0x45768998
I/Qt      ( 8615): qt start
D/Qt      ( 8615): startQtApp 
D/Qt      ( 8615): environmentString "HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files	QT_IMPORT_PATH=/data/local/qt/imports	QT_PLUGIN_PATH=/data/local/qt/plugins" ("HOME=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "TMPDIR=/data/data/eu.licentia.necessitas.industrius.example.raycasting/files", "QT_IMPORT_PATH=/data/local/qt/imports", "QT_PLUGIN_PATH=/data/local/qt/plugins") 
D/Qt      ( 8615): paramsString "QtApp	-platform	android" 
W/Qt      ( 8615): WARNING: QApplication was not created in the main() thread.
I/Qt JAVA ( 8615): surfaceChanged: 480,295
D/dalvikvm( 8615): GC freed 939 objects / 72968 bytes in 177ms
D/Qt      ( 8615): QAndroidPlatformIntegrationPlugin::create "android" 
D/Qt      ( 8615): QFbScreen::setPhysicalSize QSize(119, 79) 
D/Qt      ( 8615): QFbScreen::setGeometry QRect(0,0 480x295) 
D/Qt      ( 8615): QAndroidPlatformScreen::QAndroidPlatformScreen():QFbScreen() 
D/Qt      ( 8615): createPlatformWindow false 
D/Qt      ( 8615): setFullScreen false 
D/Qt      ( 8615): keyDown 
D/Qt      ( 8615): keyUp 
D/Qt      ( 8615): keyDown 


No comments: