Skip to main content

Developing for Android: HTML5 and Qt

Recently read a post by my friend and ex-collegue Sai Geetha on her very famous Android blog. I am now reading her blog to start learning a bit about Android development. In her most recent post, she has listed 4 ways for developing in Android.

1. Using the Software Development Kit (SDK) with Java
2. Native Development Kit using C / C ++.
3. RenderScript using C99 - used to write faster graphics code like the Google Books page turn animation etc.
4. Android Scripting Layer using Python etc.

Just thought I'll extend the above further and add a couple of thoughts to this list...

The trend now and what is gaining a lot of traction is developing cross platform apps. So you develop once and can deploy it on multiple platforms. Java showed this promise earlier, but is slowly making way for the newer and greater things out there. One should see how the recently released Java7 will perform. And Java is still the greatest thing for Android development today. Java is also the recommended way of development for S40, the most popular set of Nokia devices. But is the spectrum changing?

Extending point 2 listed by Sai Geetha above, I would also like to draw the reader's attention to the Qt framework developed by Nokia (which acquired Trolltech). Qt is a very easy to use cross platform development framework on C++. You basically write your apps once and can compile it to multiple platforms. Already well supported on desktops (Windows, Linux, Mac), mobiles (Symbian, MeeGo) and embedded Linux platforms.

Now the Qt community has also come up with Necessitas, the Android port of Qt. One just needs to Google on this topic and you'll see quite a bit already out there, and many great demos too. So imagine, you develop your apps with Qt and can target both Android and Symbian/MeeGo devices at the same time. Thats a huge number!

But Qt is not being supported on Nokia's new primary platform, the Windows phone. Would the community take this up too? Who can stop the community?

Extending her point 4 above, Nokia has has introduced Qt Quick (QML), a scripting layer on top of the Qt framework. Quick brings in very fluid and eye catching UX to Qt apps. Most of the logic would be written using JavaScript. Very rarely would developers have to tweak the underlying C++ components. At least that is the goal. So how well QML does on top of Android is something to look forward too.

In addition to the 4 ways listed above, there is a 5th way, which I think will supercede all the other ways eventually (at least for most of the use cases), and that is developing apps using HTML5, CSS and JS. So you write code once and thats it, it will work everywhere and no recompilation required too. HTML5 widgets are catching on very fast, and its no longer just restricted for web development! So with HTML5, its no plugins, no additional layers, but just pure JavaScript. One would revert to native code rarely, where absolutely no support is available with HTML5. This "not supported" list is shrinking by the day. Today people are writing very fast web servers like Node.js using JS, and one can only wait for how the whole thing will play out. I for one, am betting big time on this 5th horse.

It was Steve Jobs who set the ball rolling with his no Flash support in his famous open letter. Soon everyone was on board. Now with the recently announced Windows 8 platform, Microsoft too has jumped on the HTML5 bandwagon. HTML5 would be their primary development platform (with of course "backward compatibility" with Silverlight, .Net etc etc frameworks) :D I just love Adobe, they are totally into authoring tools and not married to anything, including flash. I'm seeing a lot of HTML5 authoring capabilities in their upcoming tools.

HTML5 still has a long way to go, many quirks to be sorted out. But to conclude, you would need to write code once with HTML5 technologies and you can target all desktop and all mobile platforms out there. Great! Just great!

So what do you think? Do you know of more ways doing Android development? Most importantly, have you started looking at HTML5 technologies?

Comments

  1. I have seen lots of comment on HTML 5 so how new developer can start.. which is the best ide to develop and test?..

    ReplyDelete
  2. Hi Anonymous,
    I know some who do it with plain textpad and browser. For tools you can check out the last section of http://html.chetankjain.net (the site is still in initial stages)

    ReplyDelete
  3. hey please help me i lost my keystore file but i know all the details like password,alias etc

    how can i generate same keystore from this so that i can update my application with newer version on android market

    currently its not accepting my apk file on market

    please help me

    ReplyDelete
  4. Hi Bhushan,
    To my knowledge its just not possible to recover the keystore once you have lost it. You cannot regenerate the same file too. You might have to get a new keystore and republish ur apps if any. So always back up that key, mail it to yourself, so that way it'll always be on ur gmail a/c
    good luck!

    ReplyDelete
  5. What a very informative article, thank you very much for sharing these information.

    ReplyDelete

Post a Comment

Popular posts from this blog

Using duplicate IDs in HTML

Well today I'm being a bit controversial. Let us see what the HTML5 spec says about unique IDs in a HTML file. The  id  attribute specifies its element's  unique identifier (ID) . The value must be unique amongst all the IDs in the element's  home subtree  and must contain at least one character. The value must not contain any  space characters . An element's  unique identifier  can be used for a variety of purposes, most notably as a way to link to specific parts of a document using fragment identifiers, as a way to target an element when scripting, and as a way to style a specific element from CSS. Yes its been mentioned almost everywhere on the planet that ID must be unique. Now let us look at the below code, Launch dup.css #p2 {   background-color: yellow;  } dup-id.html <!DOCTYPE html> <html>   <head>     <title>Duplicate ID Tester</title> <link rel="stylesheet" href="dup.css" />  

Minimal required code in HTML5

I've encountered this question repeatedly of late. "What are the tags required at bare minimum for a html file?" Earlier there were a bunch of mandatory tags that were required for any html file. At bare minimum, the recommended structure was: (ref: http://www.w3.org/TR/html4/struct/global.html ) <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <HTML>   <HEAD>     <TITLE>A small HTML</TITLE>   </HEAD>   <BODY>     <P>Small HTML file!</P>   </BODY> </HTML> Yes, using capitals for the tags was the way to go! Those were the days of the purists and strict was the way to be. Now open your notepad and copy the above code, save the file as old.html and launch it in Chrome or Firefox. You will see only one line "Small HTML file!" shown. Now launch the developer tools in Chrome or Inspect Element in Firefox. Thi

Fixing Date, Time and Zone on RHEL 6 command line

Had to fix all time related issues on a remote RHEL 6 server which runs without any windowing system. Plain ol' command line. Documenting steps here for future reference: Check to see if your date and timezone settings are accurate: # date # cat /etc/sysconfig/clock The server I accessed had wrong settings for both the commands. Here are the steps I used to correct: Find out your timezone from the folder /usr/share/zoneinfo # ls /usr/share/zoneinfo Mine was pointing to America/EDT instead of  Asia/Calcutta Update and save the /etc/sysconfig/clock file to # sudo vi /etc/sysconfig/clock ZONE="Asia/Calcutta" UTC=true ARC=false Remove the /etc/localtime # sudo rm /etc/localtime Create a new soft link to your time zone # cd /etc # sudo ln -s /usr/share/zoneinfo/Asia/Calcutta /etc/localtime # ls -al localtime Now it should show the link to your time zone Set your hardware clock to UTC # sudo hwclock --systohc --utc # hwclock --show Update your t