同时面向Android和iPhone使用Python [英] target both android and iphone with Python

查看:119
本文介绍了同时面向Android和iPhone使用Python的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要开发一个应用程序都针对Android和iPhone。我猜他们使用Java和Objective-C。我可以使用如Python单一的语言?它是最好的路线?我将使用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?

推荐答案

您不能在任的Andr​​oid或iPhone平台上使用Python。这显然​​是由苹果SDK许可outruled,同时与Android居然还有href=\"http://$c$c.google.com/p/android-scripting/\" rel=\"nofollow\">的Andr​​oid脚本环境的,但你会很快认识到,是不是意味着对最终用户。在任何情况下,Python中不支持iPhone上的事实,本规则作为一个跨平台的选项。

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.

我认为,只有这样,才能建立一个真正的跨平台的应用支持Android和iPhone是HTML5的手段。当然,HTML5的应用程序没有完全本地人,但你可能先得了,你使用的设备或您网站上的本地托管HTML5内容,并在本地VEB视图中显示它的混合设计。

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.

纯HTML5的应用程序都没有在完全原生的他们是HTML5而不是CocoaTouch(Android版)的应用程序。他们只可以做什么HTML5允许并与HTML5的外观和感觉。一个主要的限制是特殊的硬件的设备上可用的不可用性,例如加速度计,陀螺仪,等等。他们提供的,反正很大的灵活性和最大的跨平台兼容性。

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.

这是一个极端。另一个极端是完全原生应用,即在Objective C /可可触摸或Java / Android的开发的应用程序。完全访问SDK,以特殊的硬件,本身外观和感觉,跨平台不兼容。

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.

有第三种可能性,这是一个混合应用。你可以定义一个原生UI框架(比如,在iPhone上,基于导航应用),并提供您的视图的内容,并通过HTML5详细的接口。骨骼UI不会是便携,但它可以让你做更多的什么,你可以在一个纯粹的HTML5应用程序。这种方法通常需要在你的应用程序中使用的HTML浏览器类,让你有:骨架UI +原生的Web浏览器+ HTML5内容

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.

关于HTML5本地存储内容在设备上:您可以承载您的HTML5应用程序的Web服务器上,或本地到设备,并从那里加载它(无网络接入)

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

这篇关于同时面向Android和iPhone使用Python的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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