I am working on an app that talks to a Bluetooth LE device. I would like some way to avoid developing it twice, for iOS and for Android. Is there a cross-platform app framework that has good support for Bluetooth LE?
I have had a quick look at frameworks like Cordova (PhoneGap), Appcelerator, Xamarin etc (the usual suspects: for example this list) but I can't figure out if they (a) support Bluetooth LE on each platform at all, and (b) if they do, whether it is via native calls (accessed how?) or some kind of wrapper to the native API (what does the wrapper look like?), and (c) if it is a wrapper, how complete it is, and how stable it is.
If you have experience with these, could you summarize the status of Bluetooth LE support in different frameworks?
EDIT A bit of info from digging into various options and from the answers below:
Cordova: several open-source plugins, for example https://github.com/evothings/cordova-ble https://github.com/don/cordova-plugin-ble-central https://github.com/randdusing/BluetoothLE (not a complete list). Evothings is a nice Cordova + bluetooth setup. Do these work in other Cordova-based app frameworks like Appery.io, Telerik AppBuilder, Ionic Creator?
Xamarin: this just uses the native APIs via MonoTouch.CoreBluetooth and Android.Bluetooth. This means the code using them is not actually cross-platform, but they are likely to work the same as the native API (because they essentially are the native API).
Appcelerator has third-party commercial plugins for Bluetooth (https://marketplace.appcelerator.com/apps/3834 and https://marketplace.appcelerator.com/apps/6611), no built-in support. Do these work?
P.S. Besides Bluetooth my needs are pretty minimal: this app will have a lot of UI elements but not of a complicated kind, just a bunch of buttons/checkboxes/sliders on a bunch of different screens (which would be very tedious to maintain on two platforms). I'd also need to make a few calls to a REST API. Speed is not super important, there isn't that much app logic (it is mostly written in C now), and native UI look is not that important. However working on older versions of the platforms is important, ideally back to Android 4.3 and iOS 7.0.
as long as you stick with the Core Bluetooth framework, operations queuing will be handled by iOS automatically use Core Bluetooth’s background processing and state restoration APIs to make the connection to Bluetooth LE sensors more reliable use the iBeacon technology to add (hyperlocal) location awareness to your BLE app
While Flutter and React Native are definitely the leading cross-platform mobile app development framework, they are not the only ones as you also have frameworks like Ionic, Xamarin, and Native Script which you will learn in this article. Without wasting any more of your time, let’s dive into the best framework to build cross-platform mobile apps.
11 Best Bluetooth apps for iOS 1 Bluetooth U. ... 2 LightBlue Explorer. ... 3 CovertTrack Bluetooth Tracker. ... 4 Intercom | AirPlay Bluetooth. ... 5 Bluetooth & Wifi App Box Free. ... 6 Photo Share lite & Bluetooth transfer. ... 7 Bluetooth Photo Share. ... 8 Bluetooth Phone. ... 9 BlueMe. ... 10 Bluetooth Voice Chat. ... More items...
Firebase is not exactly a cross-platform framework for developing mobile apps but a useful framework for building the backend. It’s actually Google’s mobile platform that helps you quickly develop high-quality mobile apps and grow your business. You can choose Firebase as a backend for your Android or iOS application.
I have been using Randdusing's Cordova plugin for BluetoothLE and it works well for Android and iOS (Windows phone still under development). Being Cordova it's designed to work with an HTML5/JavaScript app, but the plugins themselves (as all Cordova plugins?) are written in native code . Earlier in my project I tried Evothings which also has BLE plugin but I found some problems, and I don't know if these have been resolved yet. My app sounds pretty similar to yours in terms of the UI requirements, and I can possibly help with integrating the BLE code if you like - but you'll need to rewrite your 'c' into javascript first. BTW you ask for using with older Android but AFAIK BLE is only supported in Android 4.3 or higher.
I am using Qt framework developing cross-platform apps with BLE support: http://doc.qt.io/qt-5/qtbluetooth-lowenergyscanner-example.html
Currently the supported platforms are Andriod, iOS, OSX, Linux. Windows platform is said to support BLE in the forthcoming version Qt 5.6 (really looking forward to it). The BLE related classes are easy to use and Qt provided two sample projects in examples/documentation. The thing I am not sure about is getting Manufacturer Specific Data during a scan. Right now I am making a connection to the devices to get certain information which wouldn't be needed if I can read the Manufacturer Specific Data. Qt's BLE currently only support central role.
Qt is based on C++, if that matters to you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With