Developing Flash Lite Widgets for the Chumby Platform
I gave this Chumby talk a few times at local events and other places. I also placed it online as a reference for dozens of Chumby widget application developers to leverage.
Air • Community, blogging, training • Coauthor, speaker, enthusiast, evangelist • Flash Lite 1.1, 2.x, 3.0 • Company • Bio: http://www.scottjanousek.com/About.html • Gadget Lover • Psyched about the potentials for Chumby
Linux Based • Open Platform • Non‐Portable* • Wi‐Fi enabled* • chumby.com portal • Runs “widgets” (aka Flash Lite SWFs) • Flash Enabled ‐ UI and Widgets • Your personalized desk buddy * As shipped – may be modified through hacks and mods
(over‐the‐air) from Chumby Network • Widget Configuration SWFs – Customize via web • Share widgets via: – Portal Categories – Send directly from Chumby via your “Chum‐lists” • Widget SWFs in “channels” (think T.V.) • Widget Duration – 1 second minimum – Can be customized by user
• 1 or more channels for each chumby • Each widget has a defined playtime internal – one second to FOREVER (user must enable, later) TIME 5 Widgets in channel “foobar” 15 seconds 15 seconds 5 seconds 2 minutes
color display • Accelerometer – Force and movement in X,Y,Z • Toggle/Bend Switch – Used for UI/Menu panel navigation • Voice (Microphone support ( through Flash = not yet) ) • Hacks and “mods” also possible
Player • Performance improvements over Flash Lite 2.x • Integrated Development Environment – Adobe Flash CS3 + Adobe Device Central • .FLV (“Flash Video”) support • Flash Player updated OTA (over the Air) • Chumby APIs • Flash Lite Development Practices still apply!
• Easy, no updates required • Need to be aware of constraints of Flash Lite! Flash Lite 3 and ActionScript 2 • Unsupported features of Flash 8 will be disabled • Utilize Device Central • Code Hinting • FL3 Updates needed
the last raw touchscreen X coordinate _rawY = ASnative(5,11); // get the last raw touchscreen Y coordinate Display _getLCDMute = ASnative(5,19); // get the value of the LCD "mute" _setLCDMute = ASnative(5,20); // set the value of the LCD "mute" _setLCDMute(0); // full on _setLCDMute(1); // dim _setLCDMute(2); // full off Speaker _getSpeakerMute = ASnative(5,17); _setSpeakerMute = ASnative(5,18); _setSpeakerMute(1); DC Power _dcPower = ASnative(5,16); Accelerometer _accelerometer = ['ASnative'](5,60); version = _accelerometer(0); timestamp = _accelerometer(1); currentX = _accelerometer(2); currentY = _accelerometer(3); currentZ = _accelerometer(4); avgX = _accelerometer(5); avgY = _accelerometer(6); avgZ = _accelerometer(7); impactX = _accelerometer(8); impactY = _accelerometer(9); impactZ = _accelerometer(10); impactTime = _accelerometer(11); impactHints = _accelerometer(12); Bend Sensor _bent = ASnative(5,25); // get the "bent" flag (0/1)
Flash 8 Security – Crossdomain.xml – Publish Settings • Network Access Only • Proxying data – Setup your own server to connect external one – Communicate between Widget and your server • For more info – Adobe Flash 8 Security Whitepaper • http://www.adobe.com/devnet/flashplayer/articles/flash_player_8_security.pdf
– Embedded on timeline – Attaching from library – Loading from remote server (not streaming) • Toggle – Consider having a toggle – Default to disabled sound state
owner (Ex: “Sue”) _chumby_widget_instance_id Unique GUID assigned to each widget instance (Ex: 12121212‐1212‐1212‐1212‐121212121212) _chumby_user_name Chumby owner username (Example: “scott”) Widget Configuration Variables this[ ‘foobar’ ] Widgets that have a desktop configuration can set custom variables which each widget instance. • Think of as Flashvars, or “environmental” variables (as in UNIX) Usage: trace( this[ ‘_chumby_chumby_name’] ); trace( this[ ‘foobar’ ] );
names • Enlarge hit areas of button states • Use LARGE (and readable) TEXT • Implement Co‐operative mode • Keep file size small (< 200k) • Avoid lengthy preloaders • Device Central Chumby Profile • Sound should always be optional • Toggled version textfield for each Widget (Ex: v1.20) • More soon … contained in: – Chumby “1‐sheet” PDF reference ‐ Coming Soon
• Adobe Device Central – My Chumby Profile – Not Certified! On Device • USB Stick – Bootable USB Stick with SWF • NFS – Setup mounted drive • Upload to Chumby Portal – Single channel – Single widget – Manually Refresh Widget • Send to Friend – “Chumby List” • Send to a 2nd Chumby – 1 for Testing – 1 for Use
Set Widget to “Public” on Widget Upload Screen 3. Widget becomes public ONLY after being reviewed 4. Once public, users can add the widget to channel(s) 5. Users can rate content once live
Flash Lite pushed down OTA (Flash Lite 4???) – Flash Cast‐like product? (“Distro system”?) – Flash Home‐ like product? (“Dashboards”?) – Adobe AIR apps? (in possible future Chumby’s?) – Intercommunication between chumby’s – 3rd Party Hardware? (… like FM receiver) … your ideas?