What's the best way to develop a cross-mobile app with bluetooth support?
Asked Answered
D

3

8

I've read about the native feature-support of Phonegap here. Clearly, it makes no mention of Bluetooth support. I've failed in finding or locating any other platform with cross-mobile platform development support. As a result, I'm currently faced with two choices.

  1. Build independently for all the platforms (very painful option)

  2. Find a suitable cross-platform development solution (which I've not found yet).

My question is; for mobile developers out there, which option would you suggest I take, one not listed here? If possible also help with details of pros and cons.

Thank you very much.

Dorweiler answered 1/10, 2012 at 16:12 Comment(1)
FWIK there is no open SDK for bluetooth on iOS. Bluetooth is only made available via Gamekit abstractions which limits you as to what you can do. On the other side, it might be possible to build a GameKit compatible bluetooth implementation on Android. I explored this option once but didn't get very far beyond initial research.Carnarvon
P
8

Build independently for all the platforms (very painful option)

In my experience, this is by far the least painful option, and not just for Bluetooth. The overhead of dealing with leaky cross-platform abstractions tends to outweigh the benefits by the time you get to a real, production product. Build an excellent iPhone app. Build an excellent Android app. You can share a lot of the UI design (though not all of it). You can share much of the data structure design. You can share some of the internal architecture. You can share any network protocols (particularly if you design them in JSON). But avoid code sharing and avoid shooting for the least-common-denominator. It's pretty far down....

For some kinds of projects it makes sense to share some C++ code between platforms. Trying to develop this stuff in JavaScript is a recipe for frustration the moment you go beyond the most basic of applications. It's easy to hack up something in mobile JavaScript that kind of works. It's very hard to get it to look and work great on all platforms; much harder than just writing them natively in the first place.

Some more discussions on this:

Patchwork answered 1/10, 2012 at 16:34 Comment(3)
"Build an excellent iPhone app. Build an excellent Android app" It's not that easy... Also, you cannot share any code. You can share patterns and flow, but both platforms have unique architectures, and you will have to write/manage every feature twice. So yeah, he will get a better final product, but I can't believe this is the "least painful" option!Exmoor
Having compared it to the other options, I believe it is the least painful if your goal is to produce a serious (non-game) application. Games that rely heavily on OpenGL can significantly share OpenGL C/C++ code between platforms. But even Facebook finally threw in the towel and rewrote a native app after years trying to fix their JS version. Anyone considering writing iOS apps in JavaScript should start by saying "I'm a better JS developer than the Facebook team." If you can say that honestly (and some probably can), give it a shot. If not, write it natively.Patchwork
Great answer and comment! I think you're making a really strong point here. I've considered and looked into all sort of platforms, I've even considered replacing bluetooth functionality with GPS but there were still more problems to consider. Nokia alone as a company has devices running on about five different mobile platforms and there are dozens of screen sizes. That really makes it painful. I've seen hotpaw2's answer and Cliff's comment but I'll just wait to get a few more opinions before accepting this. ThanksDorweiler
T
3

You list iOS as one of your desired platform. On iOS, any generic Bluetooth communication (other than Bluetooth LE or communication via Gamekit, headset or keyboard) is available only to Apple MFi program licensees. To get any details about this license, you need to apply to Apple's MFi program first. AFAIK, no 3rd party or cross platform tool chain can help you with this for iOS.

Tannenberg answered 1/10, 2012 at 16:44 Comment(0)
W
0

I don't believe the OP is talking about iOS app to device communication but rather peer-to-peer bluetooth communication. Would the requirement for Apple MFi program licensing apply?

If so, are the peer-to-peer Bluetooth APIs (and hardware) on say, Android or Windows Phone 8 be compatible with the one from iOS? And if they were, shouldn't passing data around by JSON be fairly straight-forward for building cross-mobile apps?

IMHO, for simple business apps, building native apps for each platform is the way to go if you want to make full use of available resources on each platform and conform to their differing UI design principles.

Wahoo answered 21/12, 2013 at 9:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.