|
What is MAX?MAX or Mobile Application XML is a new, very simple yet powerful XML declarative language which enables to define the user interface of a mobile application which runs on any mobile phone. The same you use HTML or XHTML to do web pages, you can use MAX to do the UI of your mobile application. MAX uses the same paradigm as HTML. At the most basic level, a mobile application consists of:
Creating your first MAX Application: Hello Word!Creating a mobile application is very simple and requires basic XML skills.
<?xml version="1.0"?>
<max id="mycompany.helloword" version="1.0">
<title>My First App</title>
<page id="default">
<title>Hello World!</title>
</page>
</max>
This mobile app simply displays a "Hello World" message. You notice the root node
which is always <max>, it identifies this file
as an MAX application. It has 2 mandatory attributes, id and version. id uniquely
identifies your application and version defines the version of your app, so that
you can esaily deploy new versions. This MAX application contains only one
<page> element, which has a <title>
element containing our message.Install and Test your MAX ApplicationYou can install and test your application either on the Upvise Simulator on your computer or on your mobile phone. Using the Upvise Simulator on your computer:
On your mobile phone:
Creating your second MAX application: Hello Upvise!Let's extend your first example <?xml version="1.0"?> <max id="mycompany.helloupvise" version="1.0"> <title>My Second App</title> <page id="default"> <title>Hello</title> <item>Hello World!</item> <item>Hello Upvise!</item> </page> </max>That's easy! We just added a new element <item>, actually we added 2. It simply displays Hello World and Hello Upvise! in a list. On a mobile phone you could use the up and down arrows to move up and down in the list. A more interesting example: RSS news ReaderLet's extend our first sample and add some dynamic content coming from a simple RSS feed. The nice thing about using RSS format to update content of the widget is that you can reuse existing RSS feeds available on the Internet. This way you can easily create "Mashup" applications. Let's get the Yahoo news feed, for example:
<?xml version="1.0"?>
<max id="mycompany.rssreader" version="1.0">
<title>My Third App</title>
<page id="default">
<query id="data" type="rss">http://rss.news.yahoo.com/rss/topstories</query>
<title>Rss Reader</title>
<item>{data.title}</item>
</page>
</max>
This second sample extends the first one by adding a <query> tag pointing a
to custom RSS feed. The title of each RSS item of the feed is displayed
in a list item, using the <item> tag.
|
