1 00:00:00,240 --> 00:00:04,350 And that little thing is an app icon, check out the mockups. 2 00:00:04,350 --> 00:00:07,320 We've got this cool, semi-transparent icon and 3 00:00:07,320 --> 00:00:09,920 it's really simple to add to our project. 4 00:00:09,920 --> 00:00:13,380 Download the zip file linked below this video in the teachers notes. 5 00:00:13,380 --> 00:00:17,130 And once it downloads, go ahead and unzip it wherever you'd like. 6 00:00:17,130 --> 00:00:20,640 Now don't be alarmed by the fact that there's more than one folder in here. 7 00:00:20,640 --> 00:00:24,100 We'll talk more about these different folders in a later project. 8 00:00:24,100 --> 00:00:27,850 But the basic idea is that we provide images at different resolutions 9 00:00:27,850 --> 00:00:31,240 to make sure our app looks good on a wide range of devices. 10 00:00:31,240 --> 00:00:34,070 Now if we jump back into Android Studio and 11 00:00:34,070 --> 00:00:38,140 open the project pane, here in the res directory, if we 12 00:00:38,140 --> 00:00:43,900 expand the mipmap folder we can see the same folders that we saw in our download. 13 00:00:43,900 --> 00:00:48,463 Well, kind of, if we open our project in Windows Explorer or 14 00:00:48,463 --> 00:00:51,957 Mac Finder and navigate to the res directory, 15 00:00:56,842 --> 00:01:01,055 We can indeed see each of the mipmap folders that we have in our download. 16 00:01:01,055 --> 00:01:05,590 But since they each contain the same files, Android Studio simplifies things. 17 00:01:07,270 --> 00:01:10,580 Rather than showing us all the different mipmap folders, 18 00:01:10,580 --> 00:01:16,020 we only see one folder per image, containing all the versions of that image. 19 00:01:16,020 --> 00:01:20,990 And the part in parentheses tells us which mipmap folder that image is actually in. 20 00:01:20,990 --> 00:01:24,640 The mipmap directories in a project mostly contain icons. 21 00:01:24,640 --> 00:01:29,250 And the different suffixes have to do with the different resolutions that Android 22 00:01:29,250 --> 00:01:29,928 can run on. 23 00:01:29,928 --> 00:01:34,616 hdpi is for high definition, mdpi is for medium definition, 24 00:01:34,616 --> 00:01:39,768 xh is for extra high definition, and xxh is, well you get the idea. 25 00:01:39,768 --> 00:01:40,686 If we wanted to, 26 00:01:40,686 --> 00:01:45,310 we could just provide one set of images at whatever resolution we choose. 27 00:01:45,310 --> 00:01:49,740 And the Android operating system is smart enough to scale it for different devices. 28 00:01:49,740 --> 00:01:52,610 But the best practice is to provide multiple resolutions that 29 00:01:52,610 --> 00:01:56,230 we scale ourselves, to give the best user experience, 30 00:01:56,230 --> 00:01:58,840 no matter what device the user is using. 31 00:01:58,840 --> 00:02:01,388 Let's take a look at what we currently have in these folders. 32 00:02:01,388 --> 00:02:06,210 If we double-click on one of these images we can open it up right here. 33 00:02:06,210 --> 00:02:09,710 This is the icon we're currently using, the default icon. 34 00:02:09,710 --> 00:02:12,280 It's created when you first create a project, 35 00:02:12,280 --> 00:02:15,440 all we need to do is overwrite this file with our new one. 36 00:02:16,940 --> 00:02:21,089 Let's close this and then find our icon in the hdpi folder you downloaded. 37 00:02:25,679 --> 00:02:30,361 Then let's copy it and paste it into the mipmap folder. 38 00:02:32,682 --> 00:02:35,810 Then pick the mipmap-hdpi folder and hit OK. 39 00:02:37,580 --> 00:02:39,319 Hit OK again to select the new name. 40 00:02:41,983 --> 00:02:44,850 And the hit Overwrite to overwrite the default icon. 41 00:02:44,850 --> 00:02:49,910 All right, that was the hdpi icon, and 42 00:02:49,910 --> 00:02:55,320 if we open it, sure enough, there's our new icon. 43 00:02:55,320 --> 00:02:58,049 Now let's do the same thing for each of the other icons. 44 00:03:00,532 --> 00:03:05,422 So we've got mdpi, we'll copy that, paste it in here. 45 00:03:05,422 --> 00:03:12,866 Pick mdpi, OK, and Overwrite. 46 00:03:12,866 --> 00:03:19,811 Then xhdpi, copy that, and I wonder if we can just pitch that over this one. 47 00:03:22,450 --> 00:03:24,202 Looks like we can that's cool. 48 00:03:27,138 --> 00:03:32,766 Then xx, Paste it over the other xx. 49 00:03:32,766 --> 00:03:36,586 Overwrite, and, 50 00:03:36,586 --> 00:03:41,043 finally, xxxhdpi. 51 00:03:41,043 --> 00:03:46,619 Copy that one, paste it over its counterpart, and hit OK. 52 00:03:50,377 --> 00:03:51,712 For the last step, 53 00:03:51,712 --> 00:03:56,830 it looks like Android Studios given us an ic_launcher_round folder. 54 00:03:56,830 --> 00:04:01,340 In Android, you can specify both square and round icons. 55 00:04:01,340 --> 00:04:04,858 However, for this project, we only have square icons. 56 00:04:04,858 --> 00:04:11,920 So let's delete this folder, Then let's open up our AndroidManifest, 57 00:04:13,940 --> 00:04:17,340 And let's delete the line where we set the round icon property. 58 00:04:19,540 --> 00:04:22,890 Finally, we need to test that we can see our icon. 59 00:04:22,890 --> 00:04:23,448 Let's run the app. 60 00:04:28,356 --> 00:04:32,325 To see our icon, we can just go back to the home screen, and 61 00:04:32,325 --> 00:04:34,270 then open the app launcher. 62 00:04:36,320 --> 00:04:39,960 And there it is, Fun Facts with our new icon. 63 00:04:39,960 --> 00:04:45,967 And if we drag it out onto the home screen, Thanks to its transparency, 64 00:04:45,967 --> 00:04:49,200 we can see some of the background showing through. 65 00:04:49,200 --> 00:04:49,760 Great job!