Palm Developer Network Blog

November 14, 2009

Mojo SDK 1.3.1 Now Available, featuring Pixi emulator support and docs enhancements

Filed under: — Chuq Von Rospach @ 1:19 pm

Now that Palm Pixi is on the verge of shipping, we’ve released both webOS version 1.3.1 and the new version of the Mojo Software Development Kit.

The highlights of the Mojo SDK version 1.3.1 release are the following;

  • Enhanced Pixi support in emulator
  • API to keep screen from auto-dimming
  • Auto-generation of app Help / Support scene
  • Numerous framework doc enhancements

Elaborating a bit on the last item, we’ve heard the developer community’s feedback about webOS docs loud and clear. You’ll see the first efforts to expand, clarify, and improve quality of the docs with this release. Notably, we’ve provided new step-by-step installation instructions, with more thorough information about how to get your system ready before you download and install the SDK. Start on our Download page by selecting the version of the SDK you’d like to use.

For more complete information about Mojo SDK Version 1.3.1, see the Release Notes on webOSdev.

November 13, 2009

What’s Happening in webOSLand

Filed under: — Chuq Von Rospach @ 12:00 pm

What’s happening in webOSland is a collection of interesting links to articles and conversations about webOS and webOS development. If you have something you think we might want to include in future postings, you can send it to us at pdn@palm.com or via twitter to @webosdev

November 6, 2009

What’s Happening in WebOSLand

Filed under: — Chuq Von Rospach @ 12:00 pm

What’s happening in webOSland is a collection of interesting links to articles and conversations about webOS and webOS development. If you have something you think we might want to include in future postings, you can send it to us at pdn@palm.com or via twitter to @webosdev

  • Prethinking: Interview: Twee, Feeds, and WootOn! We speak to Delicious Morsel about WebOS and their apps.
  • Jay Geiger has some suggestions on how to debug webOS Apps based on things he learned writing Cell Stalker.
  • Pre101 has done a nice interview with Jason Robitaille, who’s been very involved with the homebrew community.

November 5, 2009

webOS game development lessons learned: Self Aware at the Sprint Developer Conference

Filed under: — Chuq Von Rospach @ 1:58 pm

Dan Kurtz, the resident web expert at Self Aware Games, joined Palm on-stage at the Sprint Developer Conference to share his team’s lessons learned from having developed two games for webOS, Word Ace and Card Ace.

The team came to webOS thinking that first reports made it an attractive platform for some of their gaming ideas, especially if they matched the games to webOS core capabilities, such as always-on web connectivity, easy text entry from a physical keyboard, and multitasking. That said, they didn’t take the task of developing a webOS game lightly. As Dan said, “A new platform means problems. Developing a new game means problems. So developing a new game on a new platform meant problems squared.”

To help manage the risk inherent in such an undertaking, they prototyped their first game, Word Ace, on iPhone, since they already had experience on the platform and could get to a playable app quickly. When they turned to implementing the same functionality on webOS, they were able to take advantage of their knowledge of JavaScript, focus on learning the new platform, and implement already-robust features without having to solve for multiple unknowns.

Dan summarized their lessons learned in a few brief points. To paraphrase him:

  • Happiness is designing for a single, cutting-edge web environment, which is provided by webOS
  • To develop great games on webOS, you need extremely detailed knowledge of JavaScript and CSS
  • You can make your life much easier if you design your game around the webOS strengths summarized above
  • When you need help or to learn more, use resources on the web including Palm’s webOSdev community forums and open source code.

You can read a lot more about Self Aware and its early webOS development experience in the webOSdev profile of Self Aware Lead Designer Seppo Helava in the “Getting Their Mojo Working” series.

Palm at the 2009 Sprint Developer Conference

Filed under: — Chuq Von Rospach @ 11:05 am

Here’s a summary of all our postings — starting with the latest entry — about Palm’s activities at the Sprint Developer Conference, which was held October 26-28 in Santa Clara.

November 3, 2009

webOS developers at Sprint Developer Conference: Pivotal Labs

Filed under: — Chuq Von Rospach @ 1:52 pm

Palm engineers had a lot to say at the Sprint Developer Conference. Instead of trying to have the last word about webOS development, Palm shared the stage with four of your colleagues‹developers who already have apps available on Palm Pre. We thought you’d want to get a glimpse of what they had to say.

Chris Sepulveda from Pivotal Labs demoed their first webOS app, the Twitter client Tweed, as well as Scoop, an RSS reader that’s just about to hit the catalog. He mentioned that Tweed was really Pivotal’s chance to kick the webOS tires, to try it out and see what they could do with it. “It was our ‘Hello World’ app, so to speak,” Chris said, “and it took us a couple of months to finish it.” By the time they got to Scoop, Pivotal engineering already had enough experience with webOS and the MOJO SDK that they were able to complete development in weeks.

Among the reasons Pivotal decided to jump into webOS were that Pivotal engineers had a lot of experience coding in JavaScript from their web dev project and because of that they were able to experiment and iterate with ease. It also made it easy do test-driven development, a style favored by the Pivotal team. (You can read more about test driven development and webOS in the webOSdev article, Mojo Test Framework. Additionally, they felt that webOS allows for a “stickier” user experience rather than one that prompted users to get in and get out quickly.

Next he turned to the Mojo SDK and Framework. Chris said it was really easy to learn for those with experience with JavaScript and, in particular, Ajax, adding that if you only know request/response web development the transition to Mojo would be more difficult than if you are used to asynchronous programming techniques. He also pointed out that you really don’t have to use much CSS or HTML if you use native Mojo widgets and default styling, and if you decide to use your own widgets/styling, things get interesting fast.

He concluded with a couple of general points for web developers considering webOS development: First, when building a mobile app, you have to be much more concerned with ergonomics, that is your use of space and how users reach each part of your application. And, second, he suggested that webOS lets the developer focus on building the best applications, not simply
applications that work.

Don’t forget to read the webOS developer profiles series, “Getting Their Mojo Working,” in the webOSdev magazine.

October 30, 2009

What’s Happening in webOSland

Filed under: — Chuq Von Rospach @ 12:00 pm

What’s happening in webOSland is a collection of interesting links to articles and conversations about webOS and webOS development. If you have something you think we might want to include in future postings, you can send it to us at pdn@palm.com or via twitter to @webosdev

October 27, 2009

Palm Engineer Demos the Wonders of webOS at the Sprint Developer Conference

Filed under: — Chuq Von Rospach @ 6:55 am

Until now, we’ve been pretty nontechie here, but what Palm Engineer Matt Hornyak did during his talk at the Sprint Developer Conference today was so cool that we have to get really technical here, at least for today.

Matt is the lead engineer on the webOS phone app. He also wrote Clock, which ships with Pre. In front of the gathered masses at the Sprint conference - somewhere around 500 of them - he went deep inside Clock. Matt explained his motivation in writing it and then described the design and coding of it.

All great stuff, but he saved the best for last. Wanting a way to change the length of the snooze alarm in the Clock app, Matt cooked up the code, added it to the app, and - voila - Clock had snooze control, running on the device I might add. And all this in about five minutes, in front of a live audience.

Here is the code he used for the control, with Matt’s annotations (in boldface) about what each section does. You might want to take a look at Clock and try adding this yourself, although if you’re not really experienced with JavaScript and Mojo yet, you might not want to make this the first thing you try.

If this is over your head, hang in there. We’re collaborating with Matt on an article about Clock that will include more detailed instructions on how to add the snooze feature. Consider this a sneak preview.

More from the Sprint conference later this week. Check back, ok? Out for now.

Listing 1. Adds the new widget, and the borders around it.

Index: app/views/settings/settings-scene.html
===================================================================
— app/views/settings/settings-scene.html    trunk)
+++ app/views/settings/settings-scene.html    (demo)    @@ -33,5 +33,16 @@
</div>
</div>
</div>
+
+    <div class=”palm-group”>
+        <div class=”palm-group-title”>
+            <span x-mojo-loc=”>snooze</span>
+        </div>
+        <div class=”palm-list”>
+             <div class=”palm-row single”>
+                <div id=”snoozeduration” x-mojo-element=”ListSelector”></div>
+            </div>
+        </div>
+    </div>

Listing 2. Changes settings assistant to set up new widget, and respond to events from it.

Index: app/controllers/settings-assistant.js
===================================================================

— app/controllers/settings-assistant.js    trunk)
+++ app/controllers/settings-assistant.js    demo
@@ -1,6 +1,26 @@
/* Copyright 2009 Palm, Inc.  All rights reserved. */

var SettingsAssistant = Class.create({
+    // values for snooze duration listselector
+    snoozeDurationChoices: [
+        {
+            label: $L("5 min."),
+            value: 5
+        },
+        {
+            label: $L("10 min."),
+            value: 10
+        },
+        {
+            label: $L("15 min."),
+            value: 15
+        },
+        {
+            label: $L("8 hrs."),
+            value: 480
+        },
+    ],
+
initialize: function(settings, themes, onThemeChange) {
this.appController = Mojo.Controller.getAppController();

@@ -14,6 +34,7 @@
this.initializeSettings();

this.onKeyPress = this.onKeyPress.bind(this);
+        this.onSnoozeDurationChange = this.onSnoozeDurationChange.bind(this); // event handler for snooze duration list handler

this.easterString = “”;

@@ -22,8 +43,12 @@
// VERY IMPORTANT: UI for ringer switch has OPPOSITE MEANING of variable
// it’s reversed here for display and must be reversed back when saving
initializeSettings: function() {
-        this.settingsModel = { };
-        this.settingsModel.ringerSwitchObeyed = !(this.settings.ringerSwitchObeyedGet());
+        this.settingsModel = {
+            ringerSwitchObeyed: !(this.settings.ringerSwitchObeyedGet()),
+            snoozeDuration: this.settings.snoozeDurationGet() // load setting for snooze duration into scene’s model
+        }
+
+
},

setup: function() {
@@ -50,6 +75,15 @@

this.controller.get(’theme_set’).observe(Mojo.Event.tap, this.onThemeSelect);

+        this.controller.setupWidget(’snoozeduration’, { // setup snooze duration’s listselector widget
+            label: $L(’length’),
+            choices: this.snoozeDurationChoices,
+            modelProperty: ’snoozeDuration’,
+            labelPlacement: Mojo.Widget.labelPlacementLeft
+        }, this.settingsModel);
+
+        this.controller.listen(’snoozeduration’, Mojo.Event.propertyChange, this.onSnoozeDurationChange);
+
this.controller.listen(this.controller.sceneElement, Mojo.Event.keypress, this.onKeyPress);

},
@@ -74,6 +108,10 @@
this.settings.ringerSwitchObeyedSet(!(this.settingsModel.ringerSwitchObeyed));
},

+    onSnoozeDurationChange: function() { // respond to events on list selector widget
+        this.settings.snoozeDurationSet(this.settingsModel.snoozeDuration);
+    },
+
themeUpdate: function() {
var theme = this.themes.getCurrentTheme();
this.controller.get(’theme_name’).textContent = this.themes.getNicename(theme.name);

****end of framework-specific code; the rest is app-specific


Listing 3. Changes settings model to get/save snooze length.
Index: app/models/settings.js
===================================================================
— app/models/settings.js    (trunk)
+++ app/models/settings.js    (demo)
@@ -36,7 +36,8 @@
timePickerInterval: 5,
dashboardHide: false,
ringerSwitchObeyed: false,
-            initialized: true
+            initialized: true,
+            snoozeDuration: 5
};

this.save();
@@ -72,9 +73,18 @@

ringerSwitchObeyedGet: function() {
return this.values.ringerSwitchObeyed;
-    }
+    },

+    snoozeDurationGet: function() {
+        return this.values.snoozeDuration || 5
+    },
+
+    snoozeDurationSet: function(value) {
+        this.values.snoozeDuration = value;
+        this.save();
+    },
+
});

Settings.kCookieKey = “settings”;

Listing 4. Changes alarm model to have adjustable snooze time.
Index: app/models/alarm.js
===================================================================
— app/models/alarm.js    (trunk)
+++ app/models/alarm.js    (demo)
@@ -341,12 +341,19 @@
},

// snooze this alarm.  pass true to indicate that it was snoozed by another popup opening
-    snooze: function(alarmInterrupted) {
+    snooze: function(alarmInterrupted, duration) {
var newParams = Alarm.kAlarmLaunchParams.evalJSON();
newParams.params.id = this.id;
if (alarmInterrupted) {
newParams.params.alarmInterrupted = true;
}
+
+        if (duration) {
+            duration = “00:” + duration + “:00″
+        } else {
+            duration = Alarm.kAlarmSnoozeDuration;
+        }
+
var newParamsJSON = Object.toJSON(newParams);
this.schedulerSetRequest = new Mojo.Service.Request(Alarm.kAlarmSchedulerUri, {
method: “set”,
@@ -355,7 +362,7 @@
“key”: Alarm.kAlarmSchedulerKeySnooze+this.id,
“uri”: Alarm.kAlarmLaunchUri,
“params”: newParamsJSON,
-                ”in”: (alarmInterrupted ? Alarm.kAlarmSnoozeInterruptedDuration : Alarm.kAlarmSnoozeDuration)
+                ”in”: (alarmInterrupted ? Alarm.kAlarmSnoozeInterruptedDuration : duration)
},
onSuccess: function(payload) {
// Mojo.Log.info(”Alarm: snooze succeeded”);

Listing 5. Changes ring notification to get snooze length.

Index: app/controllers/ring-assistant.js
===================================================================
— app/controllers/ring-assistant.js    (trunk)
+++ app/controllers/ring-assistant.js    (demo)
@@ -5,6 +5,7 @@
initialize: function(params){
this.appControl = Mojo.Controller.getAppController();
this.appAssistant = this.appControl.assistant;
+        this.settings = this.appAssistant.settings;

this.alarmOff = this.alarmOff.bindAsEventListener(this);
this.snooze = this.snooze.bindAsEventListener(this);
@@ -55,7 +58,7 @@
} else if (this.shortSnooze) {
this.alarm.snooze(true /* short snooze */);
} else {
-            this.alarm.snooze();
+            this.alarm.snooze(false /* not short snooze */, this.settings.snoozeDurationGet());
}
},

October 24, 2009

Complete Schedule of Palm Activities at Sprint DevCon

Filed under: — Chuq Von Rospach @ 12:00 pm

We’ve got a lot going on at the Sprint Developer Conference in Santa Clara next Monday, Tuesday, and Wednesday. You’ll have a lot of chances to hear from some of our experts and members of the webOS development community and to hang out with folks from Palm. Here’s an entire schedule of our participation:

MONDAY

9:30-10:30 AM Getting Started with Palm® webOS Apps, PART 1: The webOS Opportunity and Technical Overview. Ben and Dion with Mitch Allen, Palm Software CTO

Find out why webOS has generated so much excitement in both the web and mobile developer communities, and get a look under the hood at this game-changing OS from one of the engineers who led its development.

10:40-11:40 AM Getting Started with Palm® webOS Apps, PART 2: UI and app design details. Geoff Schuller, Palm UI, and Matthew Hornyak, Palm Engineering

Geoff Schuller will start things off with a review of general webOS app HI Guidelines. Then Geoff and Matt will present a deep dive into a sample application using the webOS Clock app. Geoff will review Clock’s UI design followed by Matt who will show how the Clock app was developed with examples from the Clock’s code.

12:15-1:15 PM Getting Started with Palm® webOS Apps, PART 3: Developer Showcase.

Ben and Dion with Chris Sepulveda (Pivotal Labs), Lawrence Davison (Mark/Space), Alex Pachikov (Evernote), and Dan Kurtz (SelfAware)
Four developers with apps in the Palm App Catalog demo their work and talk about how they got started with webOS. Hear about the challenges they encountered along the way and how they met them, and find out how each of them used skills developed writing for other environments to decrease the webOS learning curve.

1:25- 2:25 PM Getting Started with Palm® webOS Apps, PART 4: Working With Palm: Tools, programs, and app distribution. Ben and Dion with Stephen Feaster, Palm Developer Technical Support

Get ready for the webOS coding workshop Monday night by watching us demo the Palm Mojo SDK to build, debug, and run a simple app. Also, learn about Palm’s developer program and app distribution plans.

7:00-9:00 PM Coding Session: Up and Running with the Palm® Mojo™  SDK

Palm Developer Support Engineer Steven Feaster and other Palm resident webOS experts lead an informal workshop to help you get started with webOS app development. Palm’s staff will be there to provide individual and group hand-holding and instruction as you get up and running on webOS. Bring ideas for cool mobile apps and a wide open mind. And be sure to bring your laptop with Mojo SDK installed,please. To get the SDK, go to developer.palm.com and follow the signs to download. Food and cold beverage will be served!

TUESDAY

12:15-1:30 PM Palm booth in the main exhibition hall

Come see Palm staff during lunch. Get your hands on Palm Pre and Palm Pixi, and say hello to Ben, Dion, and others from Palm engineering and developer relations.

6:30-9:00 PM Dinner reception and Palm booth

Same as above. See you there!

WEDNESDAY

12:00-1:15 PM Palm booth in the main exhibition hall

We’ll be back at the booth during lunchtime.

1:15-1:45 Palm Keynote Address: The Future of Web and Mobile, Ben and Dion

Palm’s developer relations codirectors share their vision for the future of computing and the convergence of web and mobile technologies.

It’s not too late to register. Go to http://sprintadp09.com/sprint_ADP. html

October 23, 2009

Mitch Allen, Palm HI and engineering at Sprint Developer Conference

Filed under: — Chuq Von Rospach @ 8:17 am

This just in: Palm Software CTO will be joining Ben and Dion Monday morning at the Sprint Developer Conference to deliver a technical overview of webOS. This is a great opportunity to get Mitch’s latest insight into webOS and writing webOS apps.

Later that morning, you can also hear from members of the Palm’s HI and engineering teams talk about webOS HI and app design. They’ll go way  under the covers of one of the shipping Palm apps to show you the ins and outs of how its functionality is written.

We’ll have complete details of what we’re up to on Monday at the conference — including more info about the coding session we’re hosting that evening (and yes, there will be food and cold beverage) — by tomorrow, so check back then.

If you’re going to be in Santa Clara for the Sprint Developer Conference, don’t miss it. If you haven’t registered yet, go to http://sprintadp09.com/sprint_ADP. html

Powered by WordPress