iPad、androidPad 和 Windows 8/HTML 的单一来源?
有没有一种方法可以编写一次代码,然后在 iPad、Android 和 Windows 8(HTML 5 模式)上本地运行?所有三个都支持 HTML 5,如果我们在服务器上运行并在每个浏览器上显示,这将很容易。
但我们希望在本地运行,既是为了更快的响应,也是为了在没有网络连接的情况下(比如在飞机上)。有办法做到这一点吗?
谢谢-戴夫
Is there a way to write code once that will run locally on the iPad, android, and Windows 8 (HTML 5 mode)? All three support HTML 5 and if we were running on a server and displaying on a browser in each this would be easy.
But we want to run locally, both for a faster response and for times there is no net connection (like on an airplane). Is there a way to accomplish this?
thanks - dave
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
尝试 Phonegap,它可能会回答您的问题。
Try Phonegap, It might be answer to your questions.
如果您使用 HTML5 构建应用程序,它将只能定位 HTML5 支持的功能。虽然 HTML5 通过在本地缓存内容来支持某些离线场景,但要了解的是,所有平台上的所有浏览器供应商尚未完全规范、标准化或一致地实现此场景。
如果离线、性能和/或特定于平台的功能很重要,那么您将需要在目标设备上进行一些设置。
我强烈推荐 Mono,它使您能够使用面向 Windows、Linux 和 Windows 的编写 .NET 应用程序。 OSX 和 Xamarin 的 MonoTouch(适用于 iOS)和 Mono(适用于 Android)。
但是,请理解应用程序的 UI 部分需要独立实现,因为每个平台的 UI 概念、结构、技术和功能差异很大。因此,请务必仔细分离您的核心业务逻辑,并且应将引擎划分为一个完全分离的程序集,以便可以在所有支持的平台上重用。
If you build your app in HTML5, it'll only be able to target the features supported by HTML5. While HTML5 support some offline scenarios by caching content locally, understand that this scenario isn't yet fully specced, standardized or implemented consistently by all browser vendors on all platforms.
If offline, perf and/or platform-specific features are important, you're going to need to lay bits down on the target device(s).
I strongly recommend Mono which enables you to use write .NET applications that target Windows, Linux & OSX and Xamarin's MonoTouch (for iOS) and Mono for Android.
Understand, however, that the UI portions of your app will need to be implemented independenty because each platform's UI concepts, structure, techniques and features vary so widely. So be sure to carefully separate your core business logic and engine should be partitioned into a cleanly separated assembly that can be reused across all your supported platforms.