Android 4.0.4 BLE API, BroadCom - Motorola
Asked Answered
D

2

5

Iam working on a HealthCare project atm. we are making a test setup where we use a Motorola Razr Max with android 4.0.4 as Gateway. The phone's BLE will communicate with a BLE Chip from IT. The reason for picking a Motorola Razr maxx was because IT had it listed on a link! under which phones supported BLE.

But but Motorola's BLE API from android 4.0 upgrade dosnt work.

I have also tried BroadComs BLE API on the phone - but it isnt supported by the phones BLE chip - so I didnt get fare here.

So my Question here. what will you suggest I do from here ?

Do u know any android phones where Broadcoms API i working in android 4.0.4 - IT says the HTC 1 X - have a working BLE API - Have any1 tried it ?

Do anyone if motorola is coming with the bug fixes? (The Motorola Developmer support team in Denmark - dont know shit about there own software/hardware.)

------ UPDATE --------

Iam trying to get the Motorola to work - and now it dont fail the BLE support = Great :)

Iam using the Motorola_ICS_R2 API. But when I run the profile sample - it will not compile - because of _ BluetoothDevice.ACTION_GATT and BluetoothDevice.EXTRA_GATT what is it Iam missing before I can run the Profile Sample?

Detector answered 7/11, 2012 at 15:2 Comment(6)
actually motorola razr maxx(xt910) supports BLE. i've made an application for heartrate service. what exact questions do you have?Mogador
The problem with Razr is that when I use Motorolas own BLE API, and I test if the device support BLE, its return it doesnt. I have tried Motorolas own Test for the API - and it fails after the 4.0.4 Android update. if u have any solution the the problem. Now I have tried TI own BLE API for HTC One X - and now it dont work either. I really need and BLE API for Android 4.0.4 that works -any1 have any Idea?Detector
motorola's api works. i had the same problem, but i don't remember how i solved it. i can show you how it looks in my code: try { Class<?> object = Class.forName(className);//className = "android.bluetooth.BluetoothGattService" ifPhoneSupportsBLE = true; } catch (Exception e) { ifPhoneSupportsBLE = false; Toast.makeText(mContext, "Your phone is not compatible with BLE", Toast.LENGTH_SHORT).show(); } // End logic to check Low Energy support. You have to add uses-permissions to manifest "BLUETOOTH" and "BLUETOOTH_ADMIN".Mogador
Add BluetoothGatt.jar to Java Build Path in project properties. and create "lib" folder in project and put BluetoothGatt.jar to this folder. everything should work after doing these steps. And check your imports.Mogador
also as far as i know you have to use "Motorola ICS R1" addon instead of "ICS R2"Mogador
Hey Vasili Ruzov - I get the same Errors as descriped in my post update - with R1 API instead.Detector
A
8

Here you'll find the libraries and examples you need to work with a Motorola Razr on ICS (Ice Cream Sandwich). Look for " Motorola Handset SDK Addons " and " Motorola ICS R2 ".

The Addon comes with two examples, you have to study them yourself, there is no actual API-documentation out there, but a proper explanation how the API works you'll find here.

I can assure you the API-examples work relatively fine with TI's CC2540DVK Keyfob and a Motorola Razr (XT910). All you have to do is to take care about to use valid UUID's!

...Update...

Fresh start in Eclipse (Indigo) with Android SDK (v20) and Motorola ICS R2 sample:

  1. In Package Explorer (right click) ==> Import ==> Existing Android Code Into Workspace
  2. Root Directory: ...\Motorola_ICS_R2\samples\Motorola_BLE_profile_sample (copy into workspace)
  3. On Project (right click) ==> Properties ==> Java Build Path/Libraries ==> remove ALL jar's even the Android Libs
  4. In Java Build Path/Libraries ==> Add External Jars: ...\Motorola_ICS_R2\libs\BluetoothGatt.jar & BluetoothGattService.jar
  5. On Project (right click) ==> Android Tools ==> Fix project properties
  6. Now choose an existing primary service of your sensor device, i.e. 0x180A (Device Information):

    public static final ParcelUuid HRM = ParcelUuid .fromString("0000180A-0000-1000-8000-00805f9b34fb");

  7. Build and run

It depends on your sensor device how far you get with the sample, but you should at least get a connection and get some characteristics. See the LogCat output.

Regards,
PeterVanPansen

Arnoldarnoldo answered 13/11, 2012 at 18:0 Comment(3)
Thx Peter - Iam at the point where I get the device to support BLE :) But the profile samle - uses BluetoothDevice.ACTION_GATT and BluetoothDevice.EXTRA_GATT which dont exist i BluetoothDevice :) The second Sample - I stil working on to see what do - Basis I still need to make the connection. The BluetoothGattService need 4 para - Device - > Check!, uuid -> Check, some String ?, callback -> Check Thx for the help so fare ! the string iam missing -what do I need it for ?Detector
Basic PVP - if u download the Motorola profile example and import it- u can run it? Because I get alot of errors on the BluetoothDevice - Do I need to import other Jar/projects ? I can run the API_Sample - but it will only try to connect the given ParcelUuid not my Primary on cc2540 0x2800.Detector
Thx alot - didnt see I need to remove Android.jar at the project - thx alot - I now have the connection as I wanted !Detector
O
0

I have very similar problem to this one.

I run with Android Motorola XT910 Android 4.0.4.

Configuration (on my standard eclipse and on a clear system - both same)

1) Eclipse + Android SDK + ADT
2) Package from motorola ICS_2 inside add-ons
3) import project from samples Motorola_BLE_API_sample
4) Setup motorola android in project properties
5) Remove android jar's
6) add BluetoothGatt, BluetoothGattService jars
and then run project (test with BLE112 dev board, UUID set to :

<service uuid="180d">
   <uri>org.bluetooth.service.health_thermometer</uri>
   <include id="manufacturer" />
   <description>Health Thermometer Service</description>
   <!-- temp: 2a1c  HRM:2a37 -->
   <characteristic uuid="2a37" id="xgatt_temperature_celsius">

simply sample to see anything )

I received this problems

1) device.getName() return null, I must comment it (rest eg bound is OK)
2) device could connect only with HRM UUID (i change in 2 places in sample code)
3) always return (in BluetoothGatt.CONNECT_COMPLETE) FAILURE

when I try Motorola_BLE_profile_sample I received similar errors to MIR, BluetoothDevice.ACTION_GATT, BluetoothDevice.EXTRA_GATT and getGattServices are not visible (and in ICS_R2 [Android 4.0.3]->android.jar->android.bluetooth->BluetoothDevice tree to) ?

What I'm doing wrong ?

---------- UPDATE

Really annoying ! Do not read motorola FAQ As mentioned ! remove all jar (including this from ICS2) and fix project THANX !

Ozonosphere answered 26/2, 2013 at 19:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.