Click on any phrase to play the video from that point.
[Adobe TV Presents: Paul Trani in...] [FLASH Training with Paul Trani] [♫ New Age music ♫] Hi, my name is Paul Trani. I'm an evangelist for Adobe, and I want to show you how you can go ahead and detect what sort of device that you're using, wherever your content is. Obviously I have an ipad here. Whether it's an ipad, a Motorola Zoom, whatever the case may be, I want to be able to detect the capabilities of this specific device and then adjust my content accordingly. Let's take a look at this file that I have currently open, device capabilities. There's just some text fields here, and all that's really going on if I take a look at the actions panel is it's just going to display some texts so I'm just going to run this. Do a command enter, run this here, and you can see flash version, player type, language, manufacturer, on and on. These are just some of the capabilities I can actually get of the device, and then, again, make decisions based on that. As you can see, it's not pulling in any information whatsoever. So what I want to do is I want to go ahead and access the flash version player type and all of that. Now what you can do is you can actually search the flash help to determine all of the different properties that you can get of the device, but obviously right down here I'm going to get the flash version. It's as simple as typing in capabilities.version. When it comes to the player type, again, I'll just copy this word right here, capabilities, clear type that turns blue. Language. This one becomes very important. If you want to localize your text, go ahead and add that. Let's make sure I have my plus signs in here. There we are, manufacturer as well, [Typing sounds] and right down here, operating system, [Typing sounds] OS. All right so that's items that I'm getting, and these actually, if I run this, you can see the information that it gets, of course, on playing this on a Mac, so it tells me it's a Mac. The player type is desktop version by the way. Language is English. Manufacturer, again, is Adobe Macintosh, but again, this flash version 10.2. This might really become beneficial if you're looking at accessing sort of the latest capabilities of the flash player. Things get really interesting as you get into the screen DPI and resolution. The DPI is interesting because I'm on this desktop, it's going to return 72 or 96 DPI dots per inch. But when it comes to these other devices, they actually have higher resolutions so I want to be able to detect that higher resolution, and then I can adjust content accordingly. Again, the screen resolution X and Y, and the width and height. I'm going to get that information as well, the same way I've been doing it, just scroll down. All right so here we have the screen DPI, and here's a couple notes because for iphone 3, you can see it's 164 compared to the iphone 4 which is 326. I just want to be aware of the different DPI's available, but it's done the same way. Capabilities.screenDPI. Next up is the resolution X and Y. [Typing sounds] Screen resolution X. Let's make sure I get my plus sign in there. I want to add it to that current phrase, and again, screen resolution Y. All right so this will be interesting to see my screen size on my desktop as well as on a device. All right, next up I can get the actual physical screen size in inches. So let's take a look at this, and how this is basically done is I can go ahead and get the screen resolution X. How wide is it? But then I want to divide by the DPI. Again, divide by the screen DPI, and that returns the actual screen width. Okay, my resolution X divided by the DPI. Again, same thing for the height. I'll just copy this line, keep it simple, and make sure I have my plus sign in there. Just paste this down here and make it go a little faster, change this to Y, and I'm well on my way. All right so this will be interesting to see the resolution as well as the screen size. I'll run this, and here we are 72 DPI. My screen resolution is 1280 x 800, and my screen width is actually 17 inches x 11 inches high. Again, this is on my desktop. What I want to do now is I want to go ahead and access some additional device capabilities, and then see what all this content looks like on an actual mobile device so as I scroll down, I've already talked about in past episodes how to use Geolocation as well as the Accelerometer, but I can also check for any GPS capabilities, and that's what's going on here. If it's supported, then go ahead and get the latitude, the longitude, horizontal accuracy, speed, vertical accuracy, things like that okay? And if it's not available, just say no Geolocation support. Okay, so I can run these checks by having these conditional statements. Again, Accelerometer, there's that information. Of course, it will load in acceleration X or Y, and if it's not supported, it will display that message as well. Again, there's additional videos on those 2 specific capabilities, but nonetheless I want to go ahead and connect a device. I happen to have an Android device, and I'm just connecting it by USB, and what I'm going to do is I'm going to make sure my player is set to AIR for Android. This can just as easily be AIR for iOS, and I can get the same capabilities, but, again, AIR for Android, selecting my settings, and you can see this is the APK it's going to make. I can make sure this goes full screen, deployment right down here at the bottom. This is exciting being able to publish directly to the device and launch it right away, but I do need to go into permissions as well since I am accessing GPS data. I want to make sure that is included in my permissions file that gets created so access fine location. I just need to make sure that's checked. Otherwise, everything else is good. I have a couple additional items checked, but I don't even necessarily need those checked, but nonetheless I am going to go ahead and hit publish. Again, with my connected device, it will actually publish that file out to my device, and I can go ahead and take a look at it on the device now. So here's my Samsung device that happens to be an Android device as the manufacturer field tells me. The language is actually Spanish which I realized is exactly what I wanted just to show you that it does output or get the language of device play types desktop because that actually is a little mini computer so that's why it says desktop, but nonetheless right down in here, you can see the screen DPI is 240 pixels so high resolution screen 480 x 800, and I can see the physical size. Obviously you can see the GPS information as well as Accelerometer information. You know compared to say this Motorola Zoom Tablet, again, has a lot of the same information. Notice the screen DPI is 160. It doesn't have any Geolocations to port. I actually don't have a card in it, but I did want to show you that it does output the correct information. If I was building an app based on this information I can do some adjustments to my content and make it a seamless experience for my end user. All right so how do we take advantage of these various capabilities? Well here's basically a game, a simple children's game that I'm working on, and really what I want to do is I want to make it sort of a multilingual app; so I want to replace some of this phrasing with the specific language phrasing that's appropriate for the audience. So I go ahead and take a look at the document class for this project, and I'll just scroll down. As I scroll down, you'll see this language variable, and it gets the language specific to the device. Okay, as I scroll down I'm really only checking for 2. I have English and Spanish. If it is an English or has the English language, then go ahead and drop in those phrases, as opposed to Spanish, go ahead and use these phrases. So pretty simple, I can detect for multiple languages and really make this a really robust international application, but nonetheless that's all I'm doing with this, and I'm going to go ahead and go into my published settings, and I can publish this out. Just click publish, and I can go ahead and take a look at this on the device as well. Here it is running on this device. It happens to be set to Spanish as the language so you can see right away we have Facil, Medio, and Dificil, and I'm probably not pronouncing that correctly, but nonetheless I am able to go ahead and read that system and drop in the correct language. So as you can tell using system capability really allows me to customize the experience based on the device and the user's preferences. It really makes for a seamless experience for your app so I encourage you to take advantage of that, and thanks so much for watching. [♫ Fast paced music ♫] [Executive producer Bob Donlon, Producer Karl Miller, Director/VFX Kush Amerasinghe] [DP/Post Production Erik Espera] [Adobe TV Productions tvadobe.com]


