Search code examples
pythonandroidiphonebeeware

target both android and iphone with Python


I want to develop an application targeting both android and iphone. I guess they use Java and Objective-C. Can I use single language like Python? Is it the best route? Will I lose performance, features, etc. by using Python. Are there any limitations that I will run into?


Solution

  • You cannot use Python on either of Android or iPhone platforms. This is clearly outruled by Apple SDK license, while with Android there actually is an Android scripting environment, but you will quickly realize that is not meant for the final user. In any case, the fact that Python is not supported on iPhone rules this out as a cross-platform option.

    I think that the only way to build a truly cross-platform app supporting Android and iPhone is by means of HTML5. Of course, HTML5 apps are not fully native, but you might come-up with a mixed design where you use HTML5 content hosted locally on the device or on your site and display it in a native veb view.

    Pure HTML5 apps are not fully native in that they are HTML5 and not CocoaTouch (Android) apps. They only can do what HTML5 allows and with an HTML5 look-and-feel. One major limitation is the unavailability of special hardware available on the device, like the accelerometer, the gyro, whatever. They offer, anyway, much flexibility and the maximum of cross-platform compatibility.

    This is an extreme. The other extreme is "fully native apps", i.e. apps developed in Objective C/Cocoa Touch or Java/Android. Full access to the SDK, to special hardware, native look and feel, no compatibility across platforms.

    There is a third possibility, which is a mixed app. You can define a native skeleton UI (say, on iPhone, a navigation based app) and provide the content of your view and the detailed interface through HTML5. The skeleton UI will not be portable, but it will allow you to do much more that what you could on a pure HTML5 app. This approach usually requires the use of an HTML viewer class in your app, so that you have: skeleton UI + native web viewer + HTML5 content.

    About "HTML5 content hosted locally on the device": you can either host your HTML5 app on a web server, or locally to the device and load it from there (no web access).