Tuesday, 18 October 2011

Introduction to Enyo Development for webOS

Getting started from Mojo to Enyo can be quite disappointing. Looking at the Tutorial from HP, it is pretty hard and despite searching over the internet, I couldn't start it until I have done an experiment myself. Hope this will help someone and please do give your comment or feedback.

From the beginning, I have generated a Basic Application called x3 from Eclipse. You can also do this using a plain text editor if you are not using any development tool.

This is the file structure of the completed x3 application. You will find the next steps in the next paragraph.





















Next I have taken the original index.html and replace it with the following code. Note: The folder containing enyo.js must be a folder in your computer and this is an example of the SDK installed on Debian. If you are using Windows or Mac, I am sure you can enter similar information. I have put mine as follow.
index.html:











Next, I had a look at appinfo.json and added a new row "uiRevision".
appinfo.json:
{
"id": "com.petkatandevelopment.x3",
"version": "1.0.0",
"vendor": "Petkatan Development",
"type": "web",
"main": "index.html",
"title": "x3",
"icon": "icon.png",
"uiRevision": 2
}

Then, I have created a new file called depends.js which will contain the following.
depends.js:
enyo.depends(
"x3.js"
);

In the x3.js, I just put a simple control which will be rendered at run-time, as follow.
x3.js:
enyo.kind({
name: "x3",
kind:enyo.Control,
content:"testing 123"
});


Once it is completed, I will then package the IPK for deployment to the TouchPad emulator. In the command-line, type the following:
palm-package /home/peter/workspace/x3

It will then generate com.petkatandevelopment.x3_1.0.0_all.ipk in my current folder.

Next, I will install the package to the emulator:
palm-install com.petkatandevelopment.x3_1.0.0_all.ipk

You will see a sample of the app in the emulator:











When you launch this x3 app, you will see the following:

Thursday, 6 October 2011

Where Am I 2 for webOS supports eMail

Ever wonder how to tell someone of your current location when you have no idea where you are. Think no more, think Where Am I, you can send an email of your current location with Where Am I 2.