Archive by Author

Using Growl in AIR applications with AIR 2 NativeProcess

The AIR2 release is just around the corner and one of my favorite new features is the ability to use native scripts. As I’ve already demonstrated earlier, this is extremely powerful and here’s another good example.

From the moment AIR was released, a lot of developers were asking for Growl support to add toast style notifications. Up until now, there hasn’t really been an easy and flexible solution so most developers opted to build their own notifications. I really like Growl and the fact that you as a user have total control over the look and feel. I use the Mono style created by Christopher Lobay. It’s probably the sexiest toast style notification I’ve ever used.

With AIR 2 you can now call Growl right from within your application. I actually call the Growlnotify command-line tool, which comes as an extra in the Growl download. Most people probably don’t install these extras but that’s no problem. I can bundle the command-line tool as part of my application and call it directly from my applicationDirectory.

So… How does this work? It’s actually extremely easy… The first thing you do is set up a new File object that points to the Growlnotify tool.

var file:File = File.applicationDirectory;
file = file.resolvePath("growlnotify");

As I am going to bundle growlnotify with my application it will just be installed as part of the app and thus resides in applicationDirectory.

The next thing I have to do is set up a NativeProcessStartupInfo object. That’s where I’ll store the basic information that is used to start our NativeProcess.

var nativeProcessStartupInfo:NativeProcessStartupInfo = new NativeProcessStartupInfo();
var processArgs:Vector.<String> = new Vector.<String>();
processArgs[0] = "-n";
processArgs[1] = "My AIR application";
processArgs[2] = "-p";
processArgs[3] = "0";
processArgs[4] = "-t";
processArgs[5] = "Your Growl title";
processArgs[6] = "-m";
processArgs[7] = "Your Growl message";
processArgs[8] = "-a";
processArgs[9] = "Adobe AIR Application Installer";
nativeProcessStartupInfo.arguments = processArgs;
nativeProcessStartupInfo.executable = file;

In this case, I’m also adding a bunch of arguments in my NativeProcessStartupInfo object. These arguments will be passed on to the growlnotify command-line tool. In this example, I’m setting up the name of my application, the notification priority, the title and message of my notification and I’m also telling it to use the icon associated with the Adobe AIR Application Installer. (Check out the Growlnotify docs for more info on these settings)

Next and last step is to actually call the native script.

process = new NativeProcess();
process.start(nativeProcessStartupInfo);

This code above will result in this Growl notification:

The only downside of using native scripts is that you’ll have to package your application specifically for the operating system you wrote your native script for. So in this case, I’d have to package it as a .DMG file since Growl only exists on OS X. That said, I really wouldn’t mind an OS X version of TweetDeck that allows me to use Growl instead of their custom notifications…

I really can’t wait to see what you guys are going to build with AIR 2! You can already start today! Check out Adobe Labs for more information!

Read full storyComments { 31 }

Mission critical Flash

NATO started using a Flex application for their Mission Support System in 2007. I saw it in action once… but if I told you about it I would probably end up in a dark dungeon 20 floors below the NATO HQ in Brussels. During MAX in San Francisco in 2008 Peter Martin and Mansour Raad from Adobe Consulting and ESRI discussed the application. The presentation (available on Adobe TV) gives you an idea of how NATO is using Flex.

Today, ISS announced that under the sponsorship of the Air Force Research Laboratory and direction of Navy’s Space and Naval Warfare Systems Command (SPAWAR) they developed and deployed an application to enable critical infrastructure monitoring to the White House Situation Room.

The ISS team developed an application for deployment on the SPAWAR touch table framework, leveraging touch technologies to provide insight into the current status of various elements of critical infrastructure across the United States.  The application provides users such as the President and his staff with the ability to view the status of any of thousands of pieces of critical infrastructure with a single tap on a touch surface.

According to Rob Rogers, Vice President of National Systems at ISS, “The touch table application for the White House presented many interesting challenges to the team.  The application is really a mash-up of technologies including the ISS-developed Web Enabled Temporal Analysis System framework for data access and aggregation combined with a custom touch interface developed by ISS, utilizing the Adobe Flex framework, finally sending results to Google Earth.  The President, Vice President, and the Secretary of Homeland Security have used the application and have expressed positive feedback.”

I doubt that I will ever get to see that application…

Flash on!

Read full storyComments { 26 }

Robert Scoble interviews Flash Platform execs

Earlier this week, Robert Scoble visited the Adobe office in San Francisco to talk to Anup Murarka (director on the Flash Platform team) and Aaron Filner (group product manager for AIR). In the first video they talk about Adobe’s recent announcements. In the second video they debunk some of the recent claims that were discussed in the tech community. They talk about HTML5, Apple, battery life, multitouch and more… After watching the videos, also read Robert’s (@scobleizer) thoughts on his blog.

Read full storyComments { 16 }

Number 1 on my wishlist: HP’s slate device

I already blogged about how excited I was about HP’s slate device a few weeks ago. These two new videos make me want it even more!

The first one is a teaser ad from HP but make sure you watch the second video! Adobe’s Alan Tam shows the device in action! No CGI tricks here! Alan shows Adobe AIR and Flash in action on the device: Video playback from MTV.com; A Spongebob Squarepants game (most casual games on the Web run in Flash); photo editing at Photoshop.com and reading the digital version of the New York Times. Now that is the web experience I want on a slate device! I’m ordering this the minute it becomes available!

Read full storyComments { 25 }

The HTML5 Flash Marriage: Geolocation source

Last Friday I blogged about how HTML5 and Flash could also just work together. A few people have asked if they could get the source files. I just packaged and uploaded the FLA, ActionScript class and HTML files. Download the zip file here.

A few people have also noted that the demo doesn’t work across different platforms even when using the same browser. While I wanted to demonstrate how Flash and HTML5 can coexist and even complement each other, it is (sadly) also a demonstration on how HTML5 is being implemented differently across browsers and operating systems. Feel free to post a comment if you know about fixes or workarounds in the JavaScript to make it work on more browsers.

Read full storyComments { 12 }

The HTML5 Flash Marriage: Geolocation

I probably don’t need to tell you that there’s a lot of buzz (and fuzz) about how HTML5 is going to kill Flash. You probably know how I feel about this… I think the web is big enough for both of them… Even better… I think they could potentially complement each other!

Geolocation is a good example. HTML5 is going to get a geolocation API that works just beautifully even on devices with no GPS. Flash based applications will (currently) only get access to geolocation APIs when targeting the AIR runtime on mobile. Some browsers (I only know of Firefox 3.5 on Mac and the WebKit browser on the Nexus One) already support the HTML5 geolocation API… So why not use that to get geo information into your Flash based application?

It’s actually extremely easy to do…

But first a little bit of background as to why I was looking for this functionality. I’m actually building “this demo app” that needs the geolocation in order to have the functionality I was looking for. I want this app to work in as many places as possible. With the Flash Platform I can build this for my browser and my desktop. For the Apple phone I can export it as a native app and for the Nexus One I can use the device browser with Flash Player 10.1.

Now… How does it work? The HTML5 geolocation API is extremely easy to use and, like I said earlier, you don’t even need to have a GPS enabled device.

function getGEO()
{
	// First check if your browser supports the geolocation API
	if (navigator.geolocation)
	{
		alert("HTML 5 is getting your location");
		// Get the current position
		navigator.geolocation.getCurrentPosition(function(position)
		{
			lat = position.coords.latitude
			long = position.coords.longitude;
			// Pass the coordinates to Flash
			passGEOToSWF(lat, long);
		});
	} else {
		alert("Sorry... your browser does not support the HTML5 GeoLocation API");
	}
}
function passGEOToSWF(lat,long)
{
	alert("HTML 5 is sending your location to Flash");
	// Pass the coordinates to mySWF using ExternalInterface
	document.getElementById("mySWF").passGEOToSWF(lat,long);
}

In my Flash application, I’m using ExternalInterface so I can communicate between JavaScript and my SWF. When my Google Maps component is ready, I call the GetGEO JavaScript method:

ExternalInterface.call("getGEO");

When the JavaScript method gets a result from the geolocation API, it will pass it on to the passGEOToSWF method. In my Flash application, I just listen for that method call and then call the code to update the map.

ExternalInterface.addCallback("passGEOToSWF", onPassGEOToSWF);

If you don’t have an HTML5 ready browser, check out this video of the application running in Firefox 3.6. Even cooler is that this also works in the browser on my Flash Player 10.1 enabled Nexus One (Please note that the network is slower on the N1 and thus it isn’t able to keep up with loading new map images. This has nothing to do with Flash Player 10.1 or the application.):

If you have Firefox 3.5 or newer installed, you can give it a try yourself: http://www.webkitchen.be/geolocation. I’m sure there are other browsers out there that also already have the geolocation API but this is the only one I tested on the Mac.

Hopefully this gives you a good idea of how HTML5 and Flash can also just work together (instead of killing each other ;-)). Flash on!

UPDATE: While writing this blog post, @robertbak pinged me on Twitter saying that he wrote a library to use in your Flex applications. Check it out on the Flex Exchange.

UPDATE: For the source files check out this blogpost.

Read full storyComments { 31 }

The MWC 2010 Flash Challenge

At the recent Mobile World Congress my colleagues gave me a map… and 10 minutes to find all Flash-enabled devices at Mobile World Congress 2010. You should know that there is 65.000 square meters of exhibition space at MWC and there are over 1300 exhibitors. You also need to navigate between over 50.000 attendees. I’m sure you get the idea… This was not an easy challenge… But… I’m always up for a challenge… So here’s the video…

Read full storyComments { 14 }

3000+ reasons why Flash isn’t going anywhere soon

The FWA is almost 10 years old (established in May 2000) and they started their 10th anniversary celebrations early by launching a brand new site (created by Belgian based Flash rockstars Group94). The FWA is one of the few sites I visit daily and a great inspirational resource. Every day they award the best site with their acclaimed and much wanted “Site of the Day” award. Winners proudly add the yellow ribbon to their site to show that they won.

The FWA has awarded over 3000 sites in the last 10 years… Less than 10 of those use a technology other than Flash. So… If you’re looking for great examples of why Flash isn’t going anywhere soon, The FWA is a good place to start! In just about every thinkable category from games to architecture to educational to fashion and more you can find inspiring examples that showcase the power of the Flash Platform.

If you have any doubts that Flash doesn’t have a future, you should just look at some of the amazing sites and apps showcased on The FWA!

Here are some of my favorite recent FWA winners:

Flash on!

Read full storyComments { 38 }

Video: AOL Media explains the benefits of Flash Player 10.1

Sun Sachs from AOL Media explains how Flash Player 10.1 coming to mobile devices is going to change the way they publish their 88+ brands across multiple devices.

For more videos from Mobile World Congress, check out the MWC page on Adobe TV.

Read full storyComments { 7 }

Video: Brightcove about Flash Player 10.1 on mobile devices

At Mobile World Congress in Barcelona, I bumped in to Cameron Church from Brightcove. We talked about the Brightcove Mobile Experience and Cameron explains how Flash Player 10.1 expands Brightcove’s reach to smart phone users.

For more info about Brightcove, check out brightcove.com.

Read full storyComments { 8 }
Page 1 of 3312345...Last »