Ares PPG Tutorial
From WebOS101
Contents |
Ares
Ares is a good tool for creating simple applications.
- It is a simple WYSIWYG system which lets you drag and drop widgets on to the screen.
- It hides much of the complexity of tying code to the widget. Just tell it the name of the function you want to handle an event, and Ares takes care of 'wiring it up'.
- Since it is browser based, your code lives on the web, and you can get it at anywhere there is a browser. So if you are like me and end up using a number of different computers, you don't have to worry about where the 'current' source is.
- You can actually do some developing and testing without the emulator or a real device connected. This is a quick way to check a layout.
It is not good for everything. Once you get good at webOS development, you will end up wanting more control over your App. And there are not a lot of tutorials or sample applications developed with Ares.
Pronounceable Password Generator Specifications
The application we are going to develop is fairly simple, there is only one big javascript function, and we are just going to copy and paste it in because it is just a 'black box' that returns a string. We won't be going into the theory behind that function.
- Call a function pronounceable(n) which will return a string which is 'n' characters long.
- Collect enough of these strings to fill the screen and put them in a list.
- Have a button which will generate a new set of strings for the list.
- Have some way to set how many characters should be in each string.
Pretty simple right?
Learning topics
- Handle a button tap.
- Fill a list with new information and make the new information show on the screen.
- Add an 'About' entry to the application menu.
- Put up a simple Dialog in response to the 'About' menu entry.
- Enable the 'Preferences' application menu entry.
- Push a new scene in response to the 'Preferences' menu entry.
- Retrieve data from a number selector and put it somewhere that another scene can find it and use it.
- Store and retrieve preference information in a cookie.
- Create a 'standard' Help scene and link it to an expanded help scene.
Tutorials
NOTE: The tutorial assumes you are at least basically familiar with Ares and have done a simple Hello World app.
The tutorials are listed with all the visual steps first, then the code steps to attach the code to each of the visuals. You are welcome to work on them in as visual then code for each scene. Just a matter of personal preference.
If you are like me and like to do incremental testing, then you will need to complete the PPG stage-code before any of the other code sections will work.