1 00:00:00,510 --> 00:00:03,860 So here we are back at the Developer Console after a little while. 2 00:00:03,860 --> 00:00:05,050 Our app is now available and 3 00:00:05,050 --> 00:00:08,000 we have a link here at the top that says, View in the Google Play store. 4 00:00:08,000 --> 00:00:09,420 So let's click it. 5 00:00:09,420 --> 00:00:10,060 Check it out. 6 00:00:10,060 --> 00:00:12,120 Our app is live on Google Play. 7 00:00:12,120 --> 00:00:14,890 Now, it's time to spread the word and get it on users' phones. 8 00:00:14,890 --> 00:00:17,550 Let's go back to the Developer Console for a moment. 9 00:00:17,550 --> 00:00:19,070 If we decide to take our app down for 10 00:00:19,070 --> 00:00:22,780 some reason, maybe we realized we made a mistake or we forgot to fix a bug. 11 00:00:22,780 --> 00:00:26,480 Then we can just unpublish it by clicking on the unpublish button over here. 12 00:00:26,480 --> 00:00:30,290 Actually it says Published, and then underneath it says Unpublish this app. 13 00:00:30,290 --> 00:00:33,140 Or we can build a whole new APK, increment the version, and 14 00:00:33,140 --> 00:00:34,660 then publish that new one. 15 00:00:34,660 --> 00:00:37,600 Actually, let's do that real quick so you can see what I mean. 16 00:00:37,600 --> 00:00:39,160 Let's make a small change to our app. 17 00:00:39,160 --> 00:00:42,650 Let's add a new fact, so let's go to our Factbook. 18 00:00:42,650 --> 00:00:48,180 And here in our facts array, go to the end, add a comma. 19 00:00:48,180 --> 00:00:55,340 And then I have this new interesting fact about humanoid robots or androids. 20 00:00:55,340 --> 00:00:56,860 Okay. So, I'll save this change and 21 00:00:56,860 --> 00:00:59,590 the project is ready, but there are two important things that we 22 00:00:59,590 --> 00:01:03,500 need to change in our bill.gradle file for the versioning. 23 00:01:03,500 --> 00:01:05,010 So, let's go back there. 24 00:01:05,010 --> 00:01:09,160 Over here in the App module we find build.gradle. 25 00:01:09,160 --> 00:01:12,422 So the fields we are interested in are over here inside android and 26 00:01:12,422 --> 00:01:13,902 then default config. 27 00:01:13,902 --> 00:01:16,520 We wanna look at the version code and version name. 28 00:01:16,520 --> 00:01:19,550 The version code is an integer value and we need to 29 00:01:19,550 --> 00:01:23,440 increment it each time we upload a new version of the APK to Google Play. 30 00:01:24,450 --> 00:01:27,320 We can just add 1 to it each time, so let's change this to 2. 31 00:01:27,320 --> 00:01:32,260 And now the version name is the version that appears on our listing. 32 00:01:32,260 --> 00:01:36,420 Let's go back to our listing to see, so we're currently at version 1.0, 33 00:01:36,420 --> 00:01:40,650 which if we scroll down we see, down here, listed as the current version. 34 00:01:40,650 --> 00:01:43,740 Now, it's up to you to change the version however you want. 35 00:01:43,740 --> 00:01:47,040 Typically, for a small change like this, it would be a point release. 36 00:01:47,040 --> 00:01:50,560 So we would make it either 1.1 or even 1.0.1. 37 00:01:50,560 --> 00:01:53,590 We generally reserve the higher number changes for 38 00:01:53,590 --> 00:01:56,940 bigger changes, like a complete redesign or a whole new feature. 39 00:01:56,940 --> 00:01:58,490 But it's kind of up to you. 40 00:01:58,490 --> 00:01:59,770 I'll just change this one to 1.1 and 41 00:01:59,770 --> 00:02:03,220 then we want to save our changes and sync the gradle files. 42 00:02:03,220 --> 00:02:04,270 We already have a warning up here, 43 00:02:04,270 --> 00:02:09,360 but we can click on the Gradle Sync button right here, and it executed and finished. 44 00:02:09,360 --> 00:02:09,890 Okay, cool. So 45 00:02:09,890 --> 00:02:12,450 now we're ready to build a new release-ready APK. 46 00:02:12,450 --> 00:02:15,550 We can use the same keystore as before so it goes real quickly. 47 00:02:15,550 --> 00:02:19,660 Go to Build > Generate Signed APK again, and you may or 48 00:02:19,660 --> 00:02:22,620 may not get a prompt here for the Master Password. 49 00:02:22,620 --> 00:02:27,340 In Android Studio, there is a Master Password for the tool that allows you to 50 00:02:27,340 --> 00:02:29,770 use things that are password protected, like a keystore. 51 00:02:29,770 --> 00:02:30,665 So, I'm gonna type mine in. 52 00:02:30,665 --> 00:02:35,155 [SOUND] And click OK. 53 00:02:35,155 --> 00:02:37,240 Okay, once again we're building for the App Module. 54 00:02:37,240 --> 00:02:38,230 Click Next. 55 00:02:38,230 --> 00:02:39,790 Keep everything the same from before. 56 00:02:39,790 --> 00:02:40,990 Click Next. 57 00:02:40,990 --> 00:02:43,550 And build it to the same place and finish. 58 00:02:43,550 --> 00:02:45,000 Okay, it's executing down here. 59 00:02:45,000 --> 00:02:45,640 And we'll watch. 60 00:02:45,640 --> 00:02:48,750 And, all right, we generated it successfully. 61 00:02:48,750 --> 00:02:51,780 Let's close here and go back to the Developer console. 62 00:02:51,780 --> 00:02:55,170 Thankfully we don't need to go through the whole publishing process for updates. 63 00:02:55,170 --> 00:02:58,620 We just need to upload the new APK, add some notes about the update and 64 00:02:58,620 --> 00:03:00,150 then make it active. 65 00:03:00,150 --> 00:03:04,040 So here, in the middle, we see a button for Upload New APK to Production. 66 00:03:04,040 --> 00:03:05,690 And we can Browse Files or 67 00:03:05,690 --> 00:03:08,520 we can once again drag it directly from Android Studio. 68 00:03:08,520 --> 00:03:15,280 So I'm going to grab app-release.apk and pull it into this section here. 69 00:03:15,280 --> 00:03:16,640 Okay, so it uploaded successfully. 70 00:03:16,640 --> 00:03:19,140 It has the new version code that we set and a new version name. 71 00:03:19,140 --> 00:03:20,640 We'll scroll down a little bit. 72 00:03:20,640 --> 00:03:22,930 It says, what's new in this version? 73 00:03:22,930 --> 00:03:26,900 And we simply, added a new fun fact. 74 00:03:26,900 --> 00:03:30,170 It says the current production APK will be archived. 75 00:03:30,170 --> 00:03:32,870 So, all we need to do is set Publish now to Production. 76 00:03:34,210 --> 00:03:37,420 And, once again, we get the message that it may take several hours until it's 77 00:03:37,420 --> 00:03:38,980 available through Google Play. 78 00:03:38,980 --> 00:03:41,750 But that's it, the new version will now be available when we come back to this 79 00:03:41,750 --> 00:03:42,752 URL and refresh. 80 00:03:42,752 --> 00:03:46,520 Again, it'll take just a little while but we'll come back and check the current 81 00:03:46,520 --> 00:03:50,780 version and it should be 1.1 with the release notes that we just added. 82 00:03:50,780 --> 00:03:56,480 So back here in the Developer console, we can now view Statistics about our app, and 83 00:03:56,480 --> 00:03:59,580 this shows different things like, Current installs by device. 84 00:03:59,580 --> 00:04:02,840 So this is very interesting to see who is using your app and 85 00:04:02,840 --> 00:04:05,572 what version bandwidth they are running it on. 86 00:04:05,572 --> 00:04:08,290 It also gives you some additional facts about versions of Android, 87 00:04:08,290 --> 00:04:09,770 which is very helpful. 88 00:04:09,770 --> 00:04:11,840 So take a look at the Developer console and 89 00:04:11,840 --> 00:04:14,640 let us know in the Treehouse Forum if you have any questions. 90 00:04:14,640 --> 00:04:15,340 But you did it. 91 00:04:15,340 --> 00:04:16,310 Congratulations. 92 00:04:16,310 --> 00:04:18,210 You are now an official Android developer.