Building bluecove-android2 project using Ant

288 views
Skip to first unread message

Ivan Lukic

unread,
Apr 2, 2012, 9:25:05 AM4/2/12
to bluecove-users
Hello all,

I am newbie to Ant/Maven/Bluecove.
I would like to build bluecove-android2 project or obtain .jar file
from internet if possible.
So far, my search was unsuccessful so I tried to build the project,
but this failed as well.
I tried using Maven, Eclipse and Ant in the end, and none gave me
wanted result.

The problem is that I get bunch compile errors no matter how i try to
import the project in eclipse.

Ant also gives me compile errors. The command that I use is "ant jar"
from bluecove-android2 directory.
I placed bluecove-snapshot2.1.1.jar in target directory manually.

Below is just the beginning of the ant output. I tried to upload
entire output as attachment but could not figure out how to do that
here.

Thanks in advance.

Ivan Lukic
------------------------------------------------------ Ant output
--------------------------------------------------------------
Buildfile: z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\build.xml

init:

verify-bluecove-main-exists:

compile:
[echo] compiling on java 1.7.0_02, OS Windows XP 5.1 x86
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\build.xml:42: warning: 'includeantruntime' was not
set, defaulting to build.sysclasspath=last; set to false for
repeatable builds
[javac] Compiling 4 source files to z:\MyProjects\Unsorted
\Bluecove SVN\bluecove-read-only\bluecove-android2\target\classes
[javac] warning: [options] bootstrap class path not set in
conjunction with -source 1.5
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\src\main\java\com\intel\bluetooth
\AndroidBluetoothConnection.java:27: error: package android.bluetooth
does not exist
[javac] import android.bluetooth.BluetoothServerSocket;
[javac] ^
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\src\main\java\com\intel\bluetooth
\AndroidBluetoothConnection.java:28: error: package android.bluetooth
does not exist
[javac] import android.bluetooth.BluetoothSocket;
[javac] ^
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\src\main\java\com\intel\bluetooth
\AndroidBluetoothConnection.java:48: error: cannot find symbol
[javac] private BluetoothSocket socket;
[javac] ^
[javac] symbol: class BluetoothSocket
[javac] location: class AndroidBluetoothConnection
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\src\main\java\com\intel\bluetooth
\AndroidBluetoothConnection.java:49: error: cannot find symbol
[javac] private BluetoothServerSocket serverSocket;
[javac] ^
[javac] symbol: class BluetoothServerSocket
[javac] location: class AndroidBluetoothConnection
[javac] z:\MyProjects\Unsorted\Bluecove SVN\bluecove-read-only
\bluecove-android2\src\main\java\com\intel\bluetooth
\AndroidBluetoothConnection.java:54: error: cannot find symbol
[javac] private AndroidBluetoothConnection(long handle,
BluetoothSocket socket, boolean isServer) throws IOException {
[javac]
...

Mina Shokry

unread,
Apr 2, 2012, 7:33:54 PM4/2/12
to bluecov...@googlegroups.com
Try importing the parent bluecove project and build it all with maven. It should build all modules including the bluecove-android2 module.


--
You received this message because you are subscribed to the Google Groups "bluecove-users" group.
To post to this group, send email to bluecov...@googlegroups.com.
To unsubscribe from this group, send email to bluecove-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bluecove-users?hl=en.


Ivan Lukic

unread,
Apr 3, 2012, 1:10:47 AM4/3/12
to bluecov...@googlegroups.com
Hi Mina,

Thanks for your answer.
I tried building it with maven (entire root project) and unfortunately it could not be built.
I guess configuring maven is not easy thing to do.

Anyway, for now, I found easier solution.
I somehow managed to miss these .jar files earlier.
So now, my project compiles, but gives me an exception:
04-03 06:59:56.800: E/BTServer(12547): OBEX Server start error Property bluecove.android.context MUST be correctly set before initializing the stack. Call BlueCoveImpl.setConfigObject(BluecoveConfigProperties.PROPERTY_ANDROID_CONTEXT, <a reference to a context>) before calling LocalDevice.getLocalDevice()
04-03 06:59:56.800: W/System.err(12547): javax.bluetooth.BluetoothStateException: Property bluecove.android.context MUST be correctly set before initializing the stack. Call BlueCoveImpl.setConfigObject(BluecoveConfigProperties.PROPERTY_ANDROID_CONTEXT, <a reference to a context>) before calling LocalDevice.getLocalDevice()
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BluetoothStackAndroid.initialize(BluetoothStackAndroid.java:113)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:1014)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:518)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
04-03 06:59:56.804: W/System.err(12547):     at java.security.AccessController.doPrivileged(AccessController.java:182)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
04-03 06:59:56.804: W/System.err(12547):     at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
04-03 06:59:56.804: W/System.err(12547):     at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
04-03 06:59:56.804: W/System.err(12547):     at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
04-03 06:59:56.804: W/System.err(12547):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:47)
...

Which obviously means I should set context as it was suggested here.
I use:
BlueCoveImpl.setConfigObject(BlueCoveConfigProperties.PROPERTY_ANDROID_CONTEXT, getApplicationContext());
to set a context before getting LocalDevice or using any JSR-82 API.
I also tried:
BlueCoveImpl.setConfigObject(BlueCoveConfigProperties.PROPERTY_ANDROID_CONTEXT, getBaseContext());
but again no success.

As you probably see, I am not so experienced with Android as well :)

If you have any suggestions, please feel free to share them with me.

Kind Regards,
Ivan Lukic
--
Ivan Lukić

Ivan Lukic

unread,
Apr 3, 2012, 11:58:02 AM4/3/12
to bluecov...@googlegroups.com
Hi Mina,

I made another attempt with GPL version of .jars, suggested here.
Below, I found some possible issues and I tried to follow steps described in other messages.
I don't have access to my phone -> /data/ folder, so I can't verify if libbluecove.so exist there (BOLD line below).
Assuming that next line tells that it is there, but I am not sure.
In my /system/lib folder there is no libbluecove.so, so I could not delete it (suggested in one of the posts).
I did dumpdex as well and if I am right it contains the needed bluecove code.
Also, libbluecove.so is inside libs folder of .apk file.

Below are listed logs I got from Logcat.
Any precious ideas?

Best Regards,
Ivan

04-03 17:33:58.074: I/BTServer(16645): OS_NAME: Linux
04-03 17:33:58.074: I/BTServer(16645): OS_ARCH: armv7l
04-03 17:33:58.074: I/BTServer(16645): JAVA_RUNTIME_NAME: Android Runtime
04-03 17:33:58.101: I/dalvikvm(16645): Could not find method org.apache.log4j.Logger.getLogger, referenced from method com.intel.bluetooth.DebugLog4jAppender.<init>
04-03 17:33:58.101: W/dalvikvm(16645): VFY: unable to resolve static method 15768: Lorg/apache/log4j/Logger;.getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;
04-03 17:33:58.101: D/dalvikvm(16645): VFY: replacing opcode 0x71 at 0x0005
04-03 17:33:58.101: D/dalvikvm(16645): VFY: dead code 0x0008-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.<init> ()V
04-03 17:33:58.105: W/dalvikvm(16645): VFY: unable to resolve static field 4522 (DEBUG) in Lorg/apache/log4j/Level;
04-03 17:33:58.105: D/dalvikvm(16645): VFY: replacing opcode 0x62 at 0x0008
04-03 17:33:58.113: W/dalvikvm(16645): VFY: unable to resolve static field 4523 (ERROR) in Lorg/apache/log4j/Level;
04-03 17:33:58.113: D/dalvikvm(16645): VFY: replacing opcode 0x62 at 0x0012
04-03 17:33:58.113: D/dalvikvm(16645): VFY: dead code 0x000a-000d in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-03 17:33:58.113: D/dalvikvm(16645): VFY: dead code 0x0014-0017 in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-03 17:33:58.113: I/dalvikvm(16645): Could not find method org.apache.log4j.Category.isDebugEnabled, referenced from method com.intel.bluetooth.DebugLog4jAppender.isLogEnabled
04-03 17:33:58.117: W/dalvikvm(16645): VFY: unable to resolve virtual method 15766: Lorg/apache/log4j/Category;.isDebugEnabled ()Z
04-03 17:33:58.117: D/dalvikvm(16645): VFY: replacing opcode 0x6e at 0x0007
04-03 17:33:58.117: D/dalvikvm(16645): VFY: dead code 0x000a-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.isLogEnabled (I)Z
04-03 17:33:58.136: W/dalvikvm(16645): No implementation found for native Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()Z
04-03 17:33:58.136: D/dalvikvm(16645): Trying to load lib /data/data/de.is04.telemedic/lib/libbluecove.so 0x405152b0
04-03 17:33:58.136: D/dalvikvm(16645): Added shared lib /data/data/de.is04.telemedic/lib/libbluecove.so 0x405152b0
04-03 17:33:58.136: D/dalvikvm(16645): No JNI_OnLoad found in /data/data/de.is04.telemedic/lib/libbluecove.so 0x405152b0, skipping init
04-03 17:33:58.140: E/BTServer(16645): OBEX Server start error Bluetooth Device is not available
04-03 17:33:58.140: W/System.err(16645): javax.bluetooth.BluetoothStateException: Bluetooth Device is not available
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(Native Method)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BluetoothStackBlueZ.initialize(BluetoothStackBlueZ.java:148)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:1014)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:518)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
04-03 17:33:58.140: W/System.err(16645):     at java.security.AccessController.doPrivileged(AccessController.java:182)
04-03 17:33:58.140: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
04-03 17:33:58.144: W/System.err(16645):     at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
04-03 17:33:58.144: W/System.err(16645):     at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
04-03 17:33:58.144: W/System.err(16645):     at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
04-03 17:33:58.144: W/System.err(16645):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:47)
04-03 17:33:58.144: W/System.err(16645):     at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:262)
04-03 17:33:58.144: W/System.err(16645):     at android.view.View.performClick(View.java:2538)
04-03 17:33:58.144: W/System.err(16645):     at android.view.View$PerformClick.run(View.java:9152)
04-03 17:33:58.144: W/System.err(16645):     at android.os.Handler.handleCallback(Handler.java:587)
04-03 17:33:58.144: W/System.err(16645):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-03 17:33:58.144: W/System.err(16645):     at android.os.Looper.loop(Looper.java:123)
04-03 17:33:58.148: W/System.err(16645):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-03 17:33:58.148: W/System.err(16645):     at java.lang.reflect.Method.invokeNative(Native Method)
04-03 17:33:58.148: W/System.err(16645):     at java.lang.reflect.Method.invoke(Method.java:507)
04-03 17:33:58.148: W/System.err(16645):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-03 17:33:58.148: W/System.err(16645):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-03 17:33:58.148: W/System.err(16645):     at dalvik.system.NativeStart.main(Native Method)
04-03 17:33:58.148: W/System.err(16645): de.is04.telemedic.connector.exception.MethodNotImplemented: Not implemented!
04-03 17:33:58.148: W/System.err(16645):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.getFiles(BluecoveOBEXBTManager.java:320)
04-03 17:33:58.148: W/System.err(16645):     at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:263)
04-03 17:33:58.148: W/System.err(16645):     at android.view.View.performClick(View.java:2538)
04-03 17:33:58.152: W/System.err(16645):     at android.view.View$PerformClick.run(View.java:9152)
04-03 17:33:58.152: W/System.err(16645):     at android.os.Handler.handleCallback(Handler.java:587)
04-03 17:33:58.152: W/System.err(16645):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-03 17:33:58.152: W/System.err(16645):     at android.os.Looper.loop(Looper.java:123)
04-03 17:33:58.152: W/System.err(16645):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-03 17:33:58.152: W/System.err(16645):     at java.lang.reflect.Method.invokeNative(Native Method)
04-03 17:33:58.152: W/System.err(16645):     at java.lang.reflect.Method.invoke(Method.java:507)
04-03 17:33:58.152: W/System.err(16645):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-03 17:33:58.152: W/System.err(16645):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-03 17:33:58.152: W/System.err(16645):     at dalvik.system.NativeStart.main(Native Method)
04-03 17:39:51.449: D/AndroidRuntime(16645): Shutting down VM
04-03 17:39:51.449: W/dalvikvm(16645): threadid=1: thread exiting with uncaught exception (group=0x40015578)
--
Ivan Lukić

Mina Shokry

unread,
Apr 3, 2012, 8:22:42 PM4/3/12
to bluecov...@googlegroups.com
Hello,

First, the libbluecove.so is loaded and if ti wasn't loaded, the could would have thrown an UnsatisfiedLinkError. But for some reason that I don't know till now, the gpl version doesn't work on all android devices which is your case now.

For getting the android2 jar working, try passing a reference to your activity or service from which you initiate the bluetooth stack.

Regards,
Mina.

Ivan Lukic

unread,
Apr 4, 2012, 5:02:03 AM4/4/12
to bluecov...@googlegroups.com
Hi Mina,

Thank you for your time.

So, to make GPL work, I would probably have to write it's JNI part from the scratch (libbluecove.so), right?

Another thing, for now, I am focusing my attention on android2 project.
I made dumb mistake by passing this(in my case it was reference to OnClickListener) instead of reference to activity. :)
So now, another problem occurs.
If I understand correctly logs say that setDeviceServiceClasses is not supported on Android 2.x (bold lines).
The code that I use very similar to OBEXServer example found here.
I attached my code as well, just in case.
Another problem is, although ProtocolDescriptorList is set as in example, exception is thrown (next bold lines).

In my activity code I set following properties before I make call to LocalDevice (LocalDevice.getLocalDevice()):

BlueCoveImpl.setConfigObject(BlueCoveConfigProperties.PROPERTY_ANDROID_CONTEXT, context);

String obexUUIDs = "0x1105"; // a comma separated string of UUIDs.
BlueCoveImpl.setConfigProperty(BlueCoveConfigProperties.PROPERTY_ANDROID_OBEX_UUIDS, obexUUIDs);
               
// just for testing
BlueCoveImpl.setConfigProperty(BlueCoveConfigProperties.PROPERTY_ANDROID_DISCOVERABLE_DURATION, String.valueOf(10));

I am wondering if it is possible to make OBEX server work on android?
If that is not possible, I guess then I have no choice but to move back to GPL project, right?

All the best,
Ivan

04-04 09:55:24.832: I/dalvikvm(21509): Could not find method org.apache.log4j.Logger.getLogger, referenced from method com.intel.bluetooth.DebugLog4jAppender.<init>
04-04 09:55:24.832: W/dalvikvm(21509): VFY: unable to resolve static method 15791: Lorg/apache/log4j/Logger;.getLogger (Ljava/lang/String;)Lorg/apache/log4j/Logger;
04-04 09:55:24.832: D/dalvikvm(21509): VFY: replacing opcode 0x71 at 0x0005
04-04 09:55:24.835: D/dalvikvm(21509): VFY: dead code 0x0008-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.<init> ()V
04-04 09:55:24.851: W/dalvikvm(21509): VFY: unable to resolve static field 4499 (DEBUG) in Lorg/apache/log4j/Level;
04-04 09:55:24.851: D/dalvikvm(21509): VFY: replacing opcode 0x62 at 0x0008
04-04 09:55:24.867: W/dalvikvm(21509): VFY: unable to resolve static field 4500 (ERROR) in Lorg/apache/log4j/Level;
04-04 09:55:24.867: D/dalvikvm(21509): VFY: replacing opcode 0x62 at 0x0012
04-04 09:55:24.867: D/dalvikvm(21509): VFY: dead code 0x000a-000d in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-04 09:55:24.867: D/dalvikvm(21509): VFY: dead code 0x0014-0017 in Lcom/intel/bluetooth/DebugLog4jAppender;.appendLog (ILjava/lang/String;Ljava/lang/Throwable;)V
04-04 09:55:24.875: I/dalvikvm(21509): Could not find method org.apache.log4j.Category.isDebugEnabled, referenced from method com.intel.bluetooth.DebugLog4jAppender.isLogEnabled
04-04 09:55:24.875: W/dalvikvm(21509): VFY: unable to resolve virtual method 15789: Lorg/apache/log4j/Category;.isDebugEnabled ()Z
04-04 09:55:24.875: D/dalvikvm(21509): VFY: replacing opcode 0x6e at 0x0007
04-04 09:55:24.875: D/dalvikvm(21509): VFY: dead code 0x000a-000b in Lcom/intel/bluetooth/DebugLog4jAppender;.isLogEnabled (I)Z
04-04 09:55:24.933: I/System.out(21509): BlueCove version 2.1.1-SNAPSHOT on android_2.x
04-04 09:55:26.664: D/BluetoothSocket(21509): create BluetoothSocket: type = 1, fd = -1, uuid = [null], port = 8
04-04 09:55:26.664: I/BLZ20_WRAPPER(21509): blz20_wrp_socket: fam 31, type 1, prot BTPROTO_RFCOMM
04-04 09:55:26.664: D/BLZ20_WRAPPER(21509): blz20_init: initializing...
04-04 09:55:26.664: D/BTL_IFC_WRP(21509): wsactive_init: init active list
04-04 09:55:26.664: I/BTL_IFC(21509): main_client_thread: Client main thread starting
04-04 09:55:26.765: D/BLZ20_WRAPPER(21509): blz20_init: success
04-04 09:55:26.765: I/BTL_IFC(21509): BTL_IFC_RegisterSubSystem: Register subsystem [BTS]
04-04 09:55:26.765: I/BTL_IFC(21509): btl_ifc_ctrl_connect: Connect control channel for subsystem [BTS]
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_create: CTRL
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_alloc_new_sock: wrp_alloc_new_sock sub 1
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_create: 57
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: wrp_sock_connect brcm.bt.btlif:9000 (57)
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9000
04-04 09:55:26.765: D/BTL_IFC_WRP(21509): wrp_sock_connect: wrp_sock_connect ret:0 server name:brcm.bt.btlif.9000
04-04 09:55:26.765: I/BTL_IFC_WRP(21509): wrp_sock_connect: Connected. (57)
04-04 09:55:26.765: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_REGISTER_SUBSYS_REQ (BTS) 0 pbytes (hdl 57)
04-04 09:55:26.769: D/BTL_IFC(21509): BTL_IFC_RegisterSubSystem: add new ctrl fd to active set
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_wsock_create: BTS
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_alloc_new_sock: wrp_alloc_new_sock sub 16
04-04 09:55:26.769: D/BTL_IFC_WRP(21509): wrp_wsock_create: 58
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): btsk_alloc_add: success
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): btsk_dump_list:  fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_socket: return 58
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt:  fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: configure rfcomm lm mode 0x26, (master:0, auth 1, enc 1)
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: success
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt:  fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: configure rfcomm sndbuf len 71680 bytes
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_setsockopt: success
04-04 09:55:26.769: D/BLZ20_ASOCKWRP(21509): asocket_init
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 58, cmd 3
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl:  fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 58, cmd 4
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl:  fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.769: D/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: transparant fcntl
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 60, cmd 3
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: wsock not found, pass through transparantly
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: s 60, cmd 4
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_wrp_fcntl: wsock not found, pass through transparantly
04-04 09:55:26.769: I/BLZ20_WRAPPER(21509): blz20_set_asocket: success (58,59,60)
04-04 09:55:26.777: I/BLZ20_WRAPPER(21509): blz20_wrp_bind: s 58
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): blz20_wrp_bind: bind socket fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): __bind_prot_rfcomm: rc_chan 8
04-04 09:55:26.777: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_BIND_REQ, wait for |BTLIF_BTS_RFC_BIND_RSP|
04-04 09:55:26.777: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_BIND_REQ (BTS) 8 pbytes (hdl 57)
04-04 09:55:26.785: I/BTL_IFC(21509): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_BIND_RSP (BTS) 14 pbytes (hdl 57)
04-04 09:55:26.785: I/BLZ20_WRAPPER(21509): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_BIND_RSP
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_signal_event:  fd (-1:58), bta -1, rc 0, wflags 0x2, cflags 0x0, port 0
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_signal_event: event BTLIF_BTS_RFC_BIND_RSP matched
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: unblocked fd (-1:58), bta -1, rc 0, wflags 0x0, cflags 0x0, port 0
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: BTLIF_MAKE_LOCAL_SERVER_NAME return name: brcm.bt.btlif.9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: socket_local_server_bind result:0 server_name:brcm.bt.btlif.9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_bind: socket_local_server_bind on port 9049
04-04 09:55:26.785: I/BLZ20_WRAPPER(21509): blz20_wrp_listen: s 58, backlog 1
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): blz20_wrp_listen:  fd (-1:58), bta -1, rc 8, wflags 0x0, cflags 0x2, port 9049
04-04 09:55:26.785: D/BTL_IFC_WRP(21509): wrp_sock_listen_bl: wrp_sock_listen_bl : fd 58 brcm.bt.btlif:9049 backlog 1
04-04 09:55:26.785: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: send BTLIF_BTS_RFC_LISTEN_REQ, wait for |BTLIF_BTS_RFC_LISTEN_RSP|
04-04 09:55:26.785: I/BTL_IFC(21509): send_ctrl_msg: [BTL_IFC CTRL] send BTLIF_BTS_RFC_LISTEN_REQ (BTS) 24 pbytes (hdl 57)
04-04 09:55:26.789: I/BTL_IFC(21509): btl_ifc_ctrl_rx: [BTL_IFC CTRL] recv BTLIF_BTS_RFC_LISTEN_RSP (BTS) 19 pbytes (hdl 57)
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): btlif_ctrl_callback: btlif_ctrl_callback : msg id BTLIF_BTS_RFC_LISTEN_RSP
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): btlif_process_listen_rsp: listen response for bta hdl 1
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_signal_event:  fd (58:58), bta 1, rc 8, wflags 0x8, cflags 0x2, port 9049
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_signal_event: event BTLIF_BTS_RFC_LISTEN_RSP matched
04-04 09:55:26.789: D/BLZ20_WRAPPER(21509): btlif_send_msg_wait_response: unblocked fd (58:58), bta 1, rc 8, wflags 0x0, cflags 0x2, port 9049
04-04 09:55:26.789: I/BLZ20_WRAPPER(21509): __listen_prot_rfcomm: success, scn 8
04-04 09:55:28.320: D/BTServer(21509): BT server url: null
04-04 09:55:30.140: D/BTServer(21509): setDeviceServiceClasses Not Supported on android_2.x
04-04 09:55:30.144: W/System.err(21509): com.intel.bluetooth.NotSupportedRuntimeException: Not Supported on android_2.x

04-04 09:55:30.152: W/System.err(21509):     at com.intel.bluetooth.ServiceRecordImpl.setDeviceServiceClasses(ServiceRecordImpl.java:551)
04-04 09:55:30.156: W/System.err(21509):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:66)
04-04 09:55:30.164: W/System.err(21509):     at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 09:55:30.167: W/System.err(21509):     at android.view.View.performClick(View.java:2538)
04-04 09:55:30.171: W/System.err(21509):     at android.view.View$PerformClick.run(View.java:9152)
04-04 09:55:30.179: W/System.err(21509):     at android.os.Handler.handleCallback(Handler.java:587)
04-04 09:55:30.183: W/System.err(21509):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 09:55:30.191: W/System.err(21509):     at android.os.Looper.loop(Looper.java:123)
04-04 09:55:30.195: W/System.err(21509):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 09:55:30.199: W/System.err(21509):     at java.lang.reflect.Method.invokeNative(Native Method)
04-04 09:55:30.207: W/System.err(21509):     at java.lang.reflect.Method.invoke(Method.java:507)
04-04 09:55:30.210: W/System.err(21509):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 09:55:30.210: W/System.err(21509):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 09:55:30.210: W/System.err(21509):     at dalvik.system.NativeStart.main(Native Method)
04-04 09:55:35.726: E/BTServer(21509): Updating SDP ProtocolDescriptorList is mandatory
04-04 09:55:35.726: W/System.err(21509): java.lang.IllegalArgumentException: ProtocolDescriptorList is mandatory

04-04 09:55:35.738: W/System.err(21509):     at com.intel.bluetooth.BluetoothConnectionNotifierBase.validateServiceRecord(BluetoothConnectionNotifierBase.java:167)
04-04 09:55:35.742: W/System.err(21509):     at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.validateServiceRecord(BluetoothRFCommConnectionNotifier.java:91)
04-04 09:55:35.746: W/System.err(21509):     at com.intel.bluetooth.BluetoothConnectionNotifierBase.updateServiceRecord(BluetoothConnectionNotifierBase.java:208)
04-04 09:55:35.753: W/System.err(21509):     at com.intel.bluetooth.ServiceRecordsRegistry.updateServiceRecord(ServiceRecordsRegistry.java:81)
04-04 09:55:35.761: W/System.err(21509):     at javax.bluetooth.LocalDevice.updateRecord(LocalDevice.java:491)
04-04 09:55:35.765: W/System.err(21509):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:91)
04-04 09:55:35.769: W/System.err(21509):     at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 09:55:35.777: W/System.err(21509):     at android.view.View.performClick(View.java:2538)
04-04 09:55:35.781: W/System.err(21509):     at android.view.View$PerformClick.run(View.java:9152)
04-04 09:55:35.781: W/System.err(21509):     at android.os.Handler.handleCallback(Handler.java:587)
04-04 09:55:35.781: W/System.err(21509):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 09:55:35.785: W/System.err(21509):     at android.os.Looper.loop(Looper.java:123)
04-04 09:55:35.785: W/System.err(21509):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 09:55:35.785: W/System.err(21509):     at java.lang.reflect.Method.invokeNative(Native Method)
04-04 09:55:35.785: W/System.err(21509):     at java.lang.reflect.Method.invoke(Method.java:507)
04-04 09:55:35.789: W/System.err(21509):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 09:55:35.789: W/System.err(21509):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 09:55:35.789: W/System.err(21509):     at dalvik.system.NativeStart.main(Native Method)
04-04 09:55:38.445: D/BTServer(21509): Accepting OBEX connections
04-04 09:55:42.863: E/BTServer(21509): acceptAndOpen  ProtocolDescriptorList is mandatory
04-04 09:55:42.863: W/System.err(21509): javax.bluetooth.ServiceRegistrationException: ProtocolDescriptorList is mandatory
04-04 09:55:42.875: W/System.err(21509):     at com.intel.bluetooth.BluetoothConnectionNotifierBase.updateServiceRecord(BluetoothConnectionNotifierBase.java:211)

04-04 09:55:42.878: W/System.err(21509):     at com.intel.bluetooth.BluetoothRFCommConnectionNotifier.acceptAndOpen(BluetoothRFCommConnectionNotifier.java:72)
04-04 10:30:27.312: W/System.err(21593):     at com.intel.bluetooth.obex.OBEXSessionNotifierImpl.acceptAndOpen(OBEXSessionNotifierImpl.java:89)
04-04 10:30:27.316: W/System.err(21593):     at com.intel.bluetooth.obex.OBEXSessionNotifierImpl.acceptAndOpen(OBEXSessionNotifierImpl.java:79)
04-04 10:30:27.324: W/System.err(21593):     at de.is04.telemedic.connector.connectionmanager.BluecoveOBEXBTManager.connect(BluecoveOBEXBTManager.java:100)
04-04 10:30:27.332: W/System.err(21593):     at de.is04.telemedic.activity.MeasureActivity$5.onClick(MeasureActivity.java:268)
04-04 10:30:27.335: W/System.err(21593):     at android.view.View.performClick(View.java:2538)
04-04 10:30:27.339: W/System.err(21593):     at android.view.View$PerformClick.run(View.java:9152)
04-04 10:30:27.343: W/System.err(21593):     at android.os.Handler.handleCallback(Handler.java:587)
04-04 10:30:27.343: W/System.err(21593):     at android.os.Handler.dispatchMessage(Handler.java:92)
04-04 10:30:27.343: W/System.err(21593):     at android.os.Looper.loop(Looper.java:123)
04-04 10:30:27.347: W/System.err(21593):     at android.app.ActivityThread.main(ActivityThread.java:3687)
04-04 10:30:27.347: W/System.err(21593):     at java.lang.reflect.Method.invokeNative(Native Method)
04-04 10:30:27.347: W/System.err(21593):     at java.lang.reflect.Method.invoke(Method.java:507)
04-04 10:30:27.347: W/System.err(21593):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
04-04 10:30:27.347: W/System.err(21593):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
04-04 10:30:27.351: W/System.err(21593):     at dalvik.system.NativeStart.main(Native Method)
04-04 10:30:37.375: D/BTServer(21593): OBEX Server finished!
BluecoveOBEXBTManager.java

Mina Shokry

unread,
Apr 5, 2012, 3:57:54 AM4/5/12
to bluecov...@googlegroups.com
Hello,

First, you donèt have to rewrite the the whole JNI code. You can take the existing code and try to debug it and find why it doesn't work. I guess it can a permission problem but I am not sure of that. Bluetooth socket permissions on android aren't same like standard linux. This is a reported issue against android and I don't think they might fix it.

Because of missing APIs on android bluetooth APIs, bluecove-android implementation can't detect if a discovered service is an obex one or just a btspp. So, as a work around, you need to set the property "PROPERTY_ANDROID_OBEX_UUIDS" with UUIDs, so, if the implementation used any of these UUIDs for discovering a service, it will return a connection string starting with btgeop instead of btspp. This isn't related to having an obex server.

I guess there is another reason for your problem that you are trying to create a service with UUID 0x1105 which is the standard UUID for obex object push and the phone already has a service registered with this UUID (The standard service on the phone that can receive files). Try creating your service with another UUID. I know this will make it non-standard..... But can we do?

Regards,
Mina.

Ivan Lukic

unread,
Apr 5, 2012, 5:28:39 AM4/5/12
to bluecov...@googlegroups.com
Hi Mina,

Nice to hear from you :)

Thank you for your time.

First, you donèt have to rewrite the the whole JNI code. You can take the existing code and try to debug it and find why it doesn't work. I guess it can a permission problem but I am not sure of that. Bluetooth socket permissions on android aren't same like standard linux. This is a reported issue against android and I don't think they might fix it.

I saw that post, I am not sure either if that applies here. Debugging this is definitely useful, but it will have to be done in my free time, since it was decided to make simple workaround.
I am still curios about that, that JNI project is done with VS 6.0, right?
Another thing (I am not very experienced with JNI/Android), that C/C++ code actually represents driver for my phone's Bluetooth chip, right?


Because of missing APIs on android bluetooth APIs, bluecove-android implementation can't detect if a discovered service is an obex one or just a btspp. So, as a work around, you need to set the property "PROPERTY_ANDROID_OBEX_UUIDS" with UUIDs, so, if the implementation used any of these UUIDs for discovering a service, it will return a connection string starting with btgeop instead of btspp. This isn't related to having an obex server.

I guess there is another reason for your problem that you are trying to create a service with UUID 0x1105 which is the standard UUID for obex object push and the phone already has a service registered with this UUID (The standard service on the phone that can receive files). Try creating your service with another UUID. I know this will make it non-standard..... But can we do?

This is funny, because I used setting of those properties, and the problem is that I am also trying to replace inbuilt android obex server, so I guess I must use 0x1105.
I need to accept files in my application, and while it is possible to do so with Bluecove on PC, the same code doesn't work on android.
As it is possible to see in those logs, connection string is always null when I retrieve it, regardless what UUID I use.

Regards,
Ivan


Mina Shokry

unread,
Apr 5, 2012, 5:42:04 AM4/5/12
to bluecov...@googlegroups.com
Hmm,
In normal cases you can't stop the obex server installed on phone by default. Even if you could do it someway on your phone, you can release an application for public that does that. You have to think another way. for the null connection string, if you feel you are correctly follow JSR82 and bluecove-android2 doesn't work correctly, file an issue with a minimum sample code that produces it and I'll look at it when I have time. If you want to make things faster, you can debug and fix it yourself and you are welcome to contribute a patch for us :)

Ivan Lukic

unread,
Apr 5, 2012, 6:50:51 AM4/5/12
to bluecov...@googlegroups.com
Hi Mina,

This does sound like interesting proposal.
I would love to help.
There is one thing, since I have no clue about maven, and it seems to me that configuring it might be very time consuming I would like to avoid that (unless, you are confident it's not like that).
In order to debug your code, I thought I can find some .jar file with source files included in it.
Is there easier way to include bluecove source code in project, other than using maven?

Then, yes, I could give it a try to figure out what really went wrong.

Regards,
Ivan

Mina Shokry

unread,
Apr 5, 2012, 7:05:23 AM4/5/12
to bluecov...@googlegroups.com
Hello,

Well, I can't much help you with maven. I am not a maven expert. I just can survive with it.

All code of bluecove exists on the svn repository of the project http://code.google.com/p/bluecove/source/checkout check it out, create a project in your favorite IDE, and start using and debugging it.

Regards,
Mina.

Ivan Lukic

unread,
Apr 5, 2012, 7:55:22 AM4/5/12
to bluecov...@googlegroups.com
Guess making that .jar with sources is a way to start :)

Regards,
Ivan
Reply all
Reply to author
Forward
0 new messages