Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Building ohNet for Android
24-07-2013, 05:17 PM
Post: #21
RE: Building ohNet for Android
(24-07-2013 10:06 AM)simonc Wrote:  Nicely timed request Smile. We're about to look into this so will hopefully have something available in the next couple of weeks.

Hey that is great! Will keep an eye out for it.
Find all posts by this user
25-07-2013, 08:11 PM
Post: #22
RE: Building ohNet for Android
Hi,
I followed the discussion on this topic here, and i am also planning to use ohNet on Android. Since it is a bit confusing, can you please clarify what's the procedure now to build ohNet for Android? Smile

regards
Find all posts by this user
28-07-2013, 09:48 AM
Post: #23
RE: Building ohNet for Android
Ok, i tried to build ohNet for android.
I installed the android NDK and set the ANDROID_NDK_ROOT variable to my ndk installation path. JAVA_PATH is also set correctly

then I run

Code:
make ohNetAndroidNative

After a while it exits with:

Code:
make[1]: *** No rule to make target `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni/../../../../../OpenHome/Maths.cpp', needed by `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/obj/local/armeabi/objs/ohNet/__/__/__/__/__/OpenHome/Maths.o'.  Stop.
make[1]: Leaving directory `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni'
make: *** [ohNetAndroidNative] Error 2

can anybody help?
Find all posts by this user
28-07-2013, 10:31 PM
Post: #24
RE: Building ohNet for Android
(28-07-2013 09:48 AM)lion87 Wrote:  Ok, i tried to build ohNet for android.
I installed the android NDK and set the ANDROID_NDK_ROOT variable to my ndk installation path. JAVA_PATH is also set correctly

then I run

Code:
make ohNetAndroidNative

After a while it exits with:
[error snipped]
can anybody help?

Looks like there is a bug in the Android make file. I'll fix this tomorrow.
Find all posts by this user
29-07-2013, 11:07 AM
Post: #25
RE: Building ohNet for Android
(28-07-2013 10:31 PM)simonc Wrote:  
(28-07-2013 09:48 AM)lion87 Wrote:  Ok, i tried to build ohNet for android.
I installed the android NDK and set the ANDROID_NDK_ROOT variable to my ndk installation path. JAVA_PATH is also set correctly

then I run

Code:
make ohNetAndroidNative

After a while it exits with:
[error snipped]
can anybody help?

Looks like there is a bug in the Android make file. I'll fix this tomorrow.

oh yeah thank you, that would be great. Smile
is there also an example for the android api, or is it the same as the java api?
Find all posts by this user
29-07-2013, 11:10 AM (This post was last modified: 29-07-2013 12:07 PM by simonc.)
Post: #26
RE: Building ohNet for Android
(29-07-2013 11:07 AM)lion87 Wrote:  
(28-07-2013 10:31 PM)simonc Wrote:  Looks like there is a bug in the Android make file. I'll fix this tomorrow.

oh yeah thank you, that would be great. Smile
The fix is committed but untested now. The build should get further but there may be other problems. Can you give it a go and let me know how you get on?

If you encounter any more problems, I'm happy to accept patches that fix them or I can easily fix them if you post the error message(s)...

(29-07-2013 11:07 AM)lion87 Wrote:  is there also an example for the android api, or is it the same as the java api?
Its just the same as the Java API so you can safely refer to the Java API docs.
Find all posts by this user
30-07-2013, 08:18 AM
Post: #27
RE: Building ohNet for Android
Hi,
Now I am receiving a similar error message regarding another file:

Code:
make[1]: *** No rule to make target `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni/../../../../../OpenHome/File.cpp', needed by `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/obj/local/armeabi/objs/ohNet/__/__/__/__/__/OpenHome/File.o'.  Stop.
make[1]: Leaving directory `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni'
make: *** [ohNetAndroidNative] Error 2

guess there will be more Big Grin

regards
Find all posts by this user
30-07-2013, 09:38 AM
Post: #28
RE: Building ohNet for Android
(30-07-2013 08:18 AM)lion87 Wrote:  Hi,
Now I am receiving a similar error message regarding another file:

Looks like one of the paths in the make file was wrong. I've committed a fix locally. If you want to try it out before the changes make it onto github (probably this evening), the diffs are

Code:
diff --git a/OpenHome/Net/Bindings/Android/jni/Android.mk b/OpenHome/Net/Bindings/Android/jni/Android.mk
index dc589ce..25f9e66 100644
--- a/OpenHome/Net/Bindings/Android/jni/Android.mk
+++ b/OpenHome/Net/Bindings/Android/jni/Android.mk
@@ -60,7 +60,6 @@ LOCAL_SRC_FILES := $(ohroot)OpenHome/Ascii.cpp \
                    $(ohroot)OpenHome/Net/ControlPoint/Upnp/EventUpnp.cpp \
                    $(ohroot)OpenHome/Exception.cpp \
                    $(ohroot)OpenHome/Fifo.cpp \
-                   $(ohroot)OpenHome/File.cpp \
                    $(ohroot)OpenHome/FileAnsii.cpp \
                    $(ohroot)OpenHome/FileBrx.cpp \
                    $(ohroot)OpenHome/FileStream.cpp \
@@ -102,6 +101,7 @@ LOCAL_SRC_FILES := $(ohroot)OpenHome/Ascii.cpp \
                    $(ohroot)OpenHome/Net/Bindings/C/OhNetCDv.cpp \
                    $(ohroot)OpenHome/Net/Bindings/C/OhNetCCombined.cpp \
                    $(ohroot)Os/OsWrapper.cpp \
+                   $(ohroot)Os/Posix/File.cpp \
                    $(ohroot)Os/Posix/TerminalOs.cpp \
                    $(ohroot)Os/Posix/Os.c \
                    ifaddrs-android.cpp
Find all posts by this user
30-07-2013, 02:27 PM
Post: #29
RE: Building ohNet for Android
Thank you, I did the change on my source copy (simply delete the line in Android.mk?)

However, here's the next one: Wink

Code:
SharedLibrary  : libohNet.so
/home/sigg/tools/android-ndk/android-ndk-r9/toolchains/arm-linux-androideabi-4.6/prebuilt/linux-x86/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld: /home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/obj/local/armeabi/objs/ohNet/__/__/__/__/__/OpenHome/FileStream.o: in function OpenHome::FileStream::OpenFile(char const*, OpenHome::FileMode):/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni/../../../../../OpenHome/FileStream.cpp:20: error: undefined reference to 'OpenHome::IFile::Open(char const*, OpenHome::FileMode)'
collect2: ld returned 1 exit status
make[1]: *** [/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/obj/local/armeabi/libohNet.so] Error 1
make[1]: Leaving directory `/home/sigg/tools/ohNet/git/ohNet/OpenHome/Net/Bindings/Android/jni'
make: *** [ohNetAndroidNative] Error 2
Find all posts by this user
30-07-2013, 02:29 PM
Post: #30
RE: Building ohNet for Android
(30-07-2013 02:27 PM)lion87 Wrote:  Thank you, I did the change on my source copy (simply delete the line in Android.mk?)

However, here's the next one: Wink

If you scroll down the patch, there is also a line to be added

+ $(ohroot)Os/Posix/File.cpp \

Adding this will fix your linker error.
Find all posts by this user


Forum Jump: