简体   繁体   English

我可以为Android制作HTML5游戏吗?

[英]Can I make an HTML5 game for Android?

Ok to be more specific... can I program an android app in Java that has something like a web view to which I can point to local files on the phone? 好的更具体......我可以用Java编写一个Android应用程序,它有类似Web视图的东西,我可以指向手机上的本地文件吗?

I'm thinking about making an android game and i'm wondering if it can be done with a little HTML5 and Javascript that is locally stored on the phone. 我正在考虑制作一款安卓游戏,我想知道是否可以使用本地存储在手机上的一些HTML5和Javascript来完成。 I heard something about a web view in Java and that is why I am wondering if it could work. 我听说过Java中的Web视图,这就是为什么我想知道它是否可行。

Is this even possible? 这甚至可能吗?

As the other answers might be correct, there is a much simpler way: 由于其他答案可能是正确的,因此有一种更简单的方法:

If you know html5 programming, you can do a simple Android app that has one Activity containing one WebView . 如果你知道html5编程,你可以做一个简单的Android应用程序,其中一个Activity包含一个WebView In that webview you load your index.html and there you go. 在该webview中,您加载index.html然后就可以了。 You can basically do anything you would do on a normal web app. 您基本上可以在普通的Web应用程序上执行任何操作。

PhoneGap and Appcelerator are for cross platform development and they provide access to the hardware (vibration, sensors etc) and they give you the possibility to build the native UI with html and javascript. PhoneGap和Appcelerator用于跨平台开发,它们提供对硬件(振动,传感器等)的访问,并且它们使您可以使用html和javascript构建本机UI。 For a pure WebApp they are not the correct frameworks/tools I think. 对于纯WebApp,我认为它们不是正确的框架/工具。 I might be mistaken, but a WebGL Benchmark I wrote for PCs worked out of the box in the android browser and I justed used html5 and JavaScript. 我可能会弄错,但我为Android编写的WebGL基准测试在Android浏览器中开箱即用,并且我使用了html5和JavaScript。

Your answer is yes, your solution is phoneGap 您的答案是肯定的,您的解决方案是phoneGap

http://phonegap.com/ http://phonegap.com/

肯定是,请查看appcelerator.com,phonegap.com等你可以去google“跨平台移动开发”那里有一些简洁的html javascript框架

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM