Developing AIR for Samsung TV on 64 bit systems.

In my recent work, I’ve had the opportunity to work on AIR for TV and the new Samsung models of TVs/Blu Ray players.

As part of testing with my fellow developers, we’ve needed to test on a variety of mobile platforms as well as an AIR for TV development box. Now though, the time has come to test on actual Samsung hardware.

This is where things get a little hairy.

In order to get the app onto the box, the app has to be packaged with the Samsung SDK and then put on a web server in order to have the Samsung device download it from the server. Not quite as easy as putting an AIR file on a USB drive and having the dev box install it.

The issue that I had today was installing and running the SDK. The install of the 2.3.2 SDK went smoothly enough, but when I went to launch it, it crashed.

A little Google searching later and I found this article by Chris Lee Kr, and his trouble running it in a VM on his Mac. It gave me what I needed though, which is that the C++ redistributeable package doesn’t have a file for 64 bit that is needed.

The error that I was getting constantly was:

Error: The application has failed to start because the side by side configuration is incorrect please see the application event log or use the command line sxstrace.exe tool for more detail.

The solution though, is simple. Download and install “vcredist_x86.exe” from Microsoft Visual C++ 2005 Service Pack 1 Redistributable Package ATL Security Update.

After that, the SDK will run just fine.

Now, I am in the midst of packaging and then installing the app on a Samsung Blu Ray player (BD-D6500). Hopefully things will go smoother.

Air for Android, a question of orientation.

So I’m working on AIR for Android lately with both my G2 and my Motorola Xoom, using Flex Builder 4.5. Some of you might know that I am getting them to talk together with RTMFP.

I have them talking, but the application that I am working on I need to start and stay in landscape format. So the obvious question is:

How do you do that?

Turns out the answer is easy, and I thought I would share.

In the applicationName-app.xml are settings for your AIR app. You need to change the autoOrients to “false” and the aspectRatio to “landscape” or “portrait”, depending on your needs.

If you haven’t ever taken a look at applicationName-app.xml then you really need to. It has lots of goodies there. This assumes that you are using Flex Builder, if you are coding with other editors or a text editor then you probably had to create it yourself.

That actually all you need to do!

As a side note, if your application tries to listen for the StageOrientationEvent.ORIENTATION_CHANGE event, and you have the autoOrients set to “false” then the event will never fire.

Flex 4 Scroller Quirks

So in Flex 4, scrolling has moved out of the individual visual containers and now is a container itself that wraps around the containers that need to be scrolled. This is a good thing, but does have some issues that developers, like me, need to wrap their heads around.

Right now, I am just going to talk about the sizing of the children inside the s:Scroller component. It’s something that I have run into a few times, and writing it out here will cement things in my head and hopefully be helpful to you, the reader.

When sizing children inside a scroller, make sure you aren’t using percent based sizing. Why? Because then the child will attempt to size itself to the size of the scroller. It seems obvious, but it’s one of those things that you don’t think about in the middle of coding since it isn’t something that you would think about in Flex 3.

When you use percentage based layout for the children, you end up getting children with their display elements cut off. The scroller thinks that the child is sized correctly based off of it’s percentage, and not it’s actual size. The way around this is to use constraint based layout. If you want a width=”100%” layout, then simply switching to left=0 right=0 will fix your problems. Also, if you don’t need to be fussy with your layout, then let the component size itself, and scroller will handle that properly as well.

In conclusion, avoid percentage based layouts when laying out inside a scroller component.