Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Develop android Application using Html,Css and JavaScript

Tags:

android

I would like to develop Android application using HTML, CSS and JavaScript with Android SDK. I dont want to use another tool like Titanium or PhoneGap.

Is it possible to make application using the HTML, CSS and JavaScript?

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 applications, can any one tell me the proper way to do this or provide me good tutorial?

like image 243
Chirag Avatar asked Jul 22 '11 05:07

Chirag


People also ask

Can I create Android app using HTML CSS and JavaScript?

The Short answer: Yes, you can develop apps using HTML / CSS / Javascript.

Can I develop Android app using JavaScript?

JavaScript frameworks are well-suited to mobile app development, as they can be used across a number of platforms, including iOS, Android, and Windows.

Is CSS used in Android app development?

If you want to style a native android app, there is no support for CSS. Instead android has it's own mechanism. The complete list of options is only available at the source code. You may use WebViews in your native Android app, to display HTML which is packaged with the app, then you can use CSS like in any HTML site.


1 Answers

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

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

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.

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.

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.

like image 182
John O'Connor Avatar answered Sep 20 '22 00:09

John O'Connor