开发者

Embedding a web based game into an Android Application

I've created a simple web based game (text driven) in PHP and have recently become very interested in moving this onto Android - originally i thought the game could be rewritten in Java but after some investigation i found you can embed pages straight into an Android applicatio开发者_C百科n.

Am i missing something or will i be able to simply embed my web application into Android and expect it to work flawlessly? Is there any issues i should be aware of? My app uses a login system utilising sessions / cookies - will this pose a problem for Android users?

I'd be interested in hearing anyones thoughts that have done something similar and any issues they've encountered. The only issue i forsee is how the page renders on different phones (although this i imagine this can be somewhat nullified by good markup and well thought out javascript) and any issues in regards to sessions / cookies?

If anyone has any good resources for doing this sort of work i'd be grateful.

As a final thought it'd be good to hear peoples thoughts on whether i should rewrite it or keep it embedded, what are the benefits of rewriting it?

Thanks


The WebView class provides access to a full fledged webkit browser. As a matter of fact, the default Android Browser itself is implemented using that very same WebView implementation. Javascript, Sessions and Cookies should be no problem whatsoever, you probably just have to activate them (see WebSettings).

Even flash should more or less work on newer devices, but I don't have any experience with that.

See http://developer.android.com/reference/android/webkit/WebView.html for further details.

Generally, using Apps as so called "launchers", i.e. apps that basically only contain a browser window are somewhat frowned upon, since the android market isn't meant to replicate the world wide web. I do somewhat understand the need for that though, since visibility is much higher and Google does not yet provide a way to treat web apps as first class citizens, like they do for Chrome OS.

On the other hand, if your app already works fine using php, I don't see any need to rewrite it in native code.


Take a look at http://phpforandroid.net/

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜