2008 Headshot

The Life Unwired

with Ben Combee

Some Easy PDK Apps
2008 Headshot
[info]unwiredben
We just launched the PDK Hot Apps leaderboard; while looking at the growing list of free apps that will pick up a bonus, I had some ideas for some apps that won't take a lot of time to write but could be useful.

One is a sign generator. The SDL library lets you use Truetype fonts that you bundle with your app to draw to the screen. Take some interesting fonts, add some glow effects, and you can make a nice app for people to make messages that can be seen across a room. A "party sign" app was one of the big winners in the original Hot Apps promotion, so it would be natural to one-up that with the PDK.

Another idea is a nice 3D world time app. Show a nice 3D globe based on the current time with accurate sun charts, maybe allow touches on the screen to rotate the globe with a button to recenter it on the current GPS location.

A third idea is make a OpenGL ES-based photo viewer with some nice zoom and pan effects, aka Ken Burns mode. You can build your own copy of libcurl to do HTTP fetching of images, and grab from different Flickr tagged feeds. The UI might be a little tricky, but you can do a lot with just specializing in your own topics and maybe allowing the user to customize by editing a file read from /media/internal.

Finally, there's plenty of fun to be had by porting some of the existing SDL demos and games that are listed at http://www.libsdl.org. We fully support posting open source software in the catalog, just be sure to use a open source developer account and follow the license. That might mean adding information to your catalog description on how to get the source and build it yourself and adding notice to the user about the license terms.
  • Leave a comment
  • Add to Memories
  • Share this!

Weak Linking and Linux Shared Libraries
2008 Headshot
[info]unwiredben
This post is about esoteric dynamic linking issues on Linux... feel free to skip it if you're not a programmer.

Read more... )
  • Leave a comment
  • Add to Memories
  • Share this!

Comment Hack for appinfo.json
2008 Headshot
[info]unwiredben
I really like JSON.  It's easy to write, easy to parse, and more compact than XML, and it works great as a way to pass around method parameters and return values.  However, it has a big flaw -- there is no way to write a comment in a JSON file.  The // and /* */ syntax used by JavaScript isn't supported, so many JSON parsers will reject files that have them.

Every application on Palm webOS comes with an appinfo.json file that describes key information like it's title, where it's icon lives, and it's application ID.  For some samples I'm doing, I'd like to write some comments in appinfo.json so people know where to change the values for their application.  However, I spotted a way out.  Deep in our documentation, we note that this file can contain other JSON attributes beyond what we specify.  So, I realized that no one has to use those elements, and if you name them something ridiculous like "// c1", they're unlikely to ever conflict with an application's use.  So now, I can write things like

{
   "// c1": "The next attribute, id, defines the permanent ID for your program. Change it!",
   "id" : "com.palmdts.example",
   ...
}

without invoking the wrath of the JSON parsers.
  • 2
  • Leave a comment
  • Add to Memories
  • Share this!

Palm Blogging Moves to Official Site
2008 Headshot
[info]unwiredben
So, I had a bunch of fellow developer relations people basically jump me this morning, say they like what I've been posting, but that it really should go on the official Palm developer blog.  I'm cool with that, so effectively immediately, I'll be moving my Palm webOS-related posts over to http://developer.palm.com/blog.  I'm going to be reposting the first part of my series there, and we're getting the FAQ that I posted in part 2 turned into official Plug-In Development Kit documentation.  The true second part, the one that actually comes with code, should go up on Thursday -- I've been really busy this week with a secret project that you all should learn about soon. :)
  • 1
  • Leave a comment
  • Add to Memories
  • Share this!

Plugin Development Kit, Part 2: FAQs
2008 Headshot
[info]unwiredben
Before I jump into my sample code, there are some frequently asked questions about the current 1st beta of the Palm webOS Plugin Development Kit (PDK) that I wanted to collect here.

Note: this FAQ is about the first release of the PDK.  This is not the final version of things that will ship on device.

(Update 1: clarified camera and microphone access to indicate that you can mix Mojo and PDK to get access to images)

(Update 2: this FAQ is now an official Technical FAQ and hosted at developer.palm.com.  Go there for the up-to-date version.)

Read more... )
  • 2
  • Leave a comment
  • Add to Memories
  • Share this!

webOS and the Plugin Development Kit, Part 1
2008 Headshot
[info]unwiredben
So, I'm finishing my fourth week with the webOS developer relations team.  It's been a really fun and busy ride,  I've been asserting my presence on the developer forums and many questions have been answered.

However, I really need to be writing and making sample code.  This will help avoid questions and help a lot of people.  I'm going to be doing both of those here, with the final product getting polished and put up on the Palm Developer Site eventually.  Consider these posts a working draft.

Our Plugin Development Kit (PDK from here onward) is a set of tools and libraries for making native applications on webOS.  Most apps now are written like websites; they have HTML, JavaScript, CSS, and images, and they run inside the special version of WebKit we call LunaSysManager.  Native apps, in contrast, are actual compiled code.  They're originally written in C or C++, compiled down to ARM machine language, and run directly on the device.  WebKit is still there, but it mostly stays out of the way and just gives the PDK app a window to draw in.

We've got three APIs that are used for PDK apps.  The first is SDL (Simple Directmedia Library).  Our current release is based on SDL 1.2.  This API gives you drawing surfaces, 2D primitives, image loading, fonts, events, timers, network access, accelerometer (via joystick APIs), touch screen (via mouse APIs).  It's well described at the libsdl.org website.

The second API is PDL (Palm Direct Library, perhaps?).  This gives access to some system services like screen orientation, the location system and the device ID number.  It also has calls that allow your plugin to register methods that can be called from JavaScript.  The reference for this is online.

The final API is Open GL ES.  We support both version 1.1 and 2.0, although not both in the same program.  Open GL ES 1.1 has a fixed-function pipeline and works well for a lot of 2D and 3D applications, while ES 2.0 uses a programmable shader system which is more complicated for simple programs, but very powerful in its ability to shift vertex transformation and shading into the GPU.  I'm still learning the Open GL way, but I hope to blog about my experience getting some GL ES 2.0 sample code running on the device.

Next time, we explore some basic SDL-based sample code.
  • Leave a comment
  • Add to Memories
  • Share this!

My Merit Badges
2008 Headshot
[info]unwiredben


In going through some old clothes, I recently found my sashes and neckerchiefs from my Boy Scout days. I was in Varnell's Troop 67 from the time I graduated from Webelos to the middle of high school. I made Eagle when I was 14, about as fast as was possible, mostly through the constant prodding and help of my dad. My Eagle project was renovating a room at the old Varnell school to be the town's first library; the group cleaned out the room, redid the floor, put up shelves, and got the initial collection of donated books together.

One of the sashes was my merit badge sash. To earn the various ranks in Scouting, you have to fulfill some rank-dependent requirements, but you also have to earn a certain number of merit badges. Some ranks have specific badges you need, while others are based on your own interests.

Here's my list, first the ones required for Eagle:
  • Camping
  • Citizenship in the Community
  • Citizenship in the Country
  • Citizenship in the World
  • Communication
  • Emergency Preparedness
  • First Aid
  • Personal Management
  • Swimming
These were the elective badges that I needed to get to 21 earned for Eagle:
  • Environmental Science
  • Safety
  • Fishing
  • Scholarship
  • Firemanship (now called Fire Safety)
  • Coin Collecting
  • Fingerprinting
  • Computers
  • Basketry
  • Electricity
  • Public Health
  • Public Speaking
I remember getting a lot of the Eagle-required badges while at Camp Sidney Dew the one summer I went to Scout camp. That's where most of the requirements for Basketry, Camping, Swimming, and Safety were done. Fishing was something my dad loved to do, so it was a natural. I also had a coin collection with him, so getting that badge was easy. I think we had a detective come to the troop and lead a fingerprinting workshop and the same thing with a local fireman. The public health badge was probably due to my aunt Kaye who worked as a blood technician, and public speaking was associated with my work on the debate team in high school.

In looking back on this list, I'm actually quite surprised how relevant a lot of this was. I don't really like camping that much, but I apparently did a bit of it then. I recently found a stash of electronics part I had when I was in high school; I didn't do much with them then, but the books I picked up are proving useful now that I'm actually building gadgets and PC boards.

Scouting was a big influence on my life, and even though it has had it's share of issues over the years, I hope one day I'll be able to be active in it again with my own kids.
  • 1
  • Leave a comment
  • Add to Memories
  • Share this!

Heading Back to Palm
2008 Headshot
[info]unwiredben

If you've not seen my Twitter feed, you may not know that on Monday, I'm returning to a position with Palm. I'm heading back to be part of their Developer Relations group, reporting into the dynamic team of Ben and Dion of ajaxian fame that Palm brought in last summer to shake things up with webOS.

It was a hard decision to leave Mozilla; they've been very good to me over the last year, and I feel pretty happy about the 1.0 release of Firefox for Maemo (aka Fennec) that came out in January. I'll miss the fun chats on IRC and the visits to their offices in Toronto and Mountain View.

However, in the last year I found that my real passion lies in communication and teaching. I'd had a blast with my classes at NYC Resistor, and I've loved working with developers in past positions at Metrowerks, PalmSource, and Palm. Being the expert in an online forum suits me very well. With that background, I'm looking forward to evangelizing the webOS platform, and I hope that I'll be able to assist some people in writing great native apps and plugins on the Palm Pre and Pixi phones.

Wish me luck! I'll be posting details on my new Palm webOS developer blog as soon as it is ready to go.
Tags: , ,
  • 6
  • Leave a comment
  • Add to Memories
  • Share this!

Quick note on native Android debugging
2008 Headshot
[info]unwiredben
This is for reference by future programmers using Google to find out something on this topic.

When using gdbserver with the Android 2.0.1 emulator to debug native command line applications, you can get into a situation where it won't stop the child application, instead letting it run to its death before setting up the debug connection to gdb.  I wasn't able to figure out why this was happening, but rebooting the emulator allowed for the correct operation again.  When you start getting communication errors from gdb, a reboot is a good call as other things may be hosed.
  • Leave a comment
  • Add to Memories
  • Share this!

Delicious Spicy Spaghetti Squash
2008 Headshot
[info]unwiredben
The first time I had spaghetti squash was as a kid; it was mushy and too sweet and just didn't work for me.

Fortunately, Annelies reintroduced it to my life a couple of years ago, and I attempted my own version last night.  It was really simple and very tasty.  You can make it in about fifteen minutes.
  1. Mince garlic.  Take a few cloves of garlic, chop into little pits, and fry up those bits on medium heat in a skillet in olive oil.  You want little golden crisp pieces, about the same size and crunch as vegan bac'n bits.
  2. Stab the squash.  Take a knife and poke about sixteen slits in the squash.  I did four rows of four.
  3. Microwave the squash on high for four minutes, turn over, go for four minutes again.
  4. open a can of Rotel tomatoes.  You can pick your variety depending on your spice level.  If you don't like spicy, go for diced tomatoes and basil.
  5. Cut the squash in half lengthwise.  Use a fork to scoop out the seeds and throw those away.  Then use the fork to remove the squash flesh.  It will already be stringy, and if you use the fork to scrape out the shell, you'll have plenty of the squash threads.
  6. Put a portion of squash in a bowl, apply black pepper, salt, Rotel, and some of the garlic bits.  Put this back in the microwave for a minute to heat up the sauce.
  7. Enjoy!  You can add some grated cheese too to make it more savory.
I also tried this with some homemade pesto, but I found that creaminess didn't go as well with the slightly sweet squash as the tomato mixture.

Note: using the microwave is key.  It allows the squash to cook nicely inside the shell without getting mushy and gives it a great texture.  I think the time I had it before where I didn't like it was because the squash was cut open and cooked on a stove like noodles.
Tags: ,
  • 1
  • Leave a comment
  • Add to Memories
  • Share this!