home > services 

Adaptive Path Blog

The Team

Dashboard Widgets as iPhone Apps?

by Andrew Crow

I’ve been thinking about this all weekend (as I am sure many others are). If Mac OS X Dashboard widgets are simply HTML, Javascript and CSS, AND you can test them in Safari, wouldn’t you be able to host these widgets on a web server and access them from your iPhone as an online application?

I read through Apple’s documentation and there are some hurdles. It looks like the JS for the widgets is coded to look to the Dashboard server. I am not a coder, so I’ll seek guidance from others for help with that. But, I was able to successfully “port” one widget.

I took the Tile game, copied out all the package contents and put them in a directory on my server. It’s only a test, but it worked.

See here. (Seems to require Safari web browser.)

Screenshot
Screenshot

Video

This is simply a test. It works, but there is a lot of code in the other widgets that may prevent this from being any kind of viable solution. But, if widget developers could develop 90% of the same code for both a widget and an iPhone app, it would be pretty cool.

6 Responses to “Dashboard Widgets as iPhone Apps?”

  1. Paul Grunt Says:

    SWEET!

  2. Aaron Gustafson Says:

    I was actually just wondering about this the other day. Good one Andrew.

  3. No Time to Blog - Dashboard Widgets as iPhone Apps? Says:

    [...] shows a Mac OS X widget to be hosted on a server, then accessed via iPhone as an online application.read more | digg [...]

  4. Christopher Allen Says:

    You definitely should check out the http://www.iPhoneWebDev.com community for solutions to a number of problems in creating web pages and webapps for the iPhone.

    For instance, we’ve figured out the best way to hide the URL bar — see http://groups.google.com/group/iphonewebdev/browse_thread/thread/c064b183c1207a98/dd79332910e4695c

    We have figured out how best to detect orientation change and change UI for landscape vs portrait — http://groups.google.com/group/iphonewebdev/browse_thread/thread/e041ae0357dc62dc

    A lot of discussion about best practices re: viewport –
    http://groups.google.com/group/iphonewebdev/browse_thread/thread/f43493a828dffdb3

    Dealing with various problems of scaling — http://groups.google.com/group/iphonewebdev/browse_thread/thread/b09a202d34daab51

    We are figuring out how to create objects that drag using two-finger drag — http://groups.google.com/group/iphonewebdev/browse_thread/thread/991a04799ec841f7

    Come join us helping iPhone developers help iPhone developers!

  5. Andrew Hedges Says:

    Hi Andrew,

    There is no “Dashboard server” per se, but it’s true that some of the Apple provided classes on which a lot of widgets rely are stored on the user’s file system. If a widget relies heavily on those classes, they would need to be copied to the web server in a place where the webdget(?) could get to them. Also, things like localization and widget.system calls (accessing the user’s command-line) won’t work the same way if at all, so developers would need to take that into account.

    All of that said, it’s a great idea to reuse widget code for iPhone apps. Like you say, in many cases, 90% of the code is there and available to help make the iPhone even more useful.

    Cheers,
    -Andrew

  6. Andrew Says:

    Andrew, I think you’re right. I got that phase from Apple’s Developer page on developing widgets. They reference a Dashboard Server there, but I may have misinterpreted its significance here.

    I think what you’re saying about the the classes is more of a barrier to this success. In poking through the JS and HTML of many of the widgets call on these classes to work. If they are coded to work locally, then they don’t transfer very well to a remote server.

    I’ve just returned from the iPhoneDevCamp event here in San Francisco. These guys are all wicked smart and will hopefully have some interesting things out soon! It’s an exciting time in web/hardware integration!

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>