Skip to main content

Eclipse and SDK setup and build a Red Flashlight app

Lesson 2 from: Developing Android Apps with Java

Tony Hillerson

Eclipse and SDK setup and build a Red Flashlight app

Lesson 2 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

2. Eclipse and SDK setup and build a Red Flashlight app

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

Eclipse and SDK setup and build a Red Flashlight app

So the first thing we're gonna need to do is just start out and generate our hand road project. And we're gonna make a very simple red background and put the label red on the screen so that, um we can tell what color we're looking at and that that's enough to get kind of a good idea of sticking off your android project and doing some very simple basic stuff that is fundamental to all your app development. So I'm switching over to eclipse. Hopefully, everybody can see eclipse. I've kind of got eclipse set up as if I had just Well, I did. I just opened it opened a new workspace I like to keep. My workspace is clean, and I just have the job of perspective Open as you can see up here in the top. Right. Um, let me quickly open up the preferences for eclipse, and you can see that in your preferences Pain? You should have this android, um, item in the tree on the left s. So this is where you do all that set up that we talked about? Uh, you need to point to where your sdk is located. That will...

be system dependent when you build, You have this depot debug key store. All this stuff should be set up by the sdk installation into the I d. E. Um, Let's see, What are some other interesting things? Where you OK on this first tab? The android, Uh, around the first sort of tree at him here for Android. Um, this is where you set up the different targets that you have available. Okay? Just popped into view there. I was gonna hit apply to make sure that it refreshed it, but it did. It popped up. So you should see something like this. Um, if you have all of these different parts of the sdk downloaded and I will show you where to do that in a second, an answer to that question. Um, So I have I am able to build against any of these these STK versions or a P I levels a Z could see the FBI levels of kind of increased, uh, sort of an auto number type thing, starting with two, which is 1.1. So I guess I haven't downloaded one point. Oh, but, um, there's also a difference here. You'll see that you can build against Ah, just basically android from anywhere from one any of the sdk versions that you have installed. But there's also a Google Ap eyes one. The difference there is that Google is going to be splitting out some more sdk elements like, for instance, the maps, which is the first, the 1st that's split out into its own separate STK so that you can you can decide whether or not you want to, like if you have a map in your application, need to use the Google AP ice. If you don't, then you could just use android and you can maybe save a little bit of resource. Is there um okay, so I can choose here? Which one of these on building against or I'm running against? I'm sorry, not building. It's about running against, and that's when I run in the into the the emulator. So I'm gonna choose 1.5 and hit OK, and now, if you notice hopefully everybody has this on their screen. There's a kind of a phone icon or a device icon, and that opens what's called the AIVD manager. Um, and inside of here's where you do? The updating of all the sdk is that you have installed the sdk versions and also where you set up your AIVD or Android virtual device, which is the emulator that we've already looked at here, um, to be ah installed with the platform in a p I level that you want. So I have to set up here. One is simply android 1.5 and then I have one for android 1.6 with the Google AP ice. So this is Tony. We have a question from the audience about this. Hi, Tony. My name's sunny. Um, I understand that if if you have a current device, maybe it's an android. Two point. Oh, and if you build your application with Android, what is it? 2.1 that I downloaded recently? You're probably not going to allow your application to run and say an older G one that was running in T Mobile. So can you give us a general idea of you know what was running android 11 What was one of 1. when we develop applications? Um, you know, when we make that choice, what? What's the best way to go in terms of making sure we at least get G one and forward. Well, I mean, if you if you need to get back to. So it is a question of of pennant, like sort of market penetration versus features. So do you need something from 1.6 or two point? Oh, if you do, you know, is if it's central to your application, then you obviously need to build for that. And and then you will just be restricted by the mark at the marketplace level. So users on those devices just won't see your application. As far as I understand it, I'm not sure if there's been any changes there. Um, that's not a choice that you make. It's just they just won't show up because it knows that you're built against that sdk level or the A P I level. Um, But if you're if you don't need those features than, um, compile against, say, 1.5 or 1.6, so you had to get a better penetration. Thank you. It's just kind of a trade off. So ah, there we go. And then from this AIVD manager to answer another question that was put previously. I can check out which packages I have installed by clicking here, and this shows all of the A p I levels that I have installed. And if I goto available packages, I get this little drop down. It's kind of like a most eclipse update experiences that you've probably went through and you can choose. Ah, so here's 2.1 AP I little seven, which I don't have. I could go. I could go click on these fellas and then say Install. And then I would have those those SDK versions available locally. And that's how you do your updating. Okay. Are there any questions about that? That was kind of like just in answer to a question I wasn't planning on going through that there was one more question that a bunch of people have been asking. And that is when you go to download Ganymede and as android sdk do they install together. Do you have to do something special to get and the STK into Ganymede? Nope. I can go through that too. So eclipse is not going to know anything about Android. So you want to go here? Two helpful I mean, um, but the eclipse help. And then, ah, you would want to go Teoh, install new software. Ah, and then you'll get the regular eclipse update experience. Um, And if you go to the android site the android developer site, and go to the A t t plug in for eclipse, you'll see over here on the left in developer dot Andrew dot com installing and updating and come down here to installing the a t T plug in and their instructions for Galileo and Ganymede. Um, by the way, that Ganymede isn't wasn't ah. Requirement is just gain a meter later. And I think Galileo is later, Um I mean, I know Galloway was later. That's what I have running. So it's just it should work fine, even one. But what you need to do is copy this this location field for whichever one you have installed, and then copy this into or paste this into the clips. Um, where you go to add a site, Um, and to Okay, I have this location stalled, but, um, you give it to the to the site, a name, and then you put in that location and then you'll go through. Okay, um, and kind of a walk through to downloading the sdk. And so you actually download the eclipse. They're the android. Plug in for eclipse through the through the eclipse interface. All right, let's see some code. Cool. All right, so here I am an eclipse. Um, and I have the, uh as we kind of mentioned as a prerequisite when you have the, um, the android sdk plug in installed. So just as I would with most any normal job a project, I'm going to create a new Sorry, I So I have my package manager over here to the side. This is this shows from a package level view everything that's inside of my project. So I'm gonna open up this guy. You may or may not be, um, popping it out like this from the side to kind of get more screen real estate. But, um, if you see a tab labeled Packaged Explorer, that's where I'm doing all this from. I'm gonna go here and right click and say New Android project, which is ah, a menu option that I get now that I have the plug in installed and I get this little wizard here. And here's where I where I will choose the build target. Um, down here, the one I want to target the sdk. The A p I level, but I want a target, and I'm gonna call this project Simple flashlight. Um, the default location to find you can kind of choose wherever you want to save things on. But this will show you where the project actually gonna be saved where the code is going to be saved. Um um, but I'm going to choose 1.5 for the build target. And then I also, uh, will be able to generate some code and get me kind of kicked off without having to do is much typing down here in this bottom area. I can choose the application name, and I'll call that simple flashlight as well. Now, the package name, um, you know, is important to a job. A project? That's kind of how you how you put your particular stamp on your codes that you don't have ah, names based collisions, but an android. It also, in addition to name spacing, your code the classes that you create. It's also the unique identifying four year application on the marketplace as well. So you need to have a and no, I don't know how to look up and make sure that no one else has taken the same package. Name is you, but just keep it to a standard. Ah, um, domain name or something like that. Reverse domain name, and you should probably be okay, but it is a unique identified for your applications. So also tried to think ahead to, um you know, if you're gonna be creating more than one application than you need to make it unique among those applications as well. So I'm gonna use the common Riley dot android dot flashlight package. I'm also gonna create an activity, and this is just gonna save some typing. Um, and then I'll kind of go in and show you Ah, what it is. But I'm going to start out with just the red flashlight activity and the monastic. A version is three. So this is where you get to choose. Although, um, eso you gonna get abound, right? So you can you can compile for 1.6, but say that your men STK version is three. That's one thing I kind of forgot to mention You can second say that I'm compiled against 1.5, but I'm not using anything special so that we can go back to four. And I'm not sure if any weirdness is show up there. So my recommendation is to keep it on the same A p I level that you're building against nature, that your target is. So that's what it is here, the three and three. So I can also choose to create a test project, which will be some test code. I'm not going to go through that right now. Just gonna click finish. And now, um, clips will helpfully generate some code for May. So back in the package, slower. I can click around in here and kind of give you an overview of what a standard android project looks like. So, uh, we have the familiar to Java developers SRC meaning source folder, and that has the beginning of our our package chain. And it kind of grouped up for us so calm that O'Reilly not Android, That flashlight was the package that we that we made and inside of there was that activity that I asked the generator to create red flashlight activity so all the source code is stored in her source. I'm sure you're familiar with that convention, but there's also another source folder in Android, which stores full. I'm sorry. In Eclipse, which stores? Stores source, and that's called Jen, and this is actually generated code. So this isn't something that you ever edit edit, But we can take a look at it as we go through an add new things to the project. Because this is our old friend are that I talked about during the sort of the vocabulary and and, ah, platform phase. This is where all the resource is air are referenced, and this generated. It's generated and maintained by the SDK, so don't edit it. Um, Android 1.5. This is the android jar with all the framework stuff. If we had chosen that Google one, we would see one more jar in here which has the Google specific classes, um, assets. You can use that to store different things, but most your resource is going. I'd never really use that folder. I'm not really sure why there's this kind of broken out that way, but all the resource is that I have are stored in this directory. Cold rez. Um, and there you could see that we start out with three different types suggested by the generator. One is draw ble. The other is lay out. The others after that is values. So inside of draw ble is where you want to store your pictures your your images that you use either for skins or to put on the on the onto the view in some way layout contains all of the layouts and those air written in XML, and we're gonna be looking at those in a second and then inside of values, you can store, um, arbitrary values. Ah, and the convention is to keep them in in ah, file name that has some sort of meaning that tells what they are. And in this case, we have some strings. So strings are broken out into their own separate configuration sort of structure, so that that way localization works, and we're going to see how that works in a second as well. So this whole packet or this whole directory structure underneath rez Now that I've shown you the conventions, it's arbitrary because all of the resource is get um, described inside the XML, and that's that's how the actual structure is made up so you can have. You can organize this to your taste if you need to sort of break up. We got a lot of strings in your strings file. You can start breaking those up into different files that make more sense for your layout and a little more descriptive. Um, but we're going to see what's inside those guys a little bit. Um, for right now, let's look at the manifest. So the manifest is what describes your application to Google in all of its different context that it needs it. So this is what the the marketplace will look at when it you upload your application to figure out what SdK version it's compiled against and which for which sdk version it supports and what the name of it is and what's. There's some permissions that you consent like, Hey, I'd like to use the users camera, So if you've ever installed in an android application to the market and you see that hey, just as a bit of information, if you want to make sure that you trust this application it's gonna be using your, uh, your location. So if you don't want to use your application, this now is a good time to not install the application. That kind of stuff. All of that's all of that is taking care of inside the manifest. So, um Thea, the I d. Here is giving me this this fancy view for editing it, but I don't really like that. So I like to take go down to the tab here at the bottom and select the XML versions. I can actually see the code because that's a lot easier toe look at You know what I forgot to do? And every presenter should always dio is ah, change the font size. So let me bump that up real quick. There. I should have read that a little bit better. Okay, so, um, again, this is our manifest. This shows Aziz, you're probably wear them. What? The word means that pretty much This is how this is how things are set up inside of our application. And what what comes along with our applications? You can see when we chose the men s UK version that got listed down here and this uses sdk, and you got listed up here. Ah, well, there's There's another place that it can show up inside of the manifesto. The application tank. I can't remember which one. Um, also, we can store information specific to our applications. So this package structure is important. Um, again, because it's the EQ. Identify where, um, but you'll also notice that you'll see in the manifest package attributes you see the full, fully qualified package name and then down here in the activity tag underneath the application for our application, there is a activity named red flashlight activity, which we generated, and it starts with a dot. So you can probably probably see how that that's just can caffeinated straight, um, onto this package. And that tells Android what? Ah, the actual class for the activity that we're talking about in this manifest file here is located The fully qualify class name is the combination of the name and the package at the manifest level. Um, you can also see, um, there's the intent filter part here, which is a little bit, um, more advanced than we need to worry about. But since it's generated, you can probably guess that this is kind of boilerplate. Basically, what this is saying here is that there's an intent filter on this activity that we generated called android dot intent dot action dot main and another one that one that falls under the category of added android on intent. A category, that launcher. Basically, what that's saying is, Hey, android, When this end application is launched, start this activity. So I'm just saying that this activity here is the main activity that gets ah, they get to run from the from the applications perspective. So this is this is what the manifest is all about and we'll be coming back to look at this in a second. Um, you can be sure that All right, so that's kind of a description of ah, the layout of Of an Android project, a standard android project. This is this is how the sdk will will look at things and how the I d will generate it for you. I could see I've got some errors down here and we figure out what this is all about. Missing a required source, holder Jen project cannot be build so Java are Ah, Clip said a little bit of a problem building my completely generated application. Not sure What is complaining about? We had a couple of people online. They're saying the same thing. Really? Great. Thanks. Eclipse. Nice work. Well, I mean, I don't know how toe fix that. Accepted. Just, I don't know, Fraud. Some stuff around here. Uh, close the projects. I don't know. Open the project now. Refresh. Okay. So clean will sometimes fix that. So Ah, I began. I don't know why this happened, but when you get weird project errors like this that you just don't understand why it's the case. Um, just a ziff. You were on a Windows machine and you would reboot to fix it or less often on a Mac machine. Like I had to do with the beginning of this screen cast to reboot to fix the problem. Ah, Project clean is kind of like a project reboot. So I'm gonna go clean that and see how it works. That basically destroys generated stuff and looks like we're all green. So yeah, the, um if anybody else is having that same problem, do a project clean and that should fix it. I don't know why. Why Eclipse didn't get its act together the first time around. But there you go. Okay, um, let's dive into some code. Um, let's look at what we've already got so far with the generated code that we've got. So there's two things that want to look at and let me start from the most user facing of things, and that is inside. The resource is inside the layout. Um, So what was generated here is not only an activity. We said we wanted an activity to be generated, but but clips also generated layout force to use, and that was called Main. So I'm gonna open up the main XML layout and it's gonna open up in this sort of visual editor which comes along with them with the, uh, di d Um, you can do a lot of stuff in here like dragging things out in positioning him and what not And you can also simulate different devices, simulate different orientations and all that stuff is real nice. But I find that it's still a little wonky, and as a developer, I always like to see the code. So I switch over here to the actual XML. So, um here are some tags that you're going to run into a lot. Um, this falls under the class of layout, and it is a linear layout. Linear layout is are sort of our first introduction to android layouts, and basically, it means lay things out in a linear fashion. And then, based on this Andrew orientation attributes, we want to lay things out in a vertical layout, which means stop the bottom. We can also use horizontal on will be running into playing more layouts and later, later lessons. But basically, this is saying inside of this tag, um, whatever you find lay it out from top to bottom, sitting on top of each other. And, ah, it also puts a text view in there for us, which is nice of it. Although, um, we're gonna repurpose it a little bit. So if I switch back to the layout view here, you can see that's what's showing up right here. This little text fears sitting at the top. So, um, let's do a few changes. We can kind of get an idea for how these things, uh, these components, like text, views, work. Um, first of all, every android layout elements. Every component, pretty much without exception, has to have a layout, wits and a layout heights. There are some exceptions, but for most for the most part, until you know what those are, you're just gonna be boiler plating in layout with and layout hype of either feel parent or rap content. And what that means is, as you can probably guess, feel parent will stretch the component from in its dimension. In this case, with this, full parents of that text view stretches across the whole screen and the hype is just wrapped content. Which means I will be laid out as Bigas the contents This biggest my contents speaking from the point of view of the text view. So, um, height, his rap content with this Phil parents, I'm gonna change that to be, um, wrap content for both. And I'm going to come up here to the layout tag and I'm going to say android gravity. And when I hit control space on any of those platforms, I get some collision completion for for us there so I can type a little bit less. I'm going to say the android gravity should be center now, when I respect a layout mood. I can see that the Texas centered in the middle of the screen. So this is I mean, if you ever worked with anything like HTML, it's probably fairly fairly familiar to you. And especially if you've worked with something like adobes Flex. This is pretty familiar. This is kind of like an XML layout language with components and stuff like, um, like you would expect. So you're probably pretty familiar with this stuff already, even though you don't know it. And as we go as we go through, you will see that more and more. Okay, now, another weird thing that you may have already seen in the in the manifests and we're gonna look into a little bit more now, Is this particular syntax the at string or the at something with a sort of a directory path type thing? So this is how specific two strings, how the android APS are localized and internationalized. So what this is saying is get me the value of the string label toe low and put the contents in here. So if I come back here, open up my package manager and go to resource is values in the strings. XML director are sorry file that we looked at a second ago. If I switch over XML view, there is a string inside of string tag with the name of Hello, that is Hello, world Red Flash activity are influential activity, which is what we see on the screen when we goto layout view in the main XML. Tell the world red flashlight activity so you can kind of see how how those values air looked up off of the the resource is that are set up. Um, So what I'm gonna do is change this string. I want this to just say red, so I'm gonna make a string called Red and you can see over here in the in the left. When I saved this, I got a compilation error because it's saying I don't know where there's a string red. I don't know of any string called Red, Actually, get rid of this. Hello. We don't need it anymore. Something the name this back in the strings XML from hello to read and say red Now we should have a label of red in the middle of our main XML. And there it is. Okay, Good deal. Now, the last thing we need to do for this step is to make a red background on a on this on the view for this activity. So I'm going to you put a background attribute on here, and I'm gonna use the resource set up. You could see I got a little bit of completion here, control space. We'll bring that up for you. So I can I can complete this with a drop below. Lay out a string or there's other types to someone Add one called color. I want that to be color of label red. So you can see I get an error here because I don't have any such resource. So now is the time to create that. I'm gonna go to the resource is inside the values because colors conventionally put inside the values directory, um, and creating a new file by right clicking and saying new and creating a file in the column that colors dot xml And when I switch over to the XML, view the route tag and grab this sort of boilerplate XML declaration, Um, in the root tag for all these resource is our sources just like inside the strings where everything inside of this resource is. And that that is how things are organized inside of the R class, which will see in a second. So keep that in mind. It doesn't matter what the file name is. All that matters is that things are organized inside of the resource is tag and they have attacked the android understands. Like, for instance, when I since some inside of this resource is tag, I can get some completion here and I want to choose a color. So inside of the color tag android will know that I'm defining a color that I want the name to be read and you may be ah, used to seeing ah well, so I can I can define these just like I wouldn't say html or something by going like FF 0000 But I can also define an Alfa on there, which I believe goes first. So I want the Alfa to be FF. Now if I'm wrong, that's gonna be really crazy looking color. But, um, if you're if you're not following me, basically this is an html sort of hex description of the color which is means, ah, want full value for red and no value for green and no value for blue. So it's gonna be a red color. And then if I'm right and Alfa goes first, this means that it's full Alfa, I mean, does not semi transparent, and you can play around with that. But you also don't need to define the Alfa. So maybe I'll be No, I won't be safe. I'll try this. I'm gonna stake my reputation on this. Okay, so now we have got a red background. If I switch back to main, that error went away on this layout. I've got a red background. When I look here, there is red fully. Alfred. Ah, non transparent, Red. So now we've got pretty much what we want to see for this first step. And without ever going into the Java code, just we've just looked at a layout so far. Um, let's run this in our emulator. Ah, and see the fruits of our labors. Someone a right click. Simple flashlight. Here, the project in the package Explorer say run as Android application and you can see down here my consul. I'm getting a bit of information. The A P. K is the is the compiled together application uh, the extension of the application there ago. So that's what the compilation did. It built all the Java code and did all that stuff and compiled the The resource is in the right place and set up the manifest. And then it uploaded that a p k to my emulator. And here we are. It's running inside of the emulator. A round of applause, please. Sounds like people wanted to see this code, but we've we have completed the first step. One thing I'm was talking about here is down to my console. It tells what we went through installing simple flashlight, a PK. So the sdk built together. This a p k or a pack, as I call it Like an android application is compiled into this one file, and that contains the the compiled Java code. And the resource is air put in the right place and all that with the manifest, and that that's what constitutes your android applications. When you're testing with other people, you can get one of these a PK files and ship it around and uploaded to different devices with the SDK. In any case, that's what ah eclipse is doing for us here. It compiles together the A p. K and then uploads it to the emulator and then starts that first activity in the default activity. Like everybody can see here. I think it is it. Yeah, I think it is. So you could unzip it and look around inside. No structure. Yeah, I've never actually done that. That's kind of amazing that I haven't done that, but, uh okay, so So people wanted to see the code. Maybe. Maybe now that I'm online, we can ask some specific questions about the code. Yes, I have a question from somebody. In my resource is XML files. Can I define my own resource user to find types instead of string or color, etcetera? I think not because, um, android is going to set those up based on. So there is a There is a very complex way that I think you may be able to, but I'm not sure because I haven't looked into it. I don't think you can just arbitrarily do it. It's It's more than just putting the tag in there because the tags are known to android by another set of resource configuration. Um, keys that air, that air kind of set up at the sdk level, and you may be able to make yourself I'm just not sure, so I'm gonna say 90%. No, I don't think you can, but somebody may be able to prove me wrong. I'm not. I'm not quite sure on that. Okay. Can you use maven to develop android apps? You can if you If you're the type of person that wants to use maven you condemn, please use maven. Um, I think there's actually some cool, um, palms or whatever. It's been a while since I've used maven, but I think there's some some definitions for using the sdk stuff and, you know, running a test phase and all that stuff through maven I mean a good a good ah use case for that that maybe like you wouldn't use it locally but you unless you wanted to. But then you could also have a continuous integration build that's running a test suite for something like that and posting results so that when people check in, it'll run the maven suite of tests or the suite of tests that may even knows about and maybe even put the A p k up for somebody to download. Andi installed to a Q A device. So yes, that's definitely possible. Okay, and now there's There seemed to be a lot of people who were having an issue with, um with the Earl de l dash ssl google dot com slash android slash eclipse It says no repository Found in a lot, a lot. A lot of people said this. Yeah, this is Ah, I I couldn't tell you. I mean, it may be down. Maybe. Ah, Google's doesn't seem likely, but Google could have had a hiccup there. That's not something I don't have. I don't know how to solve that unless I mean, if they're copying it in off of Google's website, then I'm not sure what's going wrong there. Yeah, well, post links and then give it a test after class. Make sure and a couple people asked, Are the versions of the android versions backward compatible on? Assuming that you're not using features that are specific? Teoh 2.1 Are are they backwards compatible? If you make sure you choose that AP I level correctly. So if you compile against 2.0, and you set the men sdk level lower than two point. Oh, whatever That is. Like I say, I think 2.0, is sdk level five. I may be wrong on that. Um, say you compile against you build against two point. Oh, yes, you can. You just show for everybody the colors about XML file instead of the back slides that they can, uh, start corrections for the areas they're getting colors. You know what I'll do. Even this will be even nicer for I'm not sure who is doing what. So there's split view. Nice. Um, OK, so if you compile against 2.0, and you set the monastic eight level lower like, say, people know if two point I was five and you set the monastic a level the three, you'll get a warning, um, through the compiler. So it's not actually an error, and in that case you should be fine deploying to those those later those earlier ones. But there is. There is a reason that there's a warning, and maybe it's just to oversee the fact that maybe you don't you're not getting the results you expect or there may be some other weirdness. I don't know. I just I would keep those, you know, if there's there's If, if you really want to target 1.1, then you should compile against 1.1. There's a couple of comments that are possible solutions to the repository issue. One is to make sure that the Galileo repo is activated in boot from Bhutto's. Bill doesn't have this in there for some reason, so it will fail. Another is Teoh. If you see a choice to download via https, just put a check mark in that box and retry it. And it worked for another person. Interesting. Yeah, I was. I think the last time I went through it installed this. It wasn't https address. I don't know why they changed to that. I mean, if it's an open, maybe maybe some user credentials or something is passed over that connection, and they wanted to keep it https. Any questions specific to that code? Well, I have a quick question. Is XML the most efficient way of changing color rather than in the Java graphics itself? Well, if you hard coded in your code and you're stuck with that. So, um, I mean, the nice thing about it is that you get to be more general in your naming. Um, it's it's more of, ah, design issue, I think so. I'll nay, I'll have a color. I probably won't have a color called Red. I'll probably have a color called background or, you know, main background or something that's more more like, based on I'm sorry based on the with the needs of my application. So then I'm free to choose that. And the semantics of it are that in my code, I will see main background instead of whatever the color is. So it's better from a design perspective to break out. The resource is into the values in a different place, and the semantic meaning isn't isn't in the code you know you're using. Your resource is more semantically, and there's extra benefit of for strings where you can localize them, but you have for color. Is there still a good reason to break them out to colors file

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