Skip to main content

Overview: What is Android?

Lesson 1 from: Developing Android Apps with Java

Tony Hillerson

Overview: What is Android?

Lesson 1 from: Developing Android Apps with Java

Tony Hillerson

buy this class

$00

$00
Sale Ends Soon!

starting under

$13/month*

Unlock this classplus 2200+ more >

Lesson Info

1. Overview: What is Android?

Lessons

Class Trailer

Day 1

1

Overview: What is Android?

19:56
2

Eclipse and SDK setup and build a Red Flashlight app

38:05
3

Ad a button to a Green Flashlight

21:06
4

Add the Green Flashlight

18:48

Day 2

5

Week 1 - Layout and Build a Task Manager App

04:10
6

Displaying a list of tasks

40:44

Lesson Info

Overview: What is Android?

so welcome. Thanks for coming. And, uh, I'm gonna show you how to build. Ah, very quick android application that gets some Some very basic android development concepts. Um, shown to you so that you could hopefully go away from this since and having a better idea of where to start building your own applications for Android. And so we've got about 90 minutes. We're gonna get just kind of overview of how the android platform, um, stacks up what some different pieces are. And then, well, look a little bit around Eclipse. And, ah, some of the things that the android ah plug into the I D gives you and then we'll build a quick to screened android application, and we'll hopefully have enough time for ample time for questions. Oh, and Tony, this is best I I forgot to mention this in my little intro, but you had reminded me to mention for people who attended Tony's free pilot session on Android last fall he's gonna be building the same app during this session. But this the app that he builds sta...

rting next week and then remaining remaining five sessions is completely new. So if you attended before Ah, lot of this may look familiar to you, but come back next week cause it'll be all new information next week if and for the remaining five classes after this one. So we'll be getting a lot more in depth than we did last time. Okay, So as they've already mentioned, my name's Tony, uh, work for a company called Effective. You and I get to build cool applications for lots of different platforms. Android being one of them. And ah, I really got interested in android development early because I was scared about the process of getting up to speed with IPhone development. Although I have since surmounted that fear. Um, but Android seems to me to be a little bit more interesting right off the bat because it was open source and I could get in and check out what actually was going on inside the sdk. Ah, the framework, classes and stuff. And I like that. I like to know that I can do that when I'm when I'm learning how to develop for a platform. And, of course, the three gadget factor is definitely one reason I like building building for android as well again We want to keep this nice and informal and and, uh, and student driven as's faras. You have questions, and we'll tell you, just just let us have the questions and we'll tell you when to back off if we want to get through anything. But especially if you want to know anything about some comparative sort of development stories. If anybody's interested in talking about differences between these other platforms and android, I'll try to help out there. I can answer most from the standpoint of of IPhone. Um, since I've done that. Okay, cool. So we've got some people that air that air definitely into the mobile space. As far as development goes, eso let's talk a little bit about Android for those who are unfamiliar with the platform. Ah, A few years ago, Google started something called the Open Handset Alliance, and you could go read more information about that at the Web address. Their open handset alliance dot com Ah, at the time I wrote the slides or is over 40 members. I think there may be more now, and that was basically a sort of a consortium of device manufacturers and the people who make the hardware, the people who make the software and the networks and, ah, Google got them all together to kind of get there their idea of an open handset platform, open, smart form platform that they called Android out there so that people could start to rely by people. I mean, developers could start to rely on there being a platform out there that they could develop for that would hit a lot of devices and users would start to get users of the of the devices would start to get an idea of uh huh kind of a new experience that they could rely on on a lot of different devices as far as the operating system goes. And of course, Google would would, um, push forward the idea of open software, which is important to them as well. So that's kind of where this all started. You might. It might have even been around three years ago when that first sort of a demo of Android, the nascent android platform, was shown, and I got a lot of people excited, and the goal for them again is ubiquity. So there's a couple devices here that are already out there, and there's a few more that aren't listed here. But the idea is that soon there's gonna be a lot of devices and you'll be able to has developer take advantage of that ubiquity to to develop for all sorts of different platforms. As we said, it's an open source framework so you can go get the source right now if you want. If you want to go to, ah, source that android dot com and you can get the actual framework code and even mawr, um, for ah to kind of figure out what's going on inside there. And I always recommend to get in and understand the frameworks that you using not just how to develop with the components, but also what's going on inside there because there's a lot to learn about the right ways to do things interesting new tricks and tips in code. Um, and you can also, of course, get the sdk, which is what you used to to build, build the applications and the I. D. E for android runs an eclipse. And of course you have all got that set up, right? No fleet. Hopefully if they do, and if they don't. We'll definitely haven't set up next. So actually, actually a question. One person asked, Can you use net beans? I do not know if you can use net beans, but you condemn innately use net beans to write java and everything is jobs so you can get the the ah, the jars for the sdk. Um all set up so that your job of requirements are are are covered. And then you could use the sdk from the command line or something like that, maybe even hooking some scripts from that beans to make things happen, like copying up the the the application to the to the device and also compilation compilation is different. So we're gonna get into that in just a second. Um, so let me just go go ahead with that. So you're gonna need to compile through the sdk. And here's why. Let's talk a little bit about the platform. So it's Android is built on a Lennox colonel, very small, um, standard set of software components that that air nice and lightweight and ready to be built on. And then, on top of that, there are a bunch of native libraries that are specific to the device that they're running on that give you some sure, a surety that you'll be able to do things like run video on any of the platforms. Those of the bridges between the your code and the device, the needs of the device that it's running on. And there's a few things there some some libraries for doing two D or three D graphics. Sequel light for some local database storage. The browser, the Web browser, Things like that are in the native library category. And now here's that point that I just made about compilation. You were writing Java code to run on these android devices, but, um, it's not, um, compiled down. Ah, actually, I'm not quite sure about how the compilation process goes. It may be compiled to Java byte code and then cross compiled or it may go straight from job. I'm not sure, but in any case, it's not Java byte code. Um, that that is the final destination. It's actually come filed into Ah, amore efficient amore. Ah, lightweight by code for running on devices and that's ah, run inside of a virtual machine that's called Dal Vic, which is which is the ancestral Icelandic home of the engineer who wrote this This, uh, this different vm in this approach for running job on on mawr on devices where you can't you don't you can't have ah, you know, Java hogging as much memory as it's as it's ah notorious for So that Dalva kvm that there's a There's another compilation process to get the bike code ready to run on that VM. So that's why you need to compile to the sdk. On top of all that, that runtime is the android framework, which Google was written. Is there a question? Nope. I was moving. Some things worry. Okay, fine. Um, that android framework gives you access to some software that the user that's already ready to go for the user. So there's things like the contact. Um ah, actually, no, it's the system maps. That's the next one. Reading had a little bit, but, um, that framework gives you some ah, classes that you'll use to compose your applications together, using the common framework that all of the software on android devices, even the system maps that ship with your phone. Like the contacts. Ah, the phone dollar. All those things use the framework just like you do. So you're writing applications just like just like the android developers do, and they have access to the same tools that you do. There's no there's no special private AP eyes like there are in the IPhone that you can kind of hacking and figure out how to use. And then mega chur your hand slapped by apple or your your app won't get deployed. You get access to the same system tools as the Google developers dio, which is kind of cool and then, of course, sitting alongside those air your applications. So that is kind of how the framework breaks down from top to bottom and, um, composing your application there. Let's go through a little bit of app for of, ah, vocabulary. Now that we've kind of seen how the platform stacks up now the different parts of your application that you need to know to build your applications Let's look at those, um, one thing that you ah build your application out of are just the resource is like pictures and sounds. Maybe some media things like that that you want to use inside of your application or you know, pictures could be used for skinning or making your application look a certain way. That could be some text, like maybe some legal text you want to pull in, Um, or any of the fact any of the strings in your application we're going to see it's automatically set up for, ah, for internationalisation and localisation. And the way that's done is everything is compiled in this sort of initial compilation phase. Um, compiled meaning there's actually a class created called Are that, um references. All of those resource is for you, so that you kind of have a global resource locator type of a pattern. Um, through this class called are where you can get a handle on any of those. Resource is in a kind of a conventional manner. So you have to go looking up strings off of the file system or things like that. So when we talk about resource is, we're talking about things that you're gonna pull in through this class called our and those can be of many different types. Another important concept is the activity. So an activity is basically, um, kind of a controller in ah, model view controller pattern which hopefully you've heard over this kind of the, uh the sort of fundamental pattern that's used in in the gooey programming where you're building things with a user interface. Thea the model, of course, some sort of models, whatever system you're trying to build. Ah, and the view is what gets shown to the user. But the controller is what what controls interactions between those two and gets data from the model, puts it on the view, takes input from the view. Sort of makes the whole app run kind of in the controller class in in the android framework is an activity. An activity can basically be thought of as controlling one screens worth of data. So when you see a screen, you're probably seeing one activity now intense are kind of like the verb. That's kind of like how I like to think of them another way to think it from maybe like a command pattern. If you're if you're used to that, it's basically a way of telling the framework that you want to do something. So I want to open up another screen in my application. I want to open up the dialer application and call a number or allow the user to call number or I want Teoh. He's another application as a service, something like that, that the intent is what you do, what you construct in and send around to make the framework, do what you want and will be running to those in a little bit. So, um, those air some Ah, a little bit of fundamental concepts, kind of, Ah, that will be going over here and more concrete form in a second. But are there any questions so far, Kind of about the platform or or any of these initial concepts? Yeah, we do have quite a few questions. A couple of them are related to the clarifications on installing. So when people go to download Ganymede, is there a specific version of Ganymede that they should download? I have been telling people jobs up. It is that I'm or is there a more specific version? Oh, well, so that you get presented with like, are you a Java developer or are you a enterprise developer? Just the Java version is fine. The Java version. Okay, great. Yeah. Um, any modern in any of those will actually work it's just more. It'll be a longer download and they'll be extra stuff that you don't theoretically need. Okay? One person also asked, When you go back to screen sharing if you could show how to check which version of Eclipse and Android sdk are currently installed, If there's a way to check that, sure. But when we jump Okay, Um, one person also asked, What is the comparable Java version that's used in the android? VM? Uh, I think that would be It's job 16 in the android. Well, you you're able to use his job of what would you call him? Like sdk for your A p I features, like, obviously, 1.5 features are are supported, so you could do things like annotations. Works weren't available before that. Um, I'm kind of drawn a blank on what a good example of a difference. 13 1.6 and 1.5 are. But 1.6 is you can code to 1.6. Okay. All right. Um and then, um, let me see. There was there was a question in here about I find it. Somebody said Jonah compiles for jbm One can even d compiled Java code. Is that also possible with compiled android APS? I think so. I don't I haven't looked into d compiling an android app from from the Delphic byte code. Of course, there's more to it than just the bike. Oh, there's also the resource is that get shipped along and maybe optimized. Um, like they bite line the images or something like that so that the images certain are optimized for display on the device. But I haven't worked with any D compilation software. I'm sure I'm sure somebody's looked into it, though. Okay. And if you download android 2. point one, does that include 1.5? Or do you need to download 1.5 explicitly? If you want to target the older versions, Yeah, you'll need to get the 1.5 STK thio Thio. You can compile your application against that. Otherwise you'll be, you know, compiled against system classes. That may not be there. Possibly so. Yeah. You know, you only doubt that I can I'll do a little quick to worthy of ah of where you update that stuff in eclipse. Okay, Great. Um do we have any questions? Other question from the chat room that the moderates want to pass along before we go on. We're having some questions regarding the Native Code compilation. If you can use GK plus directly with your job. Android Epps I don't have any experience with DTK. I'm not. I didn't know you could do anything with Child. It was G T. K. I thought it was a way to write sort of system independent stuff and see. But maybe I'm way off on that. I don't know. I'm not sure how to answer that one. I think they're looking at trying to hack around, going right to Native instead of using the job, you guys to get a little bit low. Well, then you want to look. First of all, you shouldn't be in this class. And second of all, second of all, you want to look into the N D. K, which is on Google site as well. If you just searched Google for ah Android N d. K. There's a native development kit which lets you right, I believe C plus plus and ah get access to very device specific things so that maybe something you'd want to look into. And a lot of these questions are probably answered on the developer. Don't android dot com slash sdk site as well. So if we don't get to all of your your questions about installs and sdk versions, there's probably a lot of good information there. That's right. Okay, so let's take a look at what we're gonna be building today. Um, So as we build this application, gonna learn your way a little bit around eclipse and all kind of take some extra time to show some of the answers to the questions that we've just had. Um, I'm gonna show you kind of the anatomy of an android project. We're gonna build two very simple views, and we're gonna build two very simple activities to control the views and then use an intent to open one of the views from the first view and hopefully learned a little bit about getting around in eclipse as well. So I firmly believe that you can never have too many flashlight applications. There's a lot of them out there, but we can always build another one. So let's what we're gonna build is a flashlight application and actually let me flip right over to the emulator. Is everybody able to see my emulator? Should be a red screen with keypad and stuff. Okay, this is the android emulator. Hello from the great flashlight. Flashlight application. The new Hello world. Yes, I I think I mean, you could still do. Well, hello. Hello, world, I'm sure, but this is so much more fun, right? And useful. So, uh, we're gonna build, um, a flashlight application that has two screens. One is a nice read, um, to keep that visual purple safe in your eyes when you turn it on at night and then you can switch over to a green 12 which is probably gonna be a little bit later. And that's what we're gonna build today. So you can see that we're gonna be working with one simple component besides the activities. And the views were also going to be using a button. And then, if you remember back to the vocabulary, actually, can anybody answer what what I may be using from the from the vocabulary discussion to switch between these two screens? Everybody's saying intent. Good, good. I didn't I didn't put anybody to sleep during that spiel. That's good. That we know off

Ratings and Reviews

a Creativelive Student
 

I thought everything on this site was free and now they want 99 dollars for a course

a Creativelive Student
 

very good

Student Work

RELATED ARTICLES

RELATED ARTICLES