Chapter 2. Application Basics

Palm webOS provides a great environment for building applications. The use of standard web development languages and tools, combined with access to native services and local data gives you a powerful and productive platform. Even Java and C/C++ developers will find that building applications using dynamic languages on webOS is fun and exciting. And despite what you might have heard, you can build real applications, not just web gadgets and spinners.

A browser-based web application is really just a set of complex web pages. They are downloaded from a web server and present their UIs as HTML, often with JavaScript as a client-side language to validate input, animate page elements, and make background Ajax calls back to the web server for additional interactivity.

If you are a developer writing these web applications, the Palm webOS development environment will feel familiar. JavaScript library code generates the HTML UI, interacts with page elements, and issues Ajax calls to web servers. You can style the UI with CSS, either to make your application look and feel consistent with Palm’s style guidelines or to make your own unique look.

The programming model is a little different. Since the HTML is not generated on a server (say, using Java, PHP, or Ruby), there is no request/response lifecycle. Instead, all of your application code is in JavaScript—even interactions with key webOS systems (UI widgets, location services, and other applications) are made with JavaScript.

If you are a developer writing desktop or other native mobile phone applications in Java or C++, the Palm webOS development environment will feel familiar as well. There is a robust API for creating UI elements, accessing local storage, and making system calls. There is an application framework that makes it simple to do common tasks.

What is different for you is that the programming language is JavaScript and the UI is generated using HTML and styled using CSS. If you’re new to JavaScript, HTML, or CSS, you may want to familiarize yourself with their fundamentals before tackling the next few chapters. Even so, the material presented here is fairly basic, and you don’t need to be a web development expert to build applications for webOS.

In this chapter, you’ll learn how to build a basic webOS application, starting with the installation of the SDK. You’ll create a new application project, customize the critical application components, and develop the first parts of the News application, which will be used throughout the book as our sample application. We will also go into detail on how to use the framework and apply the different APIs, widgets, and styles.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.222.82.221