BlueCove on Android

2,980 views
Skip to first unread message

Mina Shokry

unread,
Aug 14, 2009, 7:44:32 AM8/14/09
to bluecove-...@googlegroups.com, bluecov...@googlegroups.com
Hi all,

Bluecove now supports android.

to use bluecove on android do the following
  1. Include latest bluecove-<...>.jar and bluecove-gpl-<...>.jar in classpath (for now, use the snapshot not the latest released version). (you may want to modify these libraries by removing all native libraries from them as android native library will be packaged in another way and these native libraries will create uneeded additional size to the android app and won't be removed by dx compiler).
  2. If you are using eclipse, create a directory libs/armeabi under the project root and put attached libbluecove.so inside it to be packaged with the resulted android package. (if you are using other tools, make sure resulted .apk package includes directory lib/armeabi and libbluecove.so is inside it). (take care, inside project directory named "libs" and inside .apk is named "lib").
  3. Use standard JSR-82 APIs just normal.
Note that: This won't work on emulators as emulators don't support bluetooth and this reported not to work on Samsung Galaxy I7500 and HTC Hero. If anyone could make this running, it will be nice to have this contribution published.

to build bluecove for android yourself refer to http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672
libbluecove.so

Shawn

unread,
Sep 3, 2009, 6:03:52 AM9/3/09
to bluecove-developers
Hi,

I have a problem -- No JNI_OnLoad found.

/dalvikvm( 3297): No implementation found for native
Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()Z
D/dalvikvm( 3297): Trying to load lib
/data/data/com.example.android.helloactivity/lib/libbluecove.so
0x430c70b0
D/dalvikvm( 3297): Added shared lib
/data/data/com.example.android.helloactivity/lib/libbluecove.so
0x430c70b0
D/dalvikvm( 3297): No JNI_OnLoad found in
/data/data/com.example.android.helloactivity/lib/libbluecove.so
0x430c70b0
D/dalvikvm( 3297): +++ not scanning '/system/lib/libwebcore.so' for
'getLibraryVersionNative' (wrong CL)
D/dalvikvm( 3297): +++ not scanning '/system/lib/libmedia_jni.so' for
'getLibraryVersionNative' (wrong CL)
D/dalvikvm( 3297): +++ not scanning '/system/lib/libwebcore.so' for
'isNativeCodeLoaded' (wrong CL)
D/dalvikvm( 3297): +++ not scanning '/system/lib/libmedia_jni.so' for
'isNativeCodeLoaded' (wrong CL)
D/dalvikvm( 3297): +++ not scanning '/system/lib/libwebcore.so' for
'nativeGetDeviceID' (wrong CL)
D/dalvikvm( 3297): +++ not scanning '/system/lib/libmedia_jni.so' for
'nativeGetDeviceID' (wrong CL)

Androbex runs fine on my Google IO handset (like the MyTouch), so this
is not the same problem you have on the hero or galaxy.

JNI_OnLoad looks like it is in intelbth.cpp ()

FYI, I'm building my android app under eclipse which is running on
OSX. JNI_OnLoad is also in OSXStack.mm

I don't think that it should matter that I am building it on OSX but
just mentioned it as I saw OSXStack when I went looking for
JNI_OnLoad.

Any suggestions?

Shawn

unread,
Sep 3, 2009, 7:45:10 PM9/3/09
to bluecove-developers
Hi,

Here is a little more information.

> /dalvikvm( 3297): No implementation found for native
> Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()Z
> D/dalvikvm( 3297): Trying to load lib
> /data/data/com.example.android.helloactivity/lib/libbluecove.so
> 0x430c70b0
> D/dalvikvm( 3297): Added shared lib
> /data/data/com.example.android.helloactivity/lib/libbluecove.so
> 0x430c70b0
> D/dalvikvm( 3297): No JNI_OnLoad found in
> /data/data/com.example.android.helloactivity/lib/libbluecove.so
> 0x430c70b0
>
> Androbex runs fine on my Google IO handset (like the MyTouch), so this
> is not the same problem you have on the hero or galaxy.

The project I'm trying to get this working for is http://lejos.sourceforge.net/
We use bluecove on OSX, Windows and Linux to connect to our Lego
robots. I'm using the same code we use to connect with those.

Maybe our code makes different calls that Androbex and that is why
there is a problem. I am not a good programmer but some people in our
project are, and you are so hopeful we can get this to work.

Anyway, our code which runs fine for OSX, Windows and Linux fails for
Android. Is that because of the Android implementation on the handset
is incomplete or because libbluecove.so needs to be changed. Is there
anything we can do on our projects side?

Can you guess from the error I got. Sorry to not know bluetooth very
well. Thank you very much for your work. Our project appreciates
your time!!!!

Shawn

Shawn

unread,
Sep 4, 2009, 3:17:28 AM9/4/09
to bluecove-developers

> > D/dalvikvm( 3297): No JNI_OnLoad found in
> > /data/data/com.example.android.helloactivity/lib/libbluecove.so
> > 0x430c70b0

Maybe it's not implimented in libbluetooth.so

This thread
http://groups.google.com/group/android-developers/browse_thread/thread/d80b1157cda06a79/7f6a3fee79713011
suggests to

implement this JNI_OnLoad() in following way:
/*-------------------------------------------
* do nothing but return the version of JNI
-------------------------------------------*/
JNIEXPORT jint JNICALL
JNI_OnLoad (JavaVM * vm, void * reserved)
{

return JNI_VERSION_1_6;
}

What file do I do that in though. I'll try to implement it and
rebuild libbluetooth.so

Any suggestions are welcome.

Shawn

Mina Shokry

unread,
Sep 4, 2009, 7:23:50 PM9/4/09
to bluecove-...@googlegroups.com
AFAIK, not implementing a JNI_OnLoad causes a warning or just a trace message not an error.
if you want to implement it, I think returning JNI_VERSION_1_5 may be better because AFAIK android is compatible with java 5 not 6.

but anyway, bluecove works on android without a change as you see in Androbex.

If you can not run bluecove on android, you probably have a different problem.
if you suspect a wrong native library is loaded, review what System.getProperty() returns for these properties on your phone ("os.name", "os.arch", and "java.runtime.name").
bluecove uses these properties to select one of native libraries to load.

are you trying to run a server on the android phone? I think it isn't possible because of a bug in the android platform. see this, http://code.google.com/p/android/issues/detail?id=2537

you can implement a workaround easily as described in the issue detail, but your phone need to be rooted!

Shawn

unread,
Sep 4, 2009, 8:43:34 PM9/4/09
to bluecove-developers


Hi Mina,

Thanks for your time.
> AFAIK, not implementing a JNI_OnLoad causes a warning or just a trace
> message not an error.

You are right. Androbex gives the same warning but works great!

No JNI_OnLoad found in /data/data/com.androbex.activity/lib/
libbluecove.so 0x430c7270
I/System.out( 5879): BlueCove version 2.1.1-SNAPSHOT on bluez
I/System.out( 5879): BlueCove version 2.1.1-SNAPSHOT on bluez

> 1. Include latest bluecove-<...>.jar and bluecove-gpl-<...>.jar in
classpath

How did you do that? In eclipse, I just put those libraries in the
build path.
I never saw I/System.out( 5879): BlueCove version 2.1.1-SNAPSHOT on
bluez in my app.
Am I not including the jars correctly?

> if you suspect a wrong native library is loaded, review

("os.name",
"os.arch",
"java.runtime.name").

I/System.out( 6272): Linux
I/System.out( 6272): OS_ARCH
I/System.out( 6272): Android Runtime

OS_ARCH looks a little funny to me but ...

> bluecove uses these properties to select one of native libraries to load.
>
> are you trying to run a server on the android phone? I think it isn't
> possible because of a bug in the android platform. see this,http://code.google.com/p/android/issues/detail?id=2537

No I am not.

For some reason the code that works under Linux,Windows and OSX fails
to make a connection. I'll try to debug why. I suspect either:

1) my android build isn't setting up the Bluecove jars correctly
or
2) our code to make a connection is not telling the android where to
find the jars
or
3) OS_ARCH is not right

Any thoughts? Thanks alot for your input!!! It is appreciated.

Shawn

unread,
Sep 4, 2009, 11:00:37 PM9/4/09
to bluecove-developers
Hi Mina,

I think your work looks fine. I expect Bluecove to work on Android.

Right now my app is throwing some error due to our looging.

E/dalvikvm( 7139): Could not find method
org.apache.log4j.Logger.getLogger, referenced from method
com.intel.bluetooth.DebugLog4jAppender.<init>

I working on this now and will let you know if it resolves everything.

Thanks again for your work and help!

Shawn

Mina Shokry

unread,
Sep 6, 2009, 5:06:26 PM9/6/09
to bluecove-...@googlegroups.com
Hi Shawn,

these 3 properties returns as expected on android.
OS_ARCH is a known bug on android. I think it is fixed and the fix will be ready in next android releases.

the problem of Log4j is because your are trying to compile bluecove on android. this isn't supported yet.

compile bluecove separately and take resulted jars (or use ready made jars) and include them in your android application.

Paco Quinhoy Garcia

unread,
Oct 24, 2009, 1:22:49 PM10/24/09
to bluecove-developers

Hello,

I had the same problem as Shawn with the Log4j. Now I've downloaded
the log4j.jar (version 1.2.15), I copied this file to my jre/lib/ext
folder and to the system/framework folder on the android phone. I also
put a reference to this library on my Eclipse project. After that, I
don't get the previous error, but when my application executes the
LocalDevice.getLocalDevice() method, it breaks without exception. Here
is the logcat information:

10-24 19:12:43.302: INFO/System.out(920): BlueCove log redirected to
log4j
10-24 19:12:43.332: WARN/System.err(920): log4j:WARN No appenders
could be found for logger (com.intel.bluetooth).
10-24 19:12:43.342: WARN/System.err(920): log4j:WARN Please initialize
the log4j system properly.
10-24 19:12:43.402: DEBUG/dalvikvm(920): +++ not scanning '/system/lib/
libwebcore.so' for 'isNativeCodeLoaded' (wrong CL)
10-24 19:12:43.412: DEBUG/dalvikvm(920): +++ not scanning '/system/lib/
libmedia_jni.so' for 'isNativeCodeLoaded' (wrong CL)
10-24 19:12:43.412: WARN/dalvikvm(920): No implementation found for
native Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()
Z
10-24 19:12:43.492: DEBUG/dalvikvm(920): Trying to load lib /system/
lib/libbluecove.so 0x434fb6c0
10-24 19:12:43.652: INFO/DEBUG(31): *** *** *** *** *** *** *** ***
*** *** *** *** *** *** *** ***
10-24 19:12:43.652: INFO/DEBUG(31): Build fingerprint: 'tmobile/kila/
dream/trout:1.1/PLAT-RC33/126986:user/ota-rel-keys,release-keys'
10-24 19:12:43.652: INFO/DEBUG(31): pid: 920, tid: 920 >>>
middleware_android.bluetooth <<<
10-24 19:12:43.652: INFO/DEBUG(31): signal 11 (SIGSEGV), fault addr
01c16ab0
10-24 19:12:43.662: INFO/DEBUG(31): r0 00000000 r1 01c16ab0 r2
00000000 r3 00000000
10-24 19:12:43.662: INFO/DEBUG(31): r4 b0016ad0 r5 b0016ac4 r6
b0016a14 r7 80400f2c
10-24 19:12:43.662: INFO/DEBUG(31): r8 4112a438 r9 000000f4 10
416903fc fp 00002071
10-24 19:12:43.662: INFO/DEBUG(31): ip 00000000 sp bee9b428 lr
b00003ad pc b00003b4 cpsr 00000030
10-24 19:12:43.752: INFO/DEBUG(31): #00 pc b00003b4 /system/
bin/linker
10-24 19:12:43.752: INFO/DEBUG(31): #01 pc b0000fb8 /system/
bin/linker
10-24 19:12:43.752: INFO/DEBUG(31): #02 pc b000108a /system/
bin/linker
10-24 19:12:43.762: INFO/DEBUG(31): #03 pc b0001510 /system/
bin/linker
10-24 19:12:43.762: INFO/DEBUG(31): #04 pc b00017c4 /system/
bin/linker
10-24 19:12:43.772: INFO/DEBUG(31): #05 pc b0001850 /system/
bin/linker
10-24 19:12:43.772: INFO/DEBUG(31): #06 pc b0001a60 /system/
bin/linker
10-24 19:12:43.772: INFO/DEBUG(31): #07 pc 000428b6 /system/
lib/libdvm.so
10-24 19:12:43.782: INFO/DEBUG(31): #08 pc 00058996 /system/
lib/libdvm.so
10-24 19:12:43.782: INFO/DEBUG(31): #09 pc 00029430 /system/
lib/libdvm.so
10-24 19:12:43.792: INFO/DEBUG(31): #10 pc 00017610 /system/
lib/libdvm.so
10-24 19:12:43.792: INFO/DEBUG(31): #11 pc 00052268 /system/
lib/libdvm.so
10-24 19:12:43.792: INFO/DEBUG(31): #12 pc 000596ee /system/
lib/libdvm.so
10-24 19:12:43.802: INFO/DEBUG(31): #13 pc 00013118 /system/
lib/libdvm.so
10-24 19:12:43.802: INFO/DEBUG(31): #14 pc 00017b1c /system/
lib/libdvm.so
10-24 19:12:43.802: INFO/DEBUG(31): #15 pc 00017560 /system/
lib/libdvm.so
10-24 19:12:43.812: INFO/DEBUG(31): #16 pc 000520ec /system/
lib/libdvm.so
10-24 19:12:43.812: INFO/DEBUG(31): #17 pc 0003f0f8 /system/
lib/libdvm.so
10-24 19:12:43.822: INFO/DEBUG(31): #18 pc 00029600 /system/
lib/libandroid_runtime.so
10-24 19:12:43.822: INFO/DEBUG(31): #19 pc 0002a0fe /system/
lib/libandroid_runtime.so
10-24 19:12:43.822: INFO/DEBUG(31): #20 pc 00008bf2 /system/
bin/app_process
10-24 19:12:43.833: INFO/DEBUG(31): #21 pc 0001fd22 /system/
lib/libc.so
10-24 19:12:43.833: INFO/DEBUG(31): #22 pc 0000bcb2 /system/
lib/libc.so
10-24 19:12:43.842: INFO/DEBUG(31): #23 pc b000157e /system/
bin/linker
10-24 19:12:43.842: INFO/DEBUG(31): stack:
10-24 19:12:43.842: INFO/DEBUG(31): bee9b3e8 0006d8b5 [heap]
10-24 19:12:43.842: INFO/DEBUG(31): bee9b3ec b0001009 /system/
bin/linker
10-24 19:12:43.842: INFO/DEBUG(31): bee9b3f0 bee9b484 [stack]
10-24 19:12:43.842: INFO/DEBUG(31): bee9b3f4 bee9b44c [stack]
10-24 19:12:43.852: INFO/DEBUG(31): bee9b3f8 00000012
10-24 19:12:43.852: INFO/DEBUG(31): bee9b3fc ae902a94 /system/
lib/libbluetooth.so
10-24 19:12:43.852: INFO/DEBUG(31): bee9b400 b0013448
10-24 19:12:43.852: INFO/DEBUG(31): bee9b404 00000106
10-24 19:12:43.852: INFO/DEBUG(31): bee9b408 ae90198c /system/
lib/libbluetooth.so
10-24 19:12:43.852: INFO/DEBUG(31): bee9b40c b000108f /system/
bin/linker
10-24 19:12:43.852: INFO/DEBUG(31): bee9b410 00000dec
10-24 19:12:43.862: INFO/DEBUG(31): bee9b414 b000d824 /system/
bin/linker
10-24 19:12:43.862: INFO/DEBUG(31): bee9b418 b0017f5c
10-24 19:12:43.862: INFO/DEBUG(31): bee9b41c 00705aac
10-24 19:12:43.862: INFO/DEBUG(31): bee9b420 df002777
10-24 19:12:43.862: INFO/DEBUG(31): bee9b424 e3a070ad
10-24 19:12:43.862: INFO/DEBUG(31): #00 bee9b428 8040135b /system/
lib/libbluecove.so
10-24 19:12:43.862: INFO/DEBUG(31): bee9b42c 804004ac /system/
lib/libbluecove.so
10-24 19:12:43.862: INFO/DEBUG(31): bee9b430 b00134a4
10-24 19:12:43.862: INFO/DEBUG(31): bee9b434 b0013448
10-24 19:12:43.872: INFO/DEBUG(31): bee9b438 8040135b /system/
lib/libbluecove.so
10-24 19:12:43.872: INFO/DEBUG(31): bee9b43c b0016a14
10-24 19:12:43.872: INFO/DEBUG(31): bee9b440 00705aac
10-24 19:12:43.872: INFO/DEBUG(31): bee9b444 b0000fbd /system/
bin/linker
10-24 19:12:43.872: INFO/DEBUG(31): #01 bee9b448 4112a438
10-24 19:12:43.872: INFO/DEBUG(31): bee9b44c bee9b4a4 [stack]
10-24 19:12:43.872: INFO/DEBUG(31): bee9b450 ae90f000
10-24 19:12:43.882: INFO/DEBUG(31): bee9b454 804024f4 /system/
lib/libbluecove.so
10-24 19:12:43.882: INFO/DEBUG(31): bee9b458 b0013448
10-24 19:12:43.882: INFO/DEBUG(31): bee9b45c 00000001
10-24 19:12:43.882: INFO/DEBUG(31): bee9b460 80400f2c /system/
lib/libbluecove.so
10-24 19:12:43.882: INFO/DEBUG(31): bee9b464 b000108f /system/
bin/linker
10-24 19:12:44.612: INFO/WindowManager(57): WIN DEATH: Window{437446d8
middleware_android.bluetooth/
middleware_android.bluetooth.activity_middleware paused=false}
10-24 19:12:44.612: INFO/ActivityManager(57): Process
middleware_android.bluetooth (pid 920) has died.
10-24 19:12:44.622: DEBUG/Zygote(33): Process 920 terminated by signal
(11)
10-24 19:12:44.682: WARN/InputManagerService(57): Got RemoteException
sending setActive(false) notification to pid 920 uid 10033


Any idea to solve this?

Thanks.

Mina Shokry

unread,
Oct 24, 2009, 1:58:41 PM10/24/09
to bluecove-...@googlegroups.com
you don't need to deal with log4j.

just compile bluecove normally (using standard java tools not android-sdk) or use a prebuilt snapshot (found here http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/), use the resulted library in your application with the attached native library (or build the native library yourself if you'd like) and this should work.

Paco Quinhoy Garcia

unread,
Oct 25, 2009, 6:25:49 AM10/25/09
to bluecove-developers

I'm already using the bluecove-gpl and bluecove SNAPSHOT jars.

On 24 oct, 18:58, Mina Shokry <minasho...@gmail.com> wrote:
> you don't need to deal with log4j.
>
> just compile bluecove normally (using standard java tools not android-sdk)
> or use a prebuilt snapshot (found herehttp://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/), use the

Paco Quinhoy Garcia

unread,
Oct 25, 2009, 8:51:39 AM10/25/09
to bluecove-developers

I try to find the problem by adding the bluecove sources to my
project and it seems to be a problem with the library loading
(libbluetooth.so), but I´m not sure of this. I put this library in a
folder libs/armeabi in my project as you indidcate in the first post
and I put both jars (bluecove-2.1.1-SNAPSHOT and bluecove-gpl-2.1.1-
SNAPSHOT) in the folder system/framework of the phone. Is the file
bluecove-bluez.jar also needed?

I am desperate with this issue, I need it for my projects at work.
Thanks for your time.

On 25 oct, 11:25, Paco Quinhoy Garcia <fquinhoygar...@gmail.com>

Mina Shokry

unread,
Oct 25, 2009, 9:47:31 AM10/25/09
to bluecove-...@googlegroups.com
On Sun, Oct 25, 2009 at 2:51 PM, Paco Quinhoy Garcia <fquinho...@gmail.com> wrote:


 I try to find the problem by adding the bluecove sources to my
project and it seems to be a problem with the library loading
(libbluetooth.so), but I´m not sure of this.
Adding bluecove sources to your project will result in problems you talked about of log4j. Use precompiled jars.
 
I put this library in a folder libs/armeabi in my project as you indidcate in the first post
and I put both jars (bluecove-2.1.1-SNAPSHOT and bluecove-gpl-2.1.1-
SNAPSHOT) in the folder system/framework of the phone.
I never tried this. may be this is the problem because bluecove jars you are using are built for standard VM which isn't case in android (android doesn't execute standard .class files)

Instead, include these jars in the project to let (.class) files inside them be recompiled with android dx tool and merged with your classes inside one classes.dex file of your application. This should work.

Then be sure that the resulted package contains the native library correctly as I described in the first post.

Is the file bluecove-bluez.jar also needed?
No it isn't needed.
 

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 6:49:22 AM10/26/09
to bluecove-developers

I don't understand.

> Instead, include these jars in the project to let (.class) files
inside them
> be recompiled with android dx tool and merged with your classes inside one
> classes.dex file of your application. This should work.

As I said previously, I included these jars (the snapshots) as
references in my eclipse project (this is the way I can use it in my
code) and I create a libs/armeabi folder in the root of the project to
include the libbluecove.so as you indicate previosuly. That was my
fist attempt and it doesn't work.

> Then be sure that the resulted package contains the native library correctly
> as I described in the first post.

How can I view the content of an apk file?

Thanks.

On 25 oct, 14:47, Mina Shokry <minasho...@gmail.com> wrote:
> On Sun, Oct 25, 2009 at 2:51 PM, Paco Quinhoy Garcia <
>
> ...
>
> leer más »

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 6:53:59 AM10/26/09
to bluecove-developers

Ok, I can view the content of the resultant apk with winrar, and the
folder lib/armeabi contains the libbluecove.so. Is there any method to
check if the classes.dex contains the .jars of the SNAPSHOTS?


On 26 oct, 11:49, Paco Quinhoy Garcia <fquinhoygar...@gmail.com>
> ...
>
> leer más »

Mina Shokry

unread,
Oct 26, 2009, 7:07:26 AM10/26/09
to bluecove-...@googlegroups.com
if you are on linux (and may be Mac) you can execute this command
dexdump -h <your classes.dex file> | grep 'Class descriptor' > ~/classes_list.txt

this will printout class names to classes_list.txt

on windows, use dexdump and read the result yourself!

Shawn Brown

unread,
Oct 26, 2009, 7:20:43 AM10/26/09
to bluecove-...@googlegroups.com
> 10-24 19:12:43.302: INFO/System.out(920): BlueCove log redirected to
> log4j
> 10-24 19:12:43.332: WARN/System.err(920): log4j:WARN No appenders
> could be found for logger (com.intel.bluetooth).
> 10-24 19:12:43.342: WARN/System.err(920): log4j:WARN Please initialize
> the log4j system properly.
> 10-24 19:12:43.402: DEBUG/dalvikvm(920): +++ not scanning '/system/lib/
> libwebcore.so' for 'isNativeCodeLoaded' (wrong CL)
> 10-24 19:12:43.412: DEBUG/dalvikvm(920): +++ not scanning '/system/lib/
> libmedia_jni.so' for 'isNativeCodeLoaded' (wrong CL)
> 10-24 19:12:43.412: WARN/dalvikvm(920): No implementation found for
> native Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()
> Z
> 10-24 19:12:43.492: DEBUG/dalvikvm(920): Trying to load lib /system/
> lib/libbluecove.so 0x434fb6c0

That all looks normal to me. I got the same "no implementation found
..." error but it ran fine.

> 10-24 19:12:43.652: INFO/DEBUG(31): *** *** *** *** *** *** *** ***
> *** *** *** *** *** *** *** ***
> 10-24 19:12:43.652: INFO/DEBUG(31): Build fingerprint: 'tmobile/kila/
> dream/trout:1.1/PLAT-RC33/126986:user/ota-rel-keys,release-keys'
> 10-24 19:12:43.652: INFO/DEBUG(31): pid: 920, tid: 920  >>>

That is a native code crash I believe.

>I included these jars (the snapshots) as
references in my eclipse project (this is the way I can use it in my
code)

This means the jars are in your build path correct?

Shawn

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 7:48:06 AM10/26/09
to bluecove-developers

> This means the jars are in your build path correct?

I don't understand this. I included these .jars as references in my
eclipse project, by project properties->java build path->libraries-
>add external jars. Both libraries are in a folder named d:\bluecove
in my pc. Do you mean that I need to copy these jars in any other
folder?

Shawn Brown

unread,
Oct 26, 2009, 7:52:41 AM10/26/09
to bluecove-...@googlegroups.com
> I don't understand this. I included these .jars as references in my
> eclipse project, by project properties->java build path->libraries-
>>add external jars.

That is fine then.

In Eclipse you can "reference" a project but that doesn't mean the
jars from the project are in the build path. I thought maybe you did
this, but you didn't.

You have added the jars to your build path so that is fine.

Shawn

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 8:20:24 AM10/26/09
to bluecove-developers

I checked the classes included in the dex file, and it seems to be
correct. The class LocalDevice which terminates my application is
included. Any idea?

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 9:54:44 AM10/26/09
to bluecove-developers

One more idea: I put the libbluecove.so file in the libs/armeabi
folder on my project root, but there is another libbluecove.so inside
the bluecove-gpl-2.1.1-SNAPSHOT.jar file. Is it correct? Is it a
possible problem?

On 26 oct, 13:20, Paco Quinhoy Garcia <fquinhoygar...@gmail.com>
wrote:

Paco Quinhoy Garcia

unread,
Oct 26, 2009, 10:27:09 AM10/26/09
to bluecove-developers

Finally!! I get it working. I followed the hint of the native crash
and the library libbluecove.so. I found that I had a libbluecove.so on
the folder system/lib of my phone. I deleted it and now it works!

Thanks Shawn and Mina for your help and your time, I really
appreciate it.

On 26 oct, 14:54, Paco Quinhoy Garcia <fquinhoygar...@gmail.com>

keling

unread,
Nov 8, 2009, 6:09:51 PM11/8/09
to bluecove-developers
Hi,

I had some problems like:

1. When i use the setDiscoverable() method to change to discoverable,
i got this
"Bluetooth Device is not ready. [1] Operation not permitted"
exception.
2. When i use this "notifier = (L2CAPConnectionNotifier)Connector.open
(url);", i got an exception:
"Can not open SDP session. [13] Permission denied".

Is this normal for the 1.6?
I'm a beginner of bluetooth programming.
I don't understand the second exception.
why when i create the connection of l2cap, i got a permission denied
for SDP session?
L2cap work on low level than SDP, why i need open a SDP session for my
l2cap connection?

ps: For discovery devices, it function well.

Thanks so much.

htcdude

unread,
Nov 8, 2009, 7:25:38 PM11/8/09
to bluecove-...@googlegroups.com

Hi,

The SDP problem has been covered in another thread last week.

Hank

--~--~---------~--~----~------------~-------~--~----~ You received this message because you are sub...

Mina Shokry

unread,
Nov 8, 2009, 7:28:45 PM11/8/09
to bluecove-...@googlegroups.com
Hello,

the first exception is because changing discovery state on bluez requires root permissions that your application doesn't have.

the second exception is because you are trying to open a server connection, opening a server connection includes adding a record using SDP to make your service discoverable to clients. this is a bug in android framework! there are wrong permissions on bluetooth socket and so, opeing server connections isn't supported unless you have root permissions and fix bluetooth socket permissions yourself before trying to open a server connection.

htcdude

unread,
Nov 8, 2009, 10:43:27 PM11/8/09
to bluecove-developers
Hi Mina,

Do you know if there's a quick fix for changing the discovery state?
There was a quick fix for the SDP permission problem in the link that
you provided in the other thread ... just change something in init.rc.
I wonder whether something similar is possible that will fix discovery
state permissions, too.

Note that Android 2.0 allows apps to change discovery state, so it
can't be a fundamental problem.

Cheers

Hank

Mina Shokry

unread,
Nov 9, 2009, 3:22:26 AM11/9/09
to bluecove-...@googlegroups.com
The key to this is to make your application run in root mode! I don't know if it is possible. It may be possible if you run a patched android image that run all apps in root mode. Do some search on xda-developers.com

htcdude

unread,
Nov 9, 2009, 6:17:43 AM11/9/09
to bluecove-developers
Sorry but Android 2.0 apps can change discoverable mode and I am sure
they are not running root.

I guess there must be some permission change that enables this. I'll
keep looking.

htcdude

unread,
Nov 9, 2009, 7:43:36 AM11/9/09
to bluecove-developers
FYI I used this temporary hack

http://blag.tsukasa.net.au/2009/08/25/always-discoverable-on-android/

to make my device permanently discoverable. Better always discoverable
than never, at least I can now continue to develop apps that rely on
being discoverable until I find a more permanent solution. I'll keep
you posted.

On Nov 9, 7:22 pm, Mina Shokry <minasho...@gmail.com> wrote:

ARUN RAJ

unread,
Apr 7, 2012, 8:25:35 AM4/7/12
to bluecove-...@googlegroups.com, bluecov...@googlegroups.com, vira...@gmail.com
Hi Minashokry
can you help me to develope bluetooth programming in java (Communication with two P.C with the help of dongles)

On Friday, 14 August 2009 17:14:32 UTC+5:30, minashokry wrote:
Hi all,

Bluecove now supports android.

to use bluecove on android do the following
  1. Include latest bluecove-<...>.jar and bluecove-gpl-<...>.jar in classpath (for now, use the snapshot not the latest released version). (you may want to modify these libraries by removing all native libraries from them as android native library will be packaged in another way and these native libraries will create uneeded additional size to the android app and won't be removed by dx compiler).
  2. If you are using eclipse, create a directory libs/armeabi under the project root and put attached libbluecove.so inside it to be packaged with the resulted android package. (if you are using other tools, make sure resulted .apk package includes directory lib/armeabi and libbluecove.so is inside it). (take care, inside project directory named "libs" and inside .apk is named "lib").
  3. Use standard JSR-82 APIs just normal.
Note that: This won't work on emulators as emulators don't support bluetooth and this reported not to work on Samsung Galaxy I7500 and HTC Hero. If anyone could make this running, it will be nice to have this contribution published.

to build bluecove for android yourself refer to http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672

On Friday, 14 August 2009 17:14:32 UTC+5:30, minashokry wrote:
Hi all,

Bluecove now supports android.

to use bluecove on android do the following
  1. Include latest bluecove-<...>.jar and bluecove-gpl-<...>.jar in classpath (for now, use the snapshot not the latest released version). (you may want to modify these libraries by removing all native libraries from them as android native library will be packaged in another way and these native libraries will create uneeded additional size to the android app and won't be removed by dx compiler).
  2. If you are using eclipse, create a directory libs/armeabi under the project root and put attached libbluecove.so inside it to be packaged with the resulted android package. (if you are using other tools, make sure resulted .apk package includes directory lib/armeabi and libbluecove.so is inside it). (take care, inside project directory named "libs" and inside .apk is named "lib").
  3. Use standard JSR-82 APIs just normal.
Note that: This won't work on emulators as emulators don't support bluetooth and this reported not to work on Samsung Galaxy I7500 and HTC Hero. If anyone could make this running, it will be nice to have this contribution published.

to build bluecove for android yourself refer to http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672

On Friday, 14 August 2009 17:14:32 UTC+5:30, minashokry wrote:
Hi all,

Bluecove now supports android.

to use bluecove on android do the following
  1. Include latest bluecove-<...>.jar and bluecove-gpl-<...>.jar in classpath (for now, use the snapshot not the latest released version). (you may want to modify these libraries by removing all native libraries from them as android native library will be packaged in another way and these native libraries will create uneeded additional size to the android app and won't be removed by dx compiler).
  2. If you are using eclipse, create a directory libs/armeabi under the project root and put attached libbluecove.so inside it to be packaged with the resulted android package. (if you are using other tools, make sure resulted .apk package includes directory lib/armeabi and libbluecove.so is inside it). (take care, inside project directory named "libs" and inside .apk is named "lib").
  3. Use standard JSR-82 APIs just normal.
Note that: This won't work on emulators as emulators don't support bluetooth and this reported not to work on Samsung Galaxy I7500 and HTC Hero. If anyone could make this running, it will be nice to have this contribution published.

to build bluecove for android yourself refer to http://groups.google.com/group/bluecove-developers/browse_thread/thread/6e32131d7c5b672

Mina Shokry

unread,
Apr 7, 2012, 6:57:22 PM4/7/12
to bluecove-...@googlegroups.com, vira...@gmail.com
Hello,

This group is for discussing development of bluecove itself. Not problems with using blueccove.

When you have problems with using bluecove, send an email to bluecove-users group. For your question to to be answered, try to be precise as much as you can and ask specific questions.

Regards,
Mina.

--
You received this message because you are subscribed to the Google
Groups "bluecove-developers" group.
For more options, visit this group at
http://groups.google.com/group/bluecove-developers

Rasheed

unread,
Sep 19, 2014, 7:01:52 AM9/19/14
to bluecove-...@googlegroups.com, bluecov...@googlegroups.com
Dear sir, As per ur post, I have used bluecove-2.1.1-SNAPSHOT.jar, bluecove-gpl-2.1.1-SNAPSHOT.jar and libbluecove.so are used in my android project and successfully send data to other mobiles. But now I need to search for services, and when this is done, it throws exception where I find LocalDevice. Got a a library bluecove-android2-2.1.1-20101024.214840-1.jar. But i have no idea on how to utilise it and can't proceed further. If u can, can u pls mail me a working example to my mail pls.. My mail id is : rash...@enexl.com. Thanks in advance..
Reply all
Reply to author
Forward
0 new messages