Android Bluecove build

2,123 views
Skip to first unread message

Dennis Munsie

unread,
Jun 22, 2009, 6:32:22 PM6/22/09
to Vlad Skarzhevskyy, bluecove-...@googlegroups.com
Ok --

I think I have the correct steps to build bluecove-svn for Android 1.5 -- since some of this was done over the past couple of weeks, there may be a few mistakes, but I think it should be good.

Here is what you'll need to do:

- setup your android build environment.  To build the native code, you will need to download the entire android build tree.  This is rather annoying, but there isn't a standalone toolchain at this time.  Follow the instructions at http://source.android.com/download.  But before you type make, you need to add the following line to build/target/board/generic/BoardConfig.mk:

BOARD_HAVE_BLUETOOTH := true

I also added that same line to build/target/board/emulator/BoardConfig.mk and build/target/board/sim/BoardConfig.mk , but I don't think that is necessary.

If you don't add this line, the build will not include any of the bluetooth code -- including libbluetooth.so

- install the 1.5 SDK -- instructions at http://developer.android.com/sdk/1.5_r2/index.html

- put the agcc script someplace in your PATH -- this is a wrapper around the toolchain that comes with the source from above and is necessary to build native code for android.  This script can be found at http://plausible.org/andy/agcc .

- apply the attached patches to bluecove and bluecove-gpl -- note to Vlad: the bluecove-svn.patch file contains the IBM j9 changes from the earlier patch i sent.  

- build bluecove with normal build procedure

- build bluecove-gpl with the build-android.sh script

You should have the two .jar files and the libbluecove.so file now if all went well.  If you don't, check the steps above and feel free to email me if you have any questions.

To actually use bluecove in an Android app, you need to do the following:

- copy the two jar files into the libs directory under your project.  If you don't have a libs directory, create it.

- copy the libbluecove.so file into a directory called armeabi under libs in your project directory.

- you also need to add one of these two permissions, possibly both, to your AndroidManifest.xml file for your project:
<uses-permission android:name="android.permission.BLUETOOTH"></uses-permission>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"></uses-permission>

BLUETOOTH is for connecting to devices that have already been paired in the bluetooth settings.  BLUETOOTH_ADMIN allows you to connect to any device -- paired or not.

please let me know if there are any questions.

dennis

On Mon, Jun 22, 2009 at 2:25 PM, Vlad Skarzhevskyy <skarzh...@gmail.com> wrote:
It does not matter to me what OS to use. The current build server has
Mac Leo, Win XP, Fedora 10-32 and Fedora 10-64x

More important is what Android stuff to take... I only tried building
the java code for Android. As to building a native libraries, this
still Terra incognita for me. I never even got a confirmation that
this can be done....

Vlad



On Mon, Jun 22, 2009 at 2:12 PM, Dennis Munsie<dmu...@gmail.com> wrote:
> on the dev phone, it is definitely verifying at runtime.  Those are the
> exact messages that come up when attempting to use the current way of
> calling the j9 methods.  We are currently in the process of obtaining a G1
> -- I will verify the behavior once we get that phone in.
> As for building, I am currently building under OS X -- I will try to help as
> much as I can on the Linux side, but it's been a while since I've used Linux
> as my development environment.
> As for the patch, the next patches will come from svn trunk instead.
> Thanks!
> dennis
> On Mon, Jun 22, 2009 at 1:55 PM, Vlad Skarzhevskyy <skarzh...@gmail.com>
> wrote:
>>
>> The approach is fine. Only send the difs in attachment and from the
>> main svn trunk.
>> Does Dalvik verify classes only at runtime?  I was under impression
>> that is is done during creation of the library.
>> If so we may need to define the J9 stuff as interfaces....
>>
>> Also would you be willing to help me to setup the build environment
>> for android  on the bluecove build server (Fedora 10 32 bit). So that
>> binary would be created for android  as well. We may install a
>> different  VMWare appliances for this.
>>
>> Vlad
>>
>>
>>
>> On Mon, Jun 22, 2009 at 1:41 PM, Dennis Munsie<dmu...@gmail.com> wrote:
>> > Hi --
>> > I am currently running stock 1.5 (cupcake) on a dev phone.  I managed to
>> > get
>> > the bluecove-gpl module compiled for android and then I had to make a
>> > few
>> > changes to the core library to get it up and running on a real phone.  I
>> > am
>> > using the BlueZ libraries directly since the dbus system bus is only
>> > available to root currently.
>> > Right now, I am sorting out which changes are necessary and how to
>> > integrate
>> > them into the codebase without breaking the code on other platforms.
>> >  The
>> > patch I currently have ready is below -- it's a workaround for the
>> > Dalvik VM
>> > to allow the verification to work.  Since the IBM j9 classes are not
>> > available on Android, the VM will throw this error when loading the
>> > class at
>> > runtime:
>> > E/dalvikvm(  887): Could not find method
>> > com.ibm.oti.vm.VM.addShutdownClass,
>> > referenced from method
>> > com.intel.bluetooth.UtilsJavaSE.runtimeAddShutdownHook
>> > W/dalvikvm(  887): VFY: unable to resolve static method 136:
>> > Lcom/ibm/oti/vm/VM;.addShutdownClass (Ljava/lang/Runnable;)V
>> > W/dalvikvm(  887): VFY:  rejecting opcode 0x71 at 0x0005
>> > W/dalvikvm(  887): VFY:  rejected
>> > Lcom/intel/bluetooth/UtilsJavaSE;.runtimeAddShutdownHook
>> > (Ljava/lang/Thread;)Z
>> > W/dalvikvm(  887): Verifier rejected class
>> > Lcom/intel/bluetooth/UtilsJavaSE;
>> > This fixes that issue by moving the 2 j9 specific calls into a helper
>> > class.
>> >  Since that class is never actually loaded on Dalvik, it doesn't attempt
>> > to
>> > verify that the j9 classes are there either.
>> > Please let me know if this is the preferred diff format -- I just used a
>> > diff -Naurp since I did not check out the code from SVN.  I am currently
>> > working off the current 2.1.0 source tarball instead.
>> > dennis
>> > -----------------------------------------------------------
>> > diff -Naurp
>> > bluecove-2.1.0/src/main/java/com/intel/bluetooth/IBMJ9Helper.java
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/IBMJ9Helper.java
>> > --- bluecove-2.1.0/src/main/java/com/intel/bluetooth/IBMJ9Helper.java
>> > 1969-12-31 19:00:00.000000000 -0500
>> > +++
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/IBMJ9Helper.java
>> > 2009-06-22 10:11:35.000000000 -0400
>> > @@ -0,0 +1,47 @@
>> > +/**
>> > + *  BlueCove - Java library for Bluetooth
>> > + *  Copyright (C) 2006-2008 Vlad Skarzhevskyy
>> > + *
>> > + *  Licensed to the Apache Software Foundation (ASF) under one
>> > + *  or more contributor license agreements.  See the NOTICE file
>> > + *  distributed with this work for additional information
>> > + *  regarding copyright ownership.  The ASF licenses this file
>> > + *  to you under the Apache License, Version 2.0 (the
>> > + *  "License"); you may not use this file except in compliance
>> > + *  with the License.  You may obtain a copy of the License at
>> > + *
>> > + *    http://www.apache.org/licenses/LICENSE-2.0
>> > + *
>> > + *  Unless required by applicable law or agreed to in writing,
>> > + *  software distributed under the License is distributed on an
>> > + *  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
>> > + *  KIND, either express or implied.  See the License for the
>> > + *  specific language governing permissions and limitations
>> > + *  under the License.
>> > + *
>> > + *  @author dmunsie
>> > + *  @version $Id$
>> > + */
>> > +package com.intel.bluetooth;
>> > +
>> > +import com.ibm.oti.vm.VM;
>> > +
>> > +import java.io.IOException;
>> > +
>> > +/**
>> > + *
>> > + * IBM J9 helper module.
>> > + *
>> > + * <p>
>> > + * <b><u>Your application should not use this class directly.</u></b>
>> > + */
>> > +public class IBMJ9Helper {
>> > +
>> > + public static synchronized void loadLibrary(String libname) throws
>> > IOException {
>> > + VM.loadLibrary(libname);
>> > + }
>> > +
>> > + public static void addShutdownClass(Runnable hook) {
>> > + VM.addShutdownClass(hook);
>> > + }
>> > +}
>> > diff -Naurp
>> > bluecove-2.1.0/src/main/java/com/intel/bluetooth/NativeLibLoader.java
>> >
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/NativeLibLoader.java
>> > ---
>> > bluecove-2.1.0/src/main/java/com/intel/bluetooth/NativeLibLoader.java
>> > 2008-12-24 11:58:34.000000000 -0500
>> > +++
>> >
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/NativeLibLoader.java
>> > 2009-06-22 10:05:34.000000000 -0400
>> > @@ -30,8 +30,6 @@ import java.io.IOException;
>> >  import java.io.InputStream;
>> >  import java.util.Hashtable;
>> >
>> > -import com.ibm.oti.vm.VM;
>> > -
>> >  /**
>> >   * Load native library from resources.
>> >   *
>> > @@ -226,7 +224,7 @@ public abstract class NativeLibLoader {
>> >
>> >   private static boolean tryloadIBMj9MIDP(String name) {
>> >   try {
>> > - VM.loadLibrary(name);
>> > + IBMJ9Helper.loadLibrary(name);
>> >   DebugLog.debug("Library loaded", name);
>> >   } catch (Throwable e) {
>> >   DebugLog.error("Library " + name + " not loaded ", e);
>> > @@ -253,7 +251,7 @@ public abstract class NativeLibLoader {
>> >
>> >   private static boolean tryloadPathIBMj9MIDP(String path, String name)
>> > {
>> >   try {
>> > - VM.loadLibrary(path + "\\" + name);
>> > + IBMJ9Helper.loadLibrary(path + "\\" + name);
>> >   DebugLog.debug("Library loaded", path + "\\" + name);
>> >   } catch (Throwable e) {
>> >   DebugLog.error("Can't load library from path " + path + "\\" + name,
>> > e);
>> > diff -Naurp
>> > bluecove-2.1.0/src/main/java/com/intel/bluetooth/UtilsJavaSE.java
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/UtilsJavaSE.java
>> > --- bluecove-2.1.0/src/main/java/com/intel/bluetooth/UtilsJavaSE.java
>> > 2008-12-24 11:58:34.000000000 -0500
>> > +++
>> > bluecove-2.1.0-ibm/src/main/java/com/intel/bluetooth/UtilsJavaSE.java
>> > 2009-06-22 10:09:08.000000000 -0400
>> > @@ -28,8 +28,6 @@ import java.security.PrivilegedActionExc
>> >  import java.util.Properties;
>> >  import java.util.Vector;
>> >
>> > -import com.ibm.oti.vm.VM;
>> > -
>> >  /**
>> >   *
>> >   * J2ME/J9 compatibility module.
>> > @@ -188,7 +186,7 @@ public class UtilsJavaSE {
>> >   // since Java 1.3
>> >   if (!javaSECompiledOut) {
>> >   if (ibmJ9midp) {
>> > - VM.addShutdownClass(thread);
>> > + IBMJ9Helper.addShutdownClass(thread);
>> >   return true;
>> >   } else {
>> >   Runtime.getRuntime().addShutdownHook(thread);
>> >
>> >
>> > On Mon, Jun 22, 2009 at 1:22 PM, Vlad Skarzhevskyy
>> > <skarzh...@gmail.com>
>> > wrote:
>> >>
>> >> Hi Dennis,
>> >>  It would be very interesting to know how you have done this. Is this
>> >> for Android cupcake or for your own version of Android firmware?
>> >>
>> >>  Definitely send the changes to the group I would add them to the
>> >> BlueCove main line.
>> >>
>> >>  If you wish to work directly with BlueCove SVN please send the
>> >> changes for review first. Once I see that changes are applicable and
>> >> you are reliable commiter you would be granted access to svn ....
>> >>
>> >>  Don't forget that any changes made to the common code should not
>> >> break existing functionality on other platforms.
>> >>
>> >> Vlad
>> >>
>> >>
>> >>
>> >> On Mon, Jun 22, 2009 at 12:19 PM, Dennis<dmu...@gmail.com> wrote:
>> >> > Hi --
>> >> >
>> >> > My name is Dennis Munsie -- I am a software engineer at a company
>> >> > that
>> >> > is very interested in making our device work with Android, and as
>> >> > such, I have been working on porting Bluecove to run atop Android and
>> >> > the Dalvik VM.  Currently, I am able to use our own proprietary
>> >> > library running atop Bluecove on the Android dev phone running within
>> >> > the standard Android sandbox without any root privileges.
>> >> >
>> >> > I currently have a patch that I would like to submit and I will be
>> >> > working on more over the next week as I go through and put proper
>> >> > fixes in place rather than the bandaids that I currently have
>> >> > employed
>> >> > to get things up and running.
>> >> >
>> >> > Thanks!
>> >> > dennis
>> >
>> >
>
>
>
> --
> dennis
>



--
dennis
bluecove-svn.patch
bluecove-gpl-svn.patch

Vlad Skarzhevskyy

unread,
Jun 23, 2009, 2:18:36 AM6/23/09
to Dennis Munsie, bluecove-...@googlegroups.com
Hi Dennis
Patch is applied, with no changes.

This is what I think. Since we create the file name libbluecove.so
for regular Linux 32 bit and for Android it may be confusing for
users and also would be a problematic for automated build to have two
files by the same name.

I would suggest to change the name to be consistent with other
"os.arch" driven names as I have for other systems. The
libbluecove_arm.so would be OK if Android was a standard Linux system.
So I suggest to have it named libbluecove_android_arm.so or
libbluecovea_arm.so. Now the System.getProperty("os.arch") has a bug
on Android and does not return a proper value.... I believe that
there would definitely be a Intel build of Android in a future so we
should come prepared.

Vlad

PS
Thanks for changing the subject.

Vlad Skarzhevskyy

unread,
Jun 29, 2009, 12:41:26 AM6/29/09
to Dennis Munsie, bluecove-...@googlegroups.com
Hi Dennis
 Last week Google made Native Development Tools available as NDK.
Can we use this toolchain by adding the bluez headers from source
distribution?

Vlad

Dennis Munsie

unread,
Jun 29, 2009, 12:04:29 PM6/29/09
to Vlad Skarzhevskyy, bluecove-...@googlegroups.com
I haven't tried yet myself, but it seems like it should work. I'll
give it a shot this week and post up instructions and a patch if
necessary.

dennis

--
dennis

Mina Shokry

unread,
Jul 3, 2009, 7:43:46 PM7/3/09
to bluecove-...@googlegroups.com
Hi Vlad, Dennis

I used android-ndk to build bluecove and got it working.
I tried the following with an example application
1 - getting my local device name.
2 - making a device inquiry and service search.
3 - sending a file using OBEX push.
all work fine and I didn't notice any problems except some debug messages that seems to be warnings in log file.

I compiled bluecove source a version before applying Dennis patches inside the application but I needed to make two minor changes to code
1 - disable Log4J calls in class com.intel.bluetooth.DebugLog4jAppender (I know, there is something better to be done here).
2 - change function getBlueZVersionMajor() in BlueCoveBlueZ.c to always return BLUEZ_VERSION_MAJOR_3 because compiler complained about dlopen, dlsym, and dlclose.

I'll post more details later in a separate email.

Vlad, I guess we need another module to be called bluecove-android to be free changing other files to better suit android needs like logging and we may use existing android bluetooth APIs to implement some functions. If we make such module, can it be licensed under apache as all android is licensed under apache? (is android linux kernel licensed under apache?)

Vlad Skarzhevskyy

unread,
Jul 3, 2009, 9:44:56 PM7/3/09
to bluecove-...@googlegroups.com
It is very cool that we are making such progress.
Here is my view of BlueCove and Android.

- The bluecove-gpl module stay GPL. Nothing changes with android!
BlueZ is GPL and if you link with it you get GPL....
Android NDK binaries are under GPL.
Android Linux kernel is GPL, Linux is GPL nothing change here.
Google went a long road to make SDK under Apache license, You see
they even don't use Java on device.

- 'bluecove-android'
The special android module should be considered for creating android
library that can be used by other applications to access bluetooth.
As to what API this module should expose it is a different story
probably only JSR-82 if it is possible.
I don't see that there would be much code special for android. It
should reuse existing bluecove and bluecove-gpl modules and just
create an distributable android library APK.

- Another mandatory module is 'bluecove-tester' for Android.

I don't know if I personally would have much time to do all this this
summer. So a help from the group is required.

Mina back to making a first build.
- To the best of my knowledge android-ndk does not contain bluez
headers and library for linking. How you went around this?
- Dennis patches has been applied to trunk so the bluecove sources
should be used.
- As to Log4j integration we should probably change to slf4j if possible.
Can we used the same approach for Android and redirect our log
calls to android.util.Log.
To the best of my knowledge Class.forName() should work fine on
android. What was your problem exactly?
- The android specific #ifdef in C code should also solve the problem

Vlad

Mina Shokry

unread,
Jul 4, 2009, 6:01:36 AM7/4/09
to bluecove-...@googlegroups.com
ok, I updated my sources to include Dennis patch and I think these are correct steps to build with android-ndk
  1. From android-ndk documentation, to build with android-ndk we need to put source files under <android-ndk>/sources/<app-name> and application descriptor under <android-ndk>/apps/<app-name>. Symlinks work fine. So, create <android-ndk>/sources/bluecove and <android-ndk>/apps/bluecove.
  2. download and build android source tree as Dennis described in a previous mail to get bluez headers and libbluetooth.so.
  3. BlueZ headers will be in <android-source-tree>/external/bluez/libs/include. Copy or symlink "bluetooth" directory to <android-ndk>/build/platforms/android-1.5/arch-arm/usr/include
  4. libbluetooth.so will be in <android-source-tree>/out/target/product/generic/system/lib. libdl.so will be in same path
  5. Add Android.mk file to <android-ndk>/sources/bluecove/ (my Android.mk is attached).
  6. Add Application.mk file to <android-ndk>/apps/bluecove/ (my Application.mk is attached).
  7. Copy or symlink libbluetooth.so to <android-ndk>/out/apps/bluecove/android-1.5-arm/ (create this path if doesn't exist). and same for libdl.so (it was linker not compiler who complained about dlopen, dlsym, and dlclose and this solved by linking to libdl.so).
  8. Starting from <android-ndk> directory type in terminal "make APP=bluecove"
  9. Without any change to trunk code (after Dennis patch). it builds although I see some warnings in build process that I haven't gave them time to examine till now.
  10. copy libbluecove.so to any android project under <project-path>/libs/armeabi/ and add bluecove-<...>.jar and bluecove-gpl-<...>.jar to classpath of application and it should work. (Does anyone know how to build a .apk package for bluecove and export its APIs to other applications?)
  11. Emulator doesn't have libbluetooth.so, so this will work only with real devices.
When adding bluecove-<...>.jar and bluecove-gpl-<...>.jar to classpath of android application, Eclipse gives some warnings saying "warning: Ignoring InnerClasses attribute for an anonymous inner class that doesn't come with an associated EnclosingMethod attribute. (This class was probably produced by a broken compiler.)" I don't know what is this but everything I tried works just fine.

Please tell me if any step of these steps doesn't work or need more clarification.

Mina.
Android.mk
Application.mk

Shawn Brown

unread,
Sep 6, 2009, 12:44:33 AM9/6/09
to bluecove-...@googlegroups.com, Mina Shokry
Hi,

About the build instructions, you don't mention to

ln -s <android-source-tree>/system/core/include/cutils
<android-ndk>sources/bluecove

so I get:

Android NDK: Building for application 'bluecove'
Compile thumb : bluecove <= sources/bluecove/BlueCoveBlueZ.c
In file included from sources/bluecove/BlueCoveBlueZ.h:34,
from sources/bluecove/BlueCoveBlueZ.c:23:
build/platforms/android-1.5/arch-arm/usr/include/bluetooth/sdp.h:35:28:
warning: cutils/sockets.h: No such file or directory
In file included from sources/bluecove/BlueCoveBlueZ.c:23:

"BlueCoveBlueZ.h" --> #include <bluetooth/sdp.h>
sdp.h --> #include <cutils/sockets.h>

Is my build wrong?
Is my sdp.h different than yours?

Shawn

>> >      1. From android-ndk documentation, to build with android-ndk we


>> >         need to put source files under <android-ndk>/sources/<app-name>
>> >         and application descriptor under <android-ndk>/apps/<app-name>.
>> >         Symlinks work fine. So, create <android-ndk>/sources/bluecove
>> >         and <android-ndk>/apps/bluecove.

>> >      2. download and build android source tree as Dennis described in a


>> >         previous mail to get bluez headers and libbluetooth.so.
>> >

>> >               * BlueZ headers will be in


>> >                 <android-source-tree>/external/bluez/libs/include. Copy
>> >                 or symlink "bluetooth" directory to
>> >
>> > <android-ndk>/build/platforms/android-1.5/arch-arm/usr/include

>> >               * libbluetooth.so will be in


>> >
>> > <android-source-tree>/out/target/product/generic/system/lib. libdl.so will
>> > be in same path
>> >

>> >      3. Add Android.mk file to <android-ndk>/sources/bluecove/ (my
>> >         Android.mk is attached).
>> >      4. Add Application.mk file to <android-ndk>/apps/bluecove/ (my
>> >         Application.mk is attached).
>> >      5. Copy or symlink libbluetooth.so to


>> >         <android-ndk>/out/apps/bluecove/android-1.5-arm/ (create this
>> >         path if doesn't exist). and same for libdl.so (it was linker not
>> >         compiler who complained about dlopen, dlsym, and dlclose and
>> >         this solved by linking to libdl.so).

>> >      6. Starting from <android-ndk> directory type in terminal "make
>> >         APP=bluecove"
>> >      7. Without any change to trunk code (after Dennis patch). it builds


>> >         although I see some warnings in build process that I haven't
>> >         gave them time to examine till now.

>> >      8. copy libbluecove.so to any android project under


>> >         <project-path>/libs/armeabi/ and add bluecove-<...>.jar and
>> >         bluecove-gpl-<...>.jar to classpath of application and it should
>> >         work. (Does anyone know how to build a .apk package for bluecove
>> >         and export its APIs to other applications?)

>> >      9. Emulator doesn't have libbluetooth.so, so this will work only

>> >  Android.mk
>> > < 1KViewDownload
>> >
>> >  Application.mk
>> > < 1KViewDownload
>

Shawn

unread,
Sep 6, 2009, 2:35:26 AM9/6/09
to bluecove-developers
Also, if I link

> ln -s <android-source-tree>/system/core/include/cutils
> <android-ndk>sources/bluecove

I get:

sources/bluecove/BlueCoveBlueZ.h:38:53: error:
com_intel_bluetooth_BluetoothStackBlueZ.h: No such file or directory
sources/bluecove/BlueCoveBlueZ.h:39:59: error:
com_intel_bluetooth_BluetoothStackBlueZConsts.h: No such file or
directory
sources/bluecove/BlueCoveBlueZ.c: In function
'Java_com_intel_bluetooth_BluetoothStackBlueZ_getLibraryVersionNative':

And if I try to make them using:
javah -d ${WORK_DIR}/src/main/c -classpath ${WORK_DIR}/target/classes
com.intel.bluetooth.BluetoothStackBlueZ
com.intel.bluetooth.BluetoothStackBlueZConsts
com.intel.bluetooth.BluetoothStackBlueZNativeTests

I need to compile bluetooth-gpl first

but doing so gives me various errors:

BLUECOVE_TRUNK/bluecove-gpl/src/main/java/com/intel/bluetooth/
BluetoothStackBlueZ.java:41: com.intel.bluetooth.BluetoothStackBlueZ
is not abstract and does not override abstract method l2Send(long,byte
[]) in com.intel.bluetooth.BluetoothStack
class BluetoothStackBlueZ implements BluetoothStack,
BluetoothStackExtension {
^
/Users/brownasamoto-brown/dev/workspace/BLUECOVE_TRUNK/bluecove-gpl/
src/main/java/com/intel/bluetooth/BluetoothStackBlueZ.java:160: cannot
find symbol
symbol : variable PROPERTY_BLUETOOTH_CONNECTED_DEVICES_MAX
location: class com.intel.bluetooth.BluetoothConsts
propertiesMap.put
(BluetoothConsts.PROPERTY_BLUETOOTH_CONNECTED_DEVICES_MAX, "7");
^
/Users/brownasamoto-brown/dev/workspace/BLUECOVE_TRUNK/bluecove-gpl/
src/main/java/com/intel/bluetooth/BluetoothStackBlueZ.java:161: cannot
find symbol
symbol : variable PROPERTY_BLUETOOTH_SD_TRANS_MAX
location: class com.intel.bluetooth.BluetoothConsts
propertiesMap.put
(BluetoothConsts.PROPERTY_BLUETOOTH_SD_TRANS_MAX, "7");
^
/Users/brownasamoto-brown/dev/workspace/BLUECOVE_TRUNK/bluecove-gpl/
src/main/java/com/intel/bluetooth/BluetoothStackBlueZ.java:162: cannot
find symbol
symbol : variable PROPERTY_BLUETOOTH_CONNECTED_INQUIRY_SCAN
location: class com.intel.bluetooth.BluetoothConsts
propertiesMap.put
(BluetoothConsts.PROPERTY_BLUETOOTH_CONNECTED_INQUIRY_SCAN, TRUE);
^

Conclusion:

Bluecove doesn't seem to work for me on Android.

Reason:

If I call code that works on Linux, OSX and Windows - it fails.
Ex. LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(

DiscoveryAgent.GIAC, this);

results in:
/dalvikvm( 9042): No implementation found for native
Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()Z

Also, I am unable to rebuild the libbluecove.so due to the compilation
errors above.

I see libbluecove.so is loaded,
D/dalvikvm( 9042): Added shared lib
/data/data/com.example.android.helloactivity/lib/libbluecove.so

so if that version works for MyTouch handsets, why do I get No
implementation found for native
Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded ()Z

Shawn

Mina Shokry

unread,
Sep 6, 2009, 5:43:52 PM9/6/09
to bluecove-...@googlegroups.com
Hello Shawn,
let's try to discuss your problems one by one.

first, about the missing directory in includes "cutils" you are right, it should be included as sdp.h refers to it. but not including it causes only a warning not an error and without it libbluecove.so for android can be built and run (as you see in androbex). Although I don't know if not including it has any other effect rather than the warning in build. Vlad, can you answer this question?

then, I don't know why you can not compile bluecove-gpl yourself. have you modified the sources? checking out sources and running the maven build script should work. what method you have used to compile the sources?

Shawn Brown

unread,
Sep 6, 2009, 10:55:39 PM9/6/09
to bluecove-...@googlegroups.com
> then, I don't know why you can not compile bluecove-gpl yourself. have you
> modified the sources? checking out sources and running the maven build
> script should work. what method you have used to compile the sources?

I checked out svn and ran the ant build script.

Bluecove builds fine. Bluecove-gpl reports:

BLUECOVE_TRUNK/bluecove-gpl/src/main/java/com/intel/bluetooth/
BluetoothStackBlueZ.java:41: com.intel.bluetooth.BluetoothStackBlueZ
is not abstract and does not override abstract method l2Send(long,byte
[]) in com.intel.bluetooth.BluetoothStack
class BluetoothStackBlueZ implements BluetoothStack,

BluetoothStackExtension {.......

Shawn

SURYA K

unread,
Oct 19, 2012, 10:00:51 AM10/19/12
to bluecove-...@googlegroups.com
Hi .... plz send me BlueCive running code for Android file transfer to ksp...@gmail.com

ajay pacharne

unread,
Mar 22, 2019, 9:51:37 AM3/22/19
to bluecove-developers
In Android during runtime getting error like 
Caused by: javax.bluetooth.BluetoothStateException: Bluetooth Device is not available
        at com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(Native Method)
        at com.intel.bluetooth.BluetoothStackBlueZ.initialize(BluetoothStackBlueZ.java:148)
        at com.intel.bluetooth.BlueCoveImpl.setBluetoothStack(BlueCoveImpl.java:1014)
        at com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:518)
        at com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
        at com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
        at java.security.AccessController.doPrivileged(AccessController.java:69)
        at java.security.AccessController.doPrivileged(AccessController.java:94)
        at com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:1083)
        at com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:1076)
        at javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:75)
        at javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)

Let me know where did wrong
Reply all
Reply to author
Forward
0 new messages