Getting a user’s Location from a Channel
by @ryancanullaGeo-location is a hot feature, especially in the world of mobile apps. While our devices don't travel as much, there are still limitless possibilities when basing an app around a user's location.
The litl Channel SDK gives you access to a device user's zip code by way of two things: User properties and the Location capability. The latter is a privacy hook that, when accessed, notifies the user that this channel is accessing private information. We've put together a ready-to-run sample channel that shows you how to obtain the "zip code":
1. Download the "zip-code-sample-channel"
You can download the project archive from the sample channels section of http://developer.litl.com. This sample channel was created using Flash Builder as an ActionScript Project.
2. Import the project into Flash Builder.
3. Link the project to your as3-sdk-core library project.
Right Click on "zip-code-sample-channel">Properties>ActionScript Build Path>Add Project.
4. Open the simulator.
5. Grant the location capability to your channel in the simulator.
6. Run the channel.
What's going on here.
Basically we just listen for a PropertyMessage.PROPERTY_CHANGED event on our service and then pull the zip code from that event handler.
service.addEventListener(PropertyMessage.PROPERTY_CHANGED, onPropertiesChanged);
Inside of the handler we loop through an array of properties and check to find one called "zipCode". Once we find the zip code we then make sure that it's a global property. If both tests pass then we have the zip code available to us in two places. First, we can pull it from the array itself "properties[i].value". The second option available to use is to pull it directly from our service via the "service.zipCode" property.
private function onPropertiesChanged(e:PropertyMessage):void {
var properties:Array = e.parameters;
for(var i:uint=0; i < properties.length; i++) {
if(properties[i].name == "zipCode" && e.propertyScope == PropertyScope.GLOBAL){
zipLabel.text = properties[i].value;
/**
* an also be set like this
* zipLabel.text = service.zipCode;
*
*/
}
}
}
Here's the working code!
package {
import com.litl.sdk.enum.PropertyScope;
import com.litl.sdk.message.PropertyMessage;
import com.litl.sdk.service.LitlService;
import flash.display.Sprite;
import flash.text.TextField;
public class Main extends Sprite {
private var service:LitlService;
private var zipLabel:TextField;
public function Main() {
service = new LitlService(this);
service.addEventListener(PropertyMessage.PROPERTY_CHANGED, onPropertiesChanged);
service.connect("channel_id", "Zip Code Sample Channel", "v1.01");
createZipLabel();
}
private function onPropertiesChanged(e:PropertyMessage):void {
var properties:Array = e.parameters;
for(var i:uint=0; i < properties.length; i++) {
if(properties[i].name == "zipCode" && e.propertyScope == PropertyScope.GLOBAL){
zipLabel.text = properties[i].value;
/**
* an also be set like this
* zipLabel.text = service.zipCode;
*
*/
}
}
}
private function createZipLabel():void {
zipLabel = new TextField();
zipLabel.x = 50;
zipLabel.y = 50;
addChild(zipLabel);
}
}
}
This example also demonstrates how you would work with either ACCOUNT, DEVICE, GLOBAL, or SHARED properties. For additional support, please check our forums or contact us.
New sample channels added to developer.litl.com!!
by @ryancanullaWe've added two additional sample channels to help get developers started with the SDK!
The first is a sample channel that makes use of the web card capability. This capability allows users to open new web cards from within their channel. Let's say I have a news channel and I'd like to send users to the actual article out on the web; this channel will show you how!

The second channel that we added is a starter flickr channel. You'll need to get your own API Key + secret to use this one. Besides giving you an out of the box templet to get started with, we're also showing you how to use the filmstrip control and override its ImageRenderer! In addition, we also show you how to keep your litl service information inside of the application controller (I like it there).
http://developer.litl.com/create/sample_channels.htm
Let us know what you think or if you have other ideas/requests for sample channels!
Channel ideas from litl device owners
by @chuckstar
So you've downloaded and mastered our simple SDK. Now you might need an idea for a litl channel to build. Who better to get channel ideas from than litl device owners themselves? Here are some of our favorite ideas that we've heard from our users. Pick an idea below (or one of your own) and start coding. We'll be accepting channel submissions soon and you'll want to be one of the first to get something in our new Channel store!
Sign Maker
Enter text in laptop mode, select a style, then flip it into easel mode to display your message. Use a variety of styles and fonts to create a post-it note reminder to pick up milk, or a menu de cuisine for an ambitious culinary outing.
Rimshot on Demand
Crack a joke, then use the litl remote control to cue an instant "ba-dum-ching" sound effect. For both real and ironic use.
Fishing Expedition
Reel 'em in using the wheel on litl's webbook or remote. One possibility for this game could involve a fishing rod pivoting in a pendulum motion from side to side atop a screen full of fish. Press the "go" button to cast your line; if you make contact with a fish, use the wheel to reel it in. Throw back, re-bait, try again.
Metronome
Keep the beat with a simple metronome. Adjust settings in laptop mode, then flip to easel mode to use. The "go" button would stop and start the beat.
Instrument Tuner
Annoy your friends and family less - play in tune! Use the tuner to produce tones for each string or valve or whatnot. With microphone APIs, the next step would be to gauge whether your instrument is sharp or flat.
Fantasy Sports Ticker
Keep track of your fantasy sports team's performance with a ticker of news on only your fantasy players.
Birthday Cake
Select the number of candles in laptop mode, then flip to easel mode for a birthday surprise. With microphone APIs, you can also blow into the mic to blow out the candles.
Movie Times
Check movie schedules with the spin of a wheel. The channel could display show times for theaters near your house in easel mode based on your zip code.
Kaleidoscope
Use the wheel on litl's remote and webbook to change shapes and colors like the classic kid's toy.
How I Spent My Summer Vacation
Want to wow your friends with vacation photos, but need the ability to pause to explain the background story? Build this channel to control when your Mediawall slideshow photos advance with the "go" button on the remote control.
Shuffleboard
Choose your angle with the wheel and "go" button, then hold the remote wheel-side down against a flat surface to replicate a shuffleboard stick. Shuffle the remote with the right force to get the puck into prime real estate on the board.
Shaving
This can be as simple or as complicated as you want, but the premise is that you use the litl remote as a mock razor against your face to simulate shaving. Taking the complicated route, you could start with a photo on the webcam of your face, on which you can superimpose facial hair. Then, apply a dab of shaving cream using the "go" button, take out your razor, and show that beard who's boss.
Yelp
Enter your location and food preferences, and see a slideshow in easel mode of top-reviewed and popular restaurants, bars, and other businesses in your area.
Ebay
Keep an eye on the top online auction site with a channel showing a slideshow in easel mode of the items that interest you.
We'l keep a master list of the most wanted channels on our new "Most Wanted" page, so check back for more details. Also, keep an eye out for an update when we start accepting channels for review!
Channel Submission Criteria up on developer.litl.com!
by @ryancanullaCheck out our submission criteria! We’ve made an easy checklist for you to use when creating or submitting channels in our upcoming channel store (both free and paid). We hope that this takes away some of the guesswork with regards to what we will be checking your channels against during the submission process! We’ve broken it down to “channels should” and “channels must”. Can we make it any easier?
Check it out here:
http://developer.litl.com/create/submissioncriteria.htm

