02Geek HTML5 and JavaScript, TypeScript, React, Flash, ActionScript online School
Previous VideoNext Video

What is the users Adobe AIR version and why is it important?

Now that we've been introduced to the concept of capabilities the next step is to understand what other basic capabilities can we get from our devices. This information will come handy as we move to part 3 where we build a full application.

Video Transcript

00:00Let's talk about the capabilities class now the capability class has a lot of properties
00:05They're not specifically related to the air application
00:08But they have a lot of information that could become incredibly useful
00:11Such as the version of flash player that you're running or the operating system that you're running in
00:17I want to talk about just a couple more of them and we're gonna wrap it up there
00:21But I do recommend that you do go and check out the actual formal documentation of the capabilities library in the Adobe
00:27documentation site to do that
00:29I'm just gonna paste inside here the actual link to the formal documents
00:32You could go right into the source files and just go to that link to see more information about what other capabilities
00:38Could you fetch and get more information on?
00:41But for now, I'm only gonna focus on a couple which are important
00:45All right, so I'm gonna put your a little trace and I'm gonna basically print them out. So capabilities
00:50I'm just gonna copy this names. I don't have to type this each time. So the first one is capabilities screen DPI
00:57Now the screen DPI returns to you the amount of pixels per inch
01:01Okay, and by getting that information you could calculate and figure out basically how many inches is the screen itself?
01:08Because every screen has a different DPI
01:10So it's not it's not dependent on pixels because it could be pixels are a relative number as we spoke about in earlier
01:17Videos of hours. I believe we talked about that in our HTML training as well
01:22Pixels are a relative information that just basically say how many points of information you could have on your screen
01:27But they do not define actual physical size. They define computer size
01:32So to get the actual physical size, you could use the screen DPA DPI and figure through it the actual resolution
01:40Now to do that, we'll use another capability, which is the
01:43capabilities of why don't I capabilities dot
01:48screen
01:50Resolution X and
01:52capabilities screen
01:55Resolution Y those will give us the actual that those will give us our actual
02:00Pixels so our X and Y will give us our pixels while our DPI will actually give us our screen information
02:06So for example in this scenario if I save this out and I publish this out quickly
02:11You'll see that in my output we're gonna get basically. Oh, did I save it? Oh, here we go
02:17So our my actual screen resolution right now in pixels is 50 of
02:232560 by
02:251440 and I have 72 pixels per inch now if I wanted to know how many inches is my actual monitor right now
02:32What I could do is very simple. I could go right into this trace and instead of doing this trace
02:37Let me just copy it out. I
02:40Could basically create a very simple calculation of taking my actual screen resolution X
02:46Dividing it by the DPI which would return to me the accurate amount of inches, and I could just maybe add here a little
02:54little maybe a
02:56Little text and again, I'll probably want to do the exact same thing for my screen resolution Y basically
03:01Oh, and let me just word wrap this
03:04So by the way, I word wrap by going into my in my view and I select word wrap
03:14So if we look at this and and again because we're using word wrap
03:17It doesn't really matter, but it makes it easier for us to see all of our copy
03:19So literally what I'm doing is I'm dividing my my resolution my screen resolution X by my screen DPI
03:25And I'm doing the same for the Y itself and once I've done that my output itself once I make sure that I don't have
03:31Any errors which is a comma here which shouldn't be here
03:34So let me just run that one more time and this time around when we look at it
03:38We'll see that my screen resolution currently is 35 and a half inches by 20 inches
03:43Then that's yeah, I do have a big monitor
03:45I know and if we run this application again
03:47But we run it on our mobile device
03:49So I'm going to do that using the command shift enter or if you're using a PC, then, you know your shortcut already
03:56And once I run it on the device, I'll notice see what are what is the actual inches?
04:00dimensions of my device of my screen resolution itself
04:04And we'll see that right now my screen resolution on the device is two and a half 225 inches by four inches
04:11And there we go
04:12So that's how you get the physical dimensions if you need to do something more physical and more accurate now in the next video
04:18We're going to create a complete application. So I can't wait for you to join us where we'll create a very simple really cool new application
04:27from scratch

Ready to Level Up Your Skills?

Join thousands of learners on 02GEEK and start your journey to becoming a coding expert today!

Enroll Now for Free!