蓝牙LE的应用程序,怎样建设跨plaftorm(iOS版,Android版)? [英] Bluetooth LE app, how to build it cross-plaftorm (iOS-Android)?

查看:780
本文介绍了蓝牙LE的应用程序,怎样建设跨plaftorm(iOS版,Android版)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作,讨论到蓝牙LE设备的应用程序。我想一些方法来避免开发它的两次的,iOS和Android版。是否有对蓝牙LE?

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?

我有一个快速浏览一下像科尔多瓦(PhoneGap的),Appcelerator的,Xamarin等(通常的嫌疑人框架:如的这个列表),但我无法弄清楚,如果他们(一)支持蓝牙LE每个平台上都,和(b)如果他们这样做,无论是通过本地电话(访问怎么样?)或某种包装的原生API(什么包装什么样子的?),和(c)如果它是一个包装,这是多么完备,以及如何稳定是。

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.

如果你有这些经验,你能总结在不同的框架蓝牙LE支持的状态?

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:这只是通过使用本机API MonoTouch.CoreBluetooth Android.Bluetooth 。这意味着code。使用它们是不实际的跨平台,但它们有可能工作方式相同的本机API(因为它们实质上是本地API)

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的具有蓝牙第三方商业插件(<​​a href=\"https://marketplace.appcelerator.com/apps/3834\" rel=\"nofollow\"> https://marketplace.appcelerator.com /应用/ 3834 并
https://marketplace.appcelerator.com/apps/6611 ),没有内置的支持。做这些工作?

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。除了蓝牙我的需求是pretty最少的:这个程序将有很多UI元素,但并不是一个复杂的一种,只是一堆不同的屏幕(这将是非常乏味的保持了一堆按钮/复选框/滑块的在两个平台上)。我还需要对一个REST API打了几个电话。速度是不是超级重要的,没有那么多的应用程序逻辑(它主要是用C写的了),和原生用户界面的外观并不重要。不过在老版本工作的平台的重要,最好回是Android 4.3和iOS 7.0。

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.

推荐答案

我一直使用 Randdusing ş科尔多瓦插件BluetoothLE它(正在开发还是Windows phone)系统非常适用于Android和iOS。存在科尔多瓦它的设计与HTML5 / JavaScript的应用程序来工作,但自己的插件(如所有科尔多瓦插件吗?)都写在本土code。
在我的项目前面我试过 Evothings 其中也有BLE插件,但我发现了一些问题,我不知道这些目前尚无解决。
我的应用程序中的声音的UI要求方面类似于你pretty,我可以用,如果你喜欢集成BLE code可能帮助 - 但你首先需要重写你的'C'成JavaScript。
BTW你要求使用较旧的Andr​​oid,但据我所知BLE仅在 Android 4.3的或更高

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.

这篇关于蓝牙LE的应用程序,怎样建设跨plaftorm(iOS版,Android版)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆