Android Bluetooth Low Energy old sdk - android

I have an old Android device using Gingerbread which is bluetooth low energy capable.
However when I try to build a BTLE app Android Studio complains saying that minimun SDK is 18 and I have 10.
I tried to avoid those problems using SuppressLint and I can compile the application but dalvik complains about linking the class.
Link of class 'Lcom/package/class;' failed
Is there any way to force dalvik to link my class even if I have an older Android device or to modify bluetooth low energy api so that it doesnt complain?
Any idea where does Android studio gets the information to know that BTLE api is only available from API > 18?
Thanks

Any idea where does Android studio gets the information to know that BTLE api is only available from API > 18?
Of course Android studio got the information from the SDK.
Is there any way to force dalvik to link my class even if I have an
older Android device or to modify bluetooth low energy api so that it
doesnt complain?
Simply no way to force it working. The api just does not exist before API level 18.
If by "modify bluetooth low energy api" you mean you will build your own version of Gingerbread with BLE support, you will have a extremely slim (or non-existent) chance to get it working. However please keep in mind that having a chip that supports BLE does not mean the device can use BLE.

Related

wear OS - http post from smartwatch

I want to create android application for smartwatch with a cellular internet connection that send HTTP post to a server.
What android version support should i have?
I saw that android 5.1 support cellular network but in Wikipedia it written that only android 7.1.1 support cellular data.
Watches and Phones have thier own OS. Perhaps you found something built to look like a watch that is actually using the phone OS. i wouldnt doubt it as the wear playform is not given the same attention...
But at least in part the actual watch versioning is confusing.
it started out as Android Wear 1.x 2.x then reset to Wear OS 1.x which is now up to version 2.6, all while the latest version for Pie was again renamed to letter version, which is version H... Go figure.
Also if starting now at i wouldnt worry about the older Android Wear hardware, and not even sure if you could buy a new 'Android Wear' watch at this point, so any watch that advertises 'Wear OS by Google' will support Wear OS.
Also I might concider getting a watch with the physical USB connector so you can debugging on the device itself... otherwise you have to manage debugging over bluetooth which at least for me is not always stable on one pc, and have never gotten to work on another...
But such advise is rather particular to me...
Update: it strikes me that you might have been speaking about the target version of Android, which yes admitingly is yet another version to get familiar with developing with wearable android...
Usually it is seen as the target or compile versoin, and from what Im aware the SDK is compatible from version 7.x to the latest 9.0... but perhaps there are eirlier versions that work with the older Android Wear down to what you mention 5.x Im unsure.
Currently i target 8.0 but moving to 8.1 to get at updated libraries im interested in.
And then there are the API Levels to get familiar with...
Ya honestly it's really confusing...

Android Developement: Bluetooth Low Emission Advertisement is "Not Supported" on compatible devices

I am working on a android app, which requires me to send bluetooth low emission advertisement with the device on which my app is running.
I read this in a blog post " You need to set the minimum SDK version to 21 in your build.gradle file, as Bluetooth LE advertising was not introduced on Android until the release of Lollipop.". The blog was "https://code.tutsplus.com/tutorials/how-to-advertise-android-as-a-bluetooth-le-peripheral--cms-25426.
However, when I went and checked out the Google Repository for bluetooth advertisement, the Minimum SDK was 25. I am confused now. The basic requirement for BLE is that you need a bluetooth device which supports version 4.X. And almost all devices having SDK 21 have that.
Any reason why my mobile(One plus 1), which has SDK 23(which supports bluetooth advertisement) and has a bluetooth chip -v 4.1 , is not able to advertise bluetooth data.
Here is the link to the google repository that I used.
https://github.com/googlesamples/android-BluetoothAdvertisements
Please go through the reference link
Chipsets/Devices supporting Android 5 BLE peripheral mode
Hope it will help

Is there a framework or something else I have to download for android development to make connecting a bluetooth low energy device possible?

Im working on a simple Android application and need it to have the ability to connect to a Bluetooth low energy device. Im relatively new to Android development and was wondering if there were any frameworks or SDKs that I had to download to make this possible.
You should look in to Bluetooth Studio
Nope, you should not need anything special to work with Bluetooth low energy on Android at long as you are targeting a platform that is API 18 or higher. An excellent place to start as mentioned in the comment above is the Developer Documentation. The other place I would look at for an example are the samples provided by Google. The BLE one can be found here. Be warned though that devices with API 18 devices do support BLE, they had a lot of bugs, and you might be better of just supporting a minimum level of 19 (KitKat).

Is Bluetooth version of Android Device related to Android version?

I once wondered if can I get a specific bluetooth version of Android devices? I searched a little bit and I figured out that it's not possible.
So, I wondered something else this time. Is bluetooth version related with Android version? Such as:
bluetooth 2.0 run at android 2.3.x devices and below
bluetooth 3.0 run at android 3.x.x devices,
bluetooth 4.0 run at android 4.x.x and above
Can I make an assumption something like that?
If I can, I'll use Android version of devices.
Note: By the way, I already know that I can get bluetooth type, such as bluetooth classic or bluetooth low energy.

Low API support Android

We are working on a project that needs to support a range of devices.
For devices above api level 18 there must be Bluetooth LE support, making use of the BluetoothAdaptor class.
Now comes the problem, since it's imported from a cordova plugin our app crashes on boot on low api devices.
So now we are looking for a way to use the class, without loading it beforehand.
So we check for api level, if it is supported we want to load the class.
Is there a way? We heard about dynamic class loading, is this the way?
use null safe for this according to me. for device older(<18) class BLE and else BluetoothAdaptor .
Bluetooth = Bluetooth! BLE ? BluetoothAdaptor;

Categories

Resources