Android: how to solve "Not supported yet" exception?

354 views
Skip to first unread message

cd

unread,
Sep 3, 2011, 3:33:38 AM9/3/11
to bluecove-developers
Hello
i have problems in implementing BlueCove on Android; i've downloaded
libblucove.so as suggested here:
http://groups.google.com/group/bluecove-developers/browse_thread/thread/a05875b928c89dc2/847f714034b34126?q=android&lnk=ol&

and put it in libs/armeabi .
I've downloaded latest sources from bluecove and added the various
com.ibm com.intel javax.obex packages to my project.
It compiles but when executed i always get a "Not supported yet" when
i try to discover devices or when i try to make an obex connection.

Can anyone help me?

Thanks in advance

Mina Shokry

unread,
Sep 3, 2011, 4:07:28 AM9/3/11
to bluecove-...@googlegroups.com
Compiling latest sources should work. please send an exact stacktrace of the exception you have.


--
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

cd

unread,
Sep 3, 2011, 5:43:43 AM9/3/11
to bluecove-developers
I've made some step onward ... i've successfully generated
bluecove.jar and included it in build path.
When i run Android app i get BlueCove
com.intel.bluetooth.BluetoothStackBlueZ not available . What am i
doing wrong?
Thanks in advance

On 3 Set, 10:07, Mina Shokry <minasho...@gmail.com> wrote:
> Compiling latest sources should work. please send an exact stacktrace of the
> exception you have.
>
>
>
>
>
>
>
> On Sat, Sep 3, 2011 at 9:33 AM, cd <cris.disclaf...@gmail.com> wrote:
> > Hello
> > i have problems in implementing BlueCove on Android; i've downloaded
> > libblucove.so as suggested here:
>
> >http://groups.google.com/group/bluecove-developers/browse_thread/thre...

cd

unread,
Sep 3, 2011, 6:52:14 AM9/3/11
to bluecove-developers
Here is log:

09-03 12:46:25.580: WARN/System.err(6083):
javax.bluetooth.BluetoothStateException: BlueCove
com.intel.bluetooth.BluetoothStackBlueZ|
com.intel.bluetooth.BluetoothStackBlueZDBus not available
09-03 12:46:25.610: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl.loadStackClass(BlueCoveImpl.java:363)
09-03 12:46:25.610: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl.detectStack(BlueCoveImpl.java:454)
09-03 12:46:25.610: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl.access$500(BlueCoveImpl.java:70)
09-03 12:46:25.610: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl$1.run(BlueCoveImpl.java:1085)
09-03 12:46:25.620: WARN/System.err(6083): at
java.security.AccessController.doPrivilegedImpl(AccessController.java:
205)
09-03 12:46:25.620: WARN/System.err(6083): at
java.security.AccessController.doPrivileged(AccessController.java:178)
09-03 12:46:25.620: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl.detectStackPrivileged(BlueCoveImpl.java:
1083)
09-03 12:46:25.620: WARN/System.err(6083): at
com.intel.bluetooth.BlueCoveImpl.getBluetoothStack(BlueCoveImpl.java:
1076)
09-03 12:46:25.620: WARN/System.err(6083): at
javax.bluetooth.LocalDevice.getLocalDeviceInstance(LocalDevice.java:
75)
09-03 12:46:25.620: WARN/System.err(6083): at
javax.bluetooth.LocalDevice.getLocalDevice(LocalDevice.java:95)
09-03 12:46:25.620: WARN/System.err(6083): at
com.cri.testobex.TestObexActivity.onCreate(TestObexActivity.java:55)
09-03 12:46:25.620: WARN/System.err(6083): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:
1047)
09-03 12:46:25.620: WARN/System.err(6083): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:
2627)
09-03 12:46:25.620: WARN/System.err(6083): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:
2679)
09-03 12:46:25.620: WARN/System.err(6083): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
09-03 12:46:25.620: WARN/System.err(6083): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
09-03 12:46:25.630: WARN/System.err(6083): at
android.os.Handler.dispatchMessage(Handler.java:99)
09-03 12:46:25.630: WARN/System.err(6083): at
android.os.Looper.loop(Looper.java:123)
09-03 12:46:25.630: WARN/System.err(6083): at
android.app.ActivityThread.main(ActivityThread.java:4627)
09-03 12:46:25.630: WARN/System.err(6083): at
java.lang.reflect.Method.invokeNative(Native Method)
09-03 12:46:25.630: WARN/System.err(6083): at
java.lang.reflect.Method.invoke(Method.java:521)
09-03 12:46:25.630: WARN/System.err(6083): at
com.android.internal.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:860)
09-03 12:46:25.630: WARN/System.err(6083): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:618)
09-03 12:46:25.630: WARN/System.err(6083): at
dalvik.system.NativeStart.main(Native Method)


I've compiled 2.1.1-SNAPSHOT-63 downloaded here:
http://snapshot.bluecove.org/distribution/download/2.1.1-SNAPSHOT/2.1.1-SNAPSHOT.63/

What am i doing wrong?

Thanks !
c.

cd

unread,
Sep 3, 2011, 1:45:23 PM9/3/11
to bluecove-developers
Latest update:
Downloaded bluecove.jar , bluecove-gpl.jar, bluecove-bluez.jar from
latest snapshots(63).
Removed native libraries from jars
Added the 3 jars to build path under libs
Added 75kb libbluecove.so downloaded from a discussion in this site
(maybe is that file the problem?)

When i try this: started =
LocalDevice.getLocalDevice().getDiscoveryAgent().startInquiry(DiscoveryAgent.GIAC,
listener);

i get:

09-03 19:39:15.653: WARN/dalvikvm(8040): No implementation found for
native Lcom/intel/bluetooth/BluetoothStackBlueZ;.isNativeCodeLoaded
()Z
09-03 19:39:15.683: WARN/System.err(8040):
javax.bluetooth.BluetoothStateException: Bluetooth Device is not
available
09-03 19:39:15.683: WARN/System.err(8040): at
com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(Native
Method)


Thanks in advance for helping me!
c.

On 3 Set, 10:07, Mina Shokry <minasho...@gmail.com> wrote:
> Compiling latest sources should work. please send an exact stacktrace of the
> exception you have.
>
>
>
>
>
>
>
> On Sat, Sep 3, 2011 at 9:33 AM, cd <cris.disclaf...@gmail.com> wrote:
> > Hello
> > i have problems in implementing BlueCove on Android; i've downloaded
> > libblucove.so as suggested here:
>
> >http://groups.google.com/group/bluecove-developers/browse_thread/thre...

Mina Shokry

unread,
Sep 4, 2011, 7:16:50 AM9/4/11
to bluecove-...@googlegroups.com
bluecove.jar should be used with only one of (bluecove-gpl, bluecove-bluez, bluecove-android2)

bluecove-bluez: to get it working on android, phone need to be rooted and bluetooth socket permissions need to be changed.
bluecove-gpl: works fine on some phones and doesn't work completely on others (supports android 1.x).
bluecove-android2: works on android 2.x+ phones but doesn't offer all JSR82 abilities.

Choose the suitable one according to your needs.

cd

unread,
Sep 4, 2011, 8:57:22 AM9/4/11
to bluecove-developers
Hi,
first of all, thank you for your attention (yes, i know that today is
sunday..)!

I'm trying to realize an Android(>=2.1) app that runs on NOT-ROOTED
devices that permits to discover Bluetooth devices, browse file system
and gets files from these devices.
I've implemented btgoep://address:channel call and
header.setHeader(HeaderSet.TYPE, "x-obex/folder-listing") and i've
seen that it runs on a Samsung Galaxy Tab 10 (Android 3.1) but does
not run (i get avax.bluetooth.BluetoothStateException: Bluetooth
Device is not available at
com.intel.bluetooth.BluetoothStackBlueZ.nativeGetDeviceID(Native
Method))

Do you think it is possible to achieve a similar result. I've not used
bluecove-android2, are there some documents on its implementation?

Really thank you!
c.

On 4 Set, 13:16, Mina Shokry <minasho...@gmail.com> wrote:
> bluecove.jar should be used with *only one* of (bluecove-gpl,

Mina Shokry

unread,
Sep 4, 2011, 9:08:04 AM9/4/11
to bluecove-...@googlegroups.com
You can build bluecove-android2 from source

http://code.google.com/p/bluecove/source/checkout

cd

unread,
Sep 4, 2011, 9:48:41 AM9/4/11
to bluecove-developers
I'm here again ...
I've built bluecove-android2, added jar, included
BlueCoveImpl.setConfigObject(BlueCoveConfigProperties.PROPERTY_ANDROID_CONTEXT,
this);

but, when calling

String btURL = "btgoep://"+mac+":
2;authenticate=false;encrypt=false;master=false";
ClientSession conn = (ClientSession) Connector.open(btURL);

i get this:
09-04 15:41:09.724: INFO/BT_CRIS(12522): Exception
java.lang.ClassCastException:
com.intel.bluetooth.BluetoothConnectionParams

:-(
hope to solve it.
Thanks in advance

Mina Shokry

unread,
Sep 4, 2011, 10:20:35 AM9/4/11
to bluecove-...@googlegroups.com
add ";android=true" to the connection string to tell bluecove to use Android workarounds. standard jsr82 objects can't be used because android bluetooth APIs are missing some features required by JSR82

cd

unread,
Sep 4, 2011, 10:32:27 AM9/4/11
to bluecove-developers
Added:

String btURL = "btgoep://"+mac+":
2;authenticate=false;encrypt=false;master=false;android=true";
ClientSession conn = (ClientSession) Connector.open(btURL);

get: 09-04 16:29:45.320: INFO/BT_CRIS(25066): Exception
java.io.IOException: Service discovery failed

on Connector.Open

Mina Shokry

unread,
Sep 4, 2011, 10:53:46 AM9/4/11
to bluecove-...@googlegroups.com
This means that it can't open the connection, make sure everything ok, the other device is open and ready to receive connections.

Also try to retrieve the connection string by a discovery and service search and see if bluecove generated a connection string different than the one you use.

cd

unread,
Sep 4, 2011, 11:00:47 AM9/4/11
to bluecove-developers
You're right, there are other problems.
Device and service discovery does not run anymore since i added
bluecove-android2 and removed bluecove-gpl.jar.

At this moment i have:

-bluecove-2.1.1-SNAPSHOT.jar
-bluecove-android2-2.1.1-SNAPSHOT.jar
-armeabi/libbluecove.so

Is it all that i need to go?

Thanks again !

Mina Shokry

unread,
Sep 4, 2011, 11:06:41 AM9/4/11
to bluecove-...@googlegroups.com
with bluecove-android2, you don't need armeabi/libbluecove.so. this is needed only with bluecove-gpl. Also take in consideration that bluecove-android2 is still experimental. Any fixes you can make are more than welcomed.

cd

unread,
Sep 5, 2011, 3:46:11 AM9/5/11
to bluecove-developers
Hi Mina,
i want to thank you very much for your support. I've finally reached
to get remote device file listings by opening connection to
"btgoep:MAC:
0000110600001000800000805f9b34fb;authenticate=false;encrypt=false;master=false;android=true";

Thank you so much, without your support i could never obtain that !

Greetings
Cris

Mina Shokry

unread,
Sep 5, 2011, 6:03:45 AM9/5/11
to bluecove-...@googlegroups.com
You are welcome.
Reply all
Reply to author
Forward
0 new messages