target both android and iphone with Python [duplicate]
Asked Answered
R

4

3

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?

Rucksack answered 2/6, 2011 at 15:47 Comment(1)
Do you need the application to run as a native?Torrefy
C
3

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).

Cincinnati answered 2/6, 2011 at 15:54 Comment(5)
This is simple enough for me.Rucksack
By the way what does all this mean: 'full native', 'HTML5 content hosted locally on the device' or 'on your site and display it in a native web view'Rucksack
From what you said can I formulate this route? With mixed approach, I can build native UI (objective-C on iPhone and Java on Android), then feed this UI with a HTML5 content via HTML Viewer class on the mobile device, which is fed from an HTML5 app on a remote web server.Rucksack
That is perfectly feasible, (minimal) native UI + HTML5.Cincinnati
+1 The one thing missing from this answer is some mention of JavaScript, which is an essential component of cross platform hybrid app frameworks like PhoneGap.Kylander
F
0

phonegap is one of the way that you can use to target the iphone & android.through the javascript,html.

Fancy answered 2/6, 2011 at 16:7 Comment(0)
F
0

The closest thing I know of are the MonoTouch and MonoDroid projects. They allow you to write C# code rather than Objective-C (for iPhone) and Java (for Android). The issue comes in the UI, since there is no generalized abstraction for the different UI models. Ideally you could write your core business/domain/whatever code in such a way that it is not tied to the UI and then get some reuse that way.

I've not seen Appcelerator, which @Snicolas mentioned, but it may do a better job at providing the total abstraction across both platforms.

Fernandes answered 2/6, 2011 at 16:9 Comment(0)
M
0

I would consider just biting the bullet and aiming for the ultimate goal of eventually learning both Java and C/Objective-C. I have some comparisons here. So perhaps write a simple app in Java/Android and then try to replicate it in iOS/C/Objective C. If you take this aim for the stars to land on the moon approach, you will forget how many languages you have learned over your life time.

Manse answered 3/6, 2011 at 1:29 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.