Programming the Mobile Web : Widgets and Offline Webapps - Platforms (part 3) - webOS & Android

- Free product key for windows 10
- Free Product Key for Microsoft office 365
- Malwarebytes Premium 3.7.1 Serial Keys (LifeTime) 2019

3. webOS

The new webOS created by Palm (acquired by HP) is the first operating system where all possible native applications are developed using web technologies. Every application on a webOS device is created using HTML, CSS, and JavaScript, possibly with C and C++ plug-ins using the Plug-in Development Kit (PDK).

You can download the SDK, the PDK, and all the documentation from You’ll also find an Eclipse-based plug-in for code hinting and help in the design of these applications here.


webOS has the only web-based IDE solution for creating mobile applications. Ares ( is a free mobile development environment with code support where you can visually design webOS applications.

A native web application for webOS is also called a Mojo application. Mojo is a JavaScript UI library based on the popular Dojo library that is generally used for creating webOS applications.

Every webOS application has a main HTML base file, an icon file, a configuration file (appinfo.json), a list of source files (sources.json), and an app folder with all the contents of each scene. A scene is a screen that shows information to the user, divided into an assistant (a JavaScript file for the behavior) and the view (an HTML file).

The appinfo.json file looks like this:

"id": "com.mystuff.hello",
"version": "1.0.0",
"vendor": "My Company",
"type": "web",
"main": "index.html",
"title": "Hello World",
"icon": "icon.png"

Every application is packaged in an .ipk file, created either with the Eclipse plug-in or using the palm-package command-line tool provided by the SDK.

Mojo allows JavaScript applications to have access to all the features of the phone using the Service APIs: Accelerometer, Accounts, Alarms, Application Manager, Audio, Browser, Calendar, Camera, Contacts, Document Viewers, Download Manager, Email, GPS, Maps, Messaging, People Picker, Photos, System Properties, Video, and more.


If you don’t like the Mojo framework, you can use other frameworks for the UI. There is even a PhoneGap implementation for Palm webOS with instructions available at

The Mojo framework also includes many UI controls designed for optimal visualization in the operating system. You can use it using an empty div with the x-mojo-element attribute. For example:

<div x-mojo-element="ToggleButton" id="button"></div>

3.1. Distribution

You cannot serve an IPK package from your own website. The end-user devices can only install applications from a trusted source, such as the official store. To publish an application in the store, you will first need to apply for a Palm Developer Program account (free for open source projects and with a $99 fee for a full account).

Once you have an account, you can publish your applications to the App Catalog, the official webOS store. The applications can be distributed as free or premium content.

If you want to distribute an application from your own website instead, you can use the Web Distribution mechanism, which allows you to publish your IPK file without Palm review approval. You will receive a unique URL to give to users on your website to install the application. Again, the application can be distributed as either free or premium content, but there is no fee associated with this publishing method.

For premium content, you will receive 70% of the revenue generated by your application. You will be paid through PayPal. All the application links are offered as public RSS files to anyone that wants to integrate them in their websites.

3.2. HTML 5 applications

For the webOS browser, you can also create HTML 5 applications that the user can add as favorite websites without any Palm Developer Program subscription needed. These applications will not have access to the Mojo toolkit or the other advantages of full native applications. However, they will be able to use AppCache, offline storage, and possibly geolocation features.

Remember to use a short title for the webapp. You should encourage the user to add the webapp to the Launcher using WebPageAdd to Launcher. Unfortunately, webOS does allow us to define an icon; it will use the title and a little top-left corner screenshot of the website to identify it. You can insert an icon there to emulate icon definition. When the user has added your webapp, it will be available as an icon in the applications menu.


There is no way to know if the user has already added the webapp to the Launcher, or if it was opened using that icon or the URL.

The user can also use the Bookmark feature, which displays a screenshot of the page as the icon.

4. Android

Android devices don’t yet have an iPhone-similar way to create full-screen webapps using only markup. So, for mobile widget development, we have two options:

  • Create an HTML 5 webapp that will finally open inside the browser.

  • Use a hybrid solution like PhoneGap.

4.1. HTML 5 webapp

Creating a webapp for Android devices is similar to creating one for Palm devices: you can develop an HTML 5 application that uses AppCache, offline storage, and maybe some Google Gears APIs, and the user can add it to the bookmarks. Once it’s been bookmarked, we can provide instructions to the user to add the application’s icon to the home screen. The instructions vary depending on the Android version. For Android 1.x devices:

  1. Add this page to bookmarks using MenuBookmarksAdd to Bookmark.

  2. Long press the new bookmark entry and select “Add shortcut to Home.”

For Android 2.X devices, like the Motorola Droid or Nexus One:

  1. Add this page to bookmarks using the bookmark icon (you can even provide a visual icon to the user) and select Add Bookmark.

  2. Long press the new bookmark entry and select “Add shortcut to Home.”

The home screen shortcut will use the icon specified in the apple-touch-icon-precomposed link tag as the first option for the high-quality icon or the favicon.

4.2. PhoneGap solution

If you want to use PhoneGap, you should download the package and download the Android SDK. In Eclipse (with the Android plug-in already installed), go to FileNew ProjectAndroid and point it to the android folder in the PhoneGap package.

Copy all your HTML, CSS, JavaScript, and image files to the android_asset folder (you can leave the demo files already in that folder or replace them).

Then, edit the /res/value/strings.xml file and change the value of the url field to file:///android_asset/index.html.

Build and test your application.


Android also supports home widgets as applications that run in the background and show their contents on the home screen, similar to the home screen widgets in Symbian. These are not web applications, but rather Android Java applications, available since version 1.5.

4.2.1. Distribution

You can distribute your PhoneGap Android application via your own website, serving the .apk file with the right MIME type: application/

You can also distribute your application in the Android Market, the official store from Google. Other stores will be available soon, from other companies like Motorola.

You can apply for an Android Market account at; the initial fee is $25. You will be able to publish free applications from anywhere and premium applications if you are located in one of the available premium application countries (the U.S. and the UK, at the time of this writing). You will receive 70% of the revenue from your premium web applications.

You can also distribute your Android applications via Motorola’s official store, Shop4Apps. You can create a free publisher account at

  •  Programming the Mobile Web : Widgets and Offline Webapps - Standards
  •  Mobile Application Security : BlackBerry Security - Networking
  •  Mobile Application Security : BlackBerry Security - Local Data Storage
  •  Themes on Windows Phone 7 Devices (part 2) - Changing the Theme & Detecting the Currently Selected Theme
  •  Themes on Windows Phone 7 Devices (part 1) - Applying a Theme
  •  Programming the Mobile Web : Mobile Widget Platforms
  •  Programming the Mobile Web : Geolocation and Maps - Showing a Map
  •  Mobile Application Security - BlackBerry Security - Permissions and User Controls (part 2)
  •  Mobile Application Security - BlackBerry Security - Permissions and User Controls (part 1) - RIM Controlled APIs
  •  Windows Phone 7 Development : Working with Controls and Themes - Introducing the Metro Design System
    Top 10
    Free Mobile And Desktop Apps For Accessing Restricted Websites
    MASERATI QUATTROPORTE; DIESEL : Lure of Italian limos
    TOYOTA CAMRY 2; 2.5 : Camry now more comely
    KIA SORENTO 2.2CRDi : Fuel-sipping slugger
    How To Setup, Password Protect & Encrypt Wireless Internet Connection
    Emulate And Run iPad Apps On Windows, Mac OS X & Linux With iPadian
    Backup & Restore Game Progress From Any Game With SaveGameProgress
    Generate A Facebook Timeline Cover Using A Free App
    New App for Women ‘Remix’ Offers Fashion Advice & Style Tips
    SG50 Ferrari F12berlinetta : Prancing Horse for Lion City's 50th
    - Messages forwarded by Outlook rule go nowhere
    - Create and Deploy Windows 7 Image
    - How do I check to see if my exchange 2003 is an open relay? (not using a open relay tester tool online, but on the console)
    - Creating and using an unencrypted cookie in ASP.NET
    - Directories
    - Poor Performance on Sharepoint 2010 Server
    - SBS 2008 ~ The e-mail alias already exists...
    - Public to Private IP - DNS Changes
    - Send Email from Winform application
    - How to create a .mdb file from ms sql server database.......
    programming4us programming4us