开发使用HTML,CSS和JavaScript的Andr​​oid应用CSS、HTML、JavaScript、oid

2023-09-12 10:46:28 作者:好好赚

我想开发使用HTML,CSS和JavaScript在Android SDK中的Andr​​oid应用程序。我不想使用像钛和手机的差距的另一种工具。

I would like to develop android application using html,css and javascript in android sdk. I dont want to use another tool like titanium and phone gap .

是否有可能使用HTML,CSS和JavaScript,使应用程序?

Is it possible to make application using the html,css and javascript ?

是Android的Web应用程序不如原生应用程序?可以相同的功能通过Web应用程序来实现?

Are Android web apps as good as native apps? Can the same functionality be achieved through web apps?

如果是在本机应用程序的比较好,所以任何一个可以告诉我正确的方式做到这一点,或给我提供很好的教程?

if it is good in comparison of native application , so can any one tell me the proper way to do this or provide me good tutorial ?

推荐答案

简短的回答:是的,你可以开发使用HTML / CSS / Javascript的应用程序。举两个的WebView教程,叫我在上午。

The Short answer: Yes, you can develop apps using HTML / CSS / Javascript. Take two WebView Tutorials and call me in the morning.

长的答案: 如果要编写使用HTML / CSS / Javascript的应用程序为Android,你必须至少创建一个本地的WebView包装。这是比较容易做到的 - 除非你想挂接到本机的功能,如加速计,摄像头,甚至吐司消息(弹出,当事情发生的小消息)

The Long Answer: If you want to write apps for Android that use HTML / CSS / Javascript, you'll have to at least create a native WebView wrapper. This is relatively easy to do -- unless you want to hook into native functions, such as the accelerometer, camera, or even the Toast Messages (the little messages that pop up when something happens).

通过web视图访问本机的硬件和软件要求你写一个JavascriptAdapter(Android中使用2+),并定义了JavascriptAdapter一些自定义JavaScript方法。那些方法映射到一个Java函数,DOES有权访问本地操作系统设施

Accessing the native hardware and software through a webview requires you to write a JavascriptAdapter (available in Android 2+), and define some custom Javascript methods in the JavascriptAdapter. Those methods map to a java function, which DOES have access to the native OS facilities.

框架,例如Appcelerator的和PhoneGap的做正是这一点,但他们已经编写的JavaScript功能为你,所以它使您不必写这些吧。

Frameworks such as Appcelerator and PhoneGap do exactly this, except they've already written the javascript functions for you, so it saves you from having to write those yourself.

在这个意义上说,如果你打算使用HTML / CSS / Javascript来写的Andr​​oid的应用程序,是有意义的使用框架。否则,你正在做的工作你自己。

In that sense, if you're going to write an app for Android using HTML / CSS / Javascript, it makes sense to use a framework. Otherwise, you're doing that work yourself.