Archive for category iphone

$200k – Adobe AIR App Challenge for Sony Tablets


This summer seems like one for Flash and Mobile, so it’s great to be able to tell you that Sony, one of our long term partners in mobile, are joining the Open Screen Project and will be a platinum sponsor of Adobe MAX in LA.

Today we’re announcing an exciting new Adobe AIR App Challenge for two upcoming Sony Tablet devices.  It’s available to those of you in Germany, Italy, Japan, Spain, UK and USA.

There are lots of prizes ($200,000 USD) available for various categories of applications, as well as early access to the devices and Adobe AIR 3, and a paid-up trip to Adobe MAX for finalists.  All that and more for optimizing your applications for Sony’s new devices.

Let’s take a look at the devices..

Sony Tablet

Both tablets come with Sony quality design and hardware, most importantly, with incredible quality screens.  Each of the devices has a Tegra 2 chipset from NVIDIA and will be “PlayStation Certified”, so expect some of the best quality games seen on the 1st-gen PlayStation and Xperia PLAY smartphone.

The tablets will ship with Flash Player pre-installed, but interestingly the Sony Tablet devices will ship with a new Sony Web browser.  With that, we can expect better performance for Flash and browsing the web, compared to the stock browser.

The Sony Tablet S1 (codename) which has a stunning curved body designed to feel lighter in the hand, like when you fold a magazine.  It comes with a 9.4 inch display, so will be great for Entertainment and reading.  As many of you have heard me say, 10″ screens feel too big for my little Irish hands, so it’ll be interesting to see what it’s like.

Sony Tablet S2 (codename also) is quite different as it comes with two screens.  The underlying technical specs are identical between the devices, but this device is going to be great for building applications that long for unique interfaces that make use of the dual-screens.  I’ve got my sights set on a mixing deck idea, but it’s also going to be a nice way to play games; Battleship anyone?

The Challenge

Adobe and Sony are challenging developers and content publishers to build breakthrough mobile apps optimized for the Sony Tablet S1 and Sony Tablet S2.  We have a panel of some amazing judges, both Sony, Adobe and industry experts picking finalists and winners across four key categories.

Each category has a cash prize of $20,000 USD and promotion on the Sony Tablet devices, with a $100,000 USD Grand Prize awarded for the best overall application.

  • Entertainment
  • Lifestyle and Community
  • Gaming
  • Business and Productivity

Our team of judges will be reviewing applications throughout the process, and will look favourably at applications that span across different platforms.  Maybe your application works on Sony Vaio PCs, or Sony Televisions with GoogleTV?

If you get in early enough, before September 16th, you’ll have the chance to be one of the 10 MAX Award Finalists.  So get in early and you can get a free trip to Adobe MAX in LA!

In addition, $10,000 USD will be awarded for the following applications:

  • Most Innovative Application
  • MAX Public Favorite – awarded by community vote

The top 80 finalists in the contest will get pre-release access to the devices for a 4 week period, the Adobe AIR 3 runtime, and access to the very latest tooling to complete your application.  You’ll be on the leading edge of Flash development and innovation.

Adobe AIR 3 Beta

You will use Adobe AIR 3 Desktop Beta, released soon for the desktop to optimize your applications for both devices.  So you can start to consider how your existing or new applications would make use of the dual screen, be as novel as you like!  (cough, mixing desk, cough)

For the Sony Tablet S2 you will use the upcoming Native Extension feature in AIR 3, one of the most exciting features in the upcoming release of the platform.  Native Extensions give us an easy way to optimize applications for dual screens, that’s because we can now access any API on a host Operating System!

All applications should support both the Sony Tablet S1 and S2.

Key Diary Dates

  • Sept 16: Deadline for MAX Showcase App prizes
  • Oct 1-5: MAX Public Favorite Vote & MAX Showcase App winners attend Adobe MAX
  • Oct 10: Deadline for Entries
  • Nov 11: Final App Submission for Finalists to the Android Market
  • Nov 17: Winners Announced

Submit your app or app project now at airappchallenge.com

 

 

 

 

 

, , , , , ,

13 Comments

EU – Adobe Mobile Challenge

This summer we’re running an Adobe Mobile Challenge for developers, designers and agencies around the EU territory.  What’s really exciting is that you’ll get the chance to win a trip, including flight and hotel, to Adobe MAX in LA this October.  We even have a few copies of Creative Suite 5.5 and Flash Builder Premium 4.5.1 for runners up, so lots of you will have a chance to win big.

We’re looking for applications that reach across different mobile platforms and that are published widely, on the Apple AppStore, Android Market and of course the Blackberry AppWorld for the PlayBook.

You’re application can be a game or branded content, anything goes really as long as your application is available in each store by the deadline below. Here’s my colleague Michael Chaize to tell you more, with his cool French accent..

DEADLINE:  September 1

,

No Comments

Google Maps: Evangelist Radar

As promised, here is the first of a few blog posts to discuss the creation of Eva for mobile phones from our App in a Week series.  If you missed any of the great sessions from the team you can watch them on-demand here.

One of the requirements for the EVA application was to produce a radar that would enable us to know where our team mates are.  This feature would be presented as a widget in the EVA application, and you can see it running here.  You can login as a guest as your username and then press “Radar”, and the result looks like this..

As you can see from the “powered by Google” logo, I chose to use the Google Maps API for Flash.  In fact I went all out and created a widget that displays the map in 3D and plots our locations using custom markers around the world.  It goes without saying that the Google Map product is amazing and made possible in Flash by a special API created especially for Flash.

Now, when I was creating this I didn’t know that Google planned to open up their Latitude API.  Latitude, in case you don’t know, is part of the Google Maps product on mobile phones that allows you to share your location with your friends and vice versa.  It has a number of great features that help you to create applications that can share sensitive location information – and keep the data under the control of the user.

Google Maps API for Flash

For a few years now Google have provided an API for Flash developers, so that we might integrate Google Maps into our applications in the browser with Flash/Flex or using the AIR runtime.  To get setup all you need to do is to download the SDK and place it within the components panel of Flash and drag the component onto the stage.

Once you have your FLA setup then you can begin coding, and my personal choice is to use Flash Builder 4 as it has much better support for complex applications.

I have an application class called RadarWidget that defines the Google API key, constructs the Map in 3D.  For obvious reasons, drawing the Map in 3D is quite intensive, and to be honest I did feel that I was stretching my idea of “recommended” approaches.  In the end however I decided that the construction and optimization of the Widget was key to this post.  So to be clear, I still do recommend a static image and this is also supported by the API.

When the application starts up I initialize the Map and get it ready to roll, and while that’s happening a request is sent to our PHP backend to retrieve the current locations of the team using the UserService class.  The PHP function pulls this information from the MySQL database and sends back an array containing all of the team.

getAllUsers = new UsersService(handleGetUsersRequest);
getAllUsers.call(UsersService.GET_ALL_USERS,null);

Each of these array items becomes a User object and they handle the loading of their avatar images, before calling back into the RadarWidget class to add this avatar to the map.  The CustomMarker class extends the com.google.maps.overlays.Marker provided by the API.  Markers provide an extensibility mechanism for the Google Maps API, one where an Overlay can be anything from a user image, to your local Starbucks, weather and even a completely new terrain map.

var marker:CustomMarker = new CustomMarker(user,
new MarkerOptions({
icon: user.image,
hasShadow: true,
distanceScaling: true,
clickable:true,
iconOffset: new Point(-user.image.width / 2, -user.image.height)
}));

In this same class, when a user taps on an Evangelist avatar you’ll notice that a pop-up appears to indicate their current location.  To achieve this I have used the Google ClientGeocoder, which is an API than provides an array of Placemarks close to the Latitude and Longitude provided.

popup = new Popup(currentMarker.user.user_realname, placemarks[0].address);
popup.cacheAsBitmap=true;//The popup is a vector, so let's cache it while it's up

var opts:InfoWindowOptions = new InfoWindowOptions();
opts.pointOffset= new Point(-45, -110);
opts.hasShadow=true;
opts.customContent = popup;
currentMarker.openInfoWindow(opts);

The precision is limited to their street and city, although ultimately this component could easily be extended to include live Tweets etc.

Optimization Challenge!!

After a series of optimizations I managed to get this API to work pretty well on the Nexus One running in AIR and Flash Player 10.1.  The framerate achieved could be considerably improved and that’s my challenge to you!

My optimized version for Eva is here and my challenge to you is to get used to the API such that you can achieve between 13-15FPS from this component running on the Nexus One.

I have deliberately switched on various problematic rendering features and made it a little tricky.  The goal here is for you to practice at bringing desktop code into the mobile environment – and making it ship quality.

All you need is Flash Professional CS5, Flash Builder 4 and a Google Maps API Key.

Download

, , ,

No Comments

Adobe AIR – Packager for iPhone OS demos

We’re getting closer and closer to the launch of Flash Professional CS5, our Flash authoring tool ships with our Packager for iPhone preview. With the new tool it’s possible to create Adobe AIR applications based on Flash, and ship those on the Apple AppStore.

As you may have noticed, we have been shipping our own mobile applications for a while now, including Photoshop.com Mobile on Android, iPhone, Windows Mobile, and Acrobat Connect on the iPhone.  In just these few short months we’ve managed over 6 million downloads already, and I’m looking forward to seeing future Adobe products on different form factors.

Of course some developer agencies have already been pushing out their first Flash-based applications using the pre-release packager.  With over 100 in the AppStore today, I thought it would be interesting to have a look at the progress being made, enjoy the “presentation” :-)

Although I’ve focused on the iPhone here, everything that you have seen can run on other platforms with a few tweaks.  That’s the benefit of using Flash and AIR for your mobile and devices content.

Update:  Kevin Hoyt shows some side-by-side demos with Android OS

33 Comments

Flash Player 10.1 – Camera support with PhoneGap

Some of you will remember my earlier blog posts in August 2009 on the HTC Hero, the first Android device to ship with Flash.  The goal of the Android experiment was to learn about the Android SDK, the development process and discover how Flash was enabled in the context of the browser.

As we edge closer to the release of Flash Player 10.1 in the first half of this year, it seems appropriate to revisit these posts.  In this post you’ll see that there are hidden benefits to using a common runtime across device platforms, some of which are not that obvious.

The result of my week long investigation is that (using the beta version) I can hook up Flash Player 10.1 to the camera; but that’s just the start.  Let’s look at how it’s done…

WebView

Those of you familiar with Nokia’s WebRuntime or the iPhone UIWebView will recognize WebView, because it’s the same thing.  Really it’s an implementation of the browser made available as a UI component for native applications.  So this means that you can create an application in HTML/JScript and manage the user experience through a native shell.

So why is WebView useful?  Let’s look at the relevant classes:

  • WebView – Used to load and display web pages using the built-in device browser and chrome, embedded into your application.
  • WebViewClient – Enables the handling of various browser actions like page loading and error handling.  Overrides the Activity in the built in browser.
  • WebChromeClient – Enables the replacement of the browser chrome for events like progress, alerts and for window controls.  Can override the default Chrome.

So using a standard WebView I can use the core browser, or if I choose, extend this and replace the chrome and user experience.  If you were reading carefully, inside WebView you will have noticed a method called addJavascriptInterface, and that’s where it gets interesting because this allows you to create a JavaScript front end to a native class.

In effect you can then write anything you want using native APIs, and add that functionality to WebView in the form of JavaScript interfaces.  Wait!  Doesn’t Flash have the ability to speak to JavaScript?

Flash Player – ExternalInterface

This is a long standing ExternalInterface API in Flash Player that enables communication with JavaScript in the browser.  It’s primary purpose is actually to help Flash live alongside HTML, enabling Flash to signal JavaScript and pass messages back and forth.  So in principle, if Flash can communicate with JavaScript and JavaScript with Native code, then we can start adding functionality.

Sounds really simple right?

PhoneGap

The folks at Nitobi have already made a huge head start creating PhoneGap, an open source set of cross-platform Javascript APIs for HTML applications, just some of which are below.  The PhoneGap framework also enables anyone to create their own extensions based on the same principle, and although it’s quirky, the process is relatively simple.

In the git repository the team are also hard at work on functionality like Text-to-speech, Camera and File access for Android.  Remember that this is an open source project, it’s changing just about every day and they need helpers.  What’s really exciting is that PhoneGap workshops, including in person and online events; so I suggest attending!

iPhone Android Blackberry
Geo Location yes yes yes
Vibration yes yes yes
Accelerometer yes yes pending
Sound yes yes yes
Contact Support yes pending yes

Porting PhoneGap

As you have read previously, we are working to bring Flash Player 10.1, which includes the ExternalInterface, to Android in the next few months.  Now, my Nexus One is an Android 2.1 device, and that creates a slight problem because PhoneGap is only compatible with Android 1.6 APIs.

This means that I had to port code and complete some APIs, in fact I’ve completed the Contacts API, updated the Camera, Location and Accelerometer APIs and did a spot of bug fixing get things working.  In total this took about five days, to get setup and familiar with the code, and then writing some code for a few hours here and there.  Using Open Source kit often results in these sticky issues, hint, that’s why Adobe put so much effort into documentation :-)

With the Android SDK it really couldn’t be simpler to perform tests once I got started, really it couldn’t be easier to do live debugging on Windows, Mac and Linux; a great SDK from Google.  Once you get into the flow of debugging, coding and testing it’s all good.

My advice, as always, is to think about functionality that you’d like to add and go for it.  There are lots of docs out there, and alot of helpful code available for hacking something together.

FlashCam

After playing with PhoneGap and testing out my changes/addition, I decided to put the framework to the test and build an application.  The first API test was for the Android Camera, and I’m calling it FlashCam.

With FlashCam I have created a simple stub application that contains a WebView, much like the previous blog post.  This WebView pulls down an HTML page that’s actually on my blog here, and instantiates the native code and applies the javascript interfaces.  So you heard that right, I’m able to extend functionality to a live webpage and not just a static local page.

HTML Integration

Embedded in the example HTML file from PhoneGap is a JavaScript function called show_pic().  It simply wraps up another function inside the phonegap.js that is also referenced in the HTML file.  If this function succeeds then dump_pic() is called, if not then the function fail() is called.

The code under getPicture() is really quite complex and beyond the scope of this post, but you can see it here.  Essentially it calls a native function called takePicture() written in Java, and this launches a new Activity (like a Window) with the camera’s viewfinder surface.

function show_pic(){
   //Note: This could be simplified, but it's abstracted for safety
   navigator.camera.getPicture(dump_pic, fail, { quality: 50 });
 }

When the photo is taken we call dump_pic() and it will contain the Base64 encoded JPEG image data from the camera.  Then, all we need to do is return this to Flash in a callback and in this case “mySWF”, which is the name of the SWFObject embedded in the HTML file.

function dump_pic(data){
   document.getElementById("mySWF").photoBytes(data);
 }

In the running SWF file we have a SimpleButton that can call the show_pic() function, but first we need to add a callback which is analogous to an event listener.  In Javascript we call photoBytes(image_data), and once the ExternalInterface receives this event it will call onReceivedPhoto(image_data):

public function fl_MouseClickHandler(event:MouseEvent):void{
  ExternalInterface.addCallback("photoBytes", onReceivedPhoto);
  ExternalInterface.call("show_pic");
}

Here in the onReceivedPhoto function we decode the Base64 encoded image_data, which is just a very large string containing the image.  I’m using the Base64 classes provided here by Jean-Philippe Auclair, and merely getting the ByteArray.  I can then use Loader to take these bytes and produce BitmapData and do a little scaling in the imageLoaded handler before adding it to the stage within the holder_mc.

public function onReceivedPhoto(image_data):void {
  var bytes:ByteArray =  Base64.decode(image_data);
  imageLoader = new Loader();
  imageLoader.contentLoaderInfo.addEventListener(Event.COMPLETE,  imageLoaded);
  imageLoader.loadBytes(bytes);
}

private function imageLoaded(e:Event):void {

 var image:Bitmap = Bitmap(imageLoader.content);
 var tmpdata = new BitmapData(320, 260);

 var matrix = new Matrix();
 matrix.scale( 320 / image.width, 260 / image.height );

 tmpdata.draw( image.bitmapData, matrix, null, null, null, true ); // smoothing
 image.bitmapData = tmpdata;
 holder_mc.visible=true;
 holder_mc.addChild(image);
}

Here is FlashCam in action…

So that’s it, it’s really that simple to hook up native code to Flash Player 10.1.  I suspect that this will also be possible on Palm’s WebOS, Symbian and Windows Mobile in time.  I’m also loosely aware of a better bridge to JavaScript in Flash Player 10.1, so this might be a source of further investigation to improve performance for large data sets.

Now it’s your turn, below are the sources that I’ve used from PhoneGap with my own additions.  You can also find the Flash FLA and AS files below, note that you will need at least Flash Professional CS4 to open the FLA.

Downloads

Notes:

  • You cannot keep the SWF file within the stub package, they must be in the remote sandbox.
  • Flash Player security does not allow for localWithTrusted access to local Javascript.
  • Proportional scaling of images is a pain in the ass in Flash, I’d like to hear about any libraries for that.
  • I found CameraForm useful for producing encoded image data for testing; impossible with HTML5

14 Comments