Bummer! This is just a preview. You need to be signed in with a Basic account to view the entire video.
Updating an Existing App4:22 with Ben Jakuben
After verifying our app on Google Play, it's already time for an update! We'll see how to make two key changes to our version code and name to allow us to update a new APK version.
- What Employers Are Looking for in a Junior Android Dev - Some advice on getting a job as a junior Android developer
So here we are back at the Developer Console after a little while. 0:00 Our app is now available and 0:03 we have a link here at the top that says, View in the Google Play store. 0:05 So let's click it. 0:08 Check it out. 0:09 Our app is live on Google Play. 0:10 Now, it's time to spread the word and get it on users' phones. 0:12 Let's go back to the Developer Console for a moment. 0:14 If we decide to take our app down for 0:17 some reason, maybe we realized we made a mistake or we forgot to fix a bug. 0:19 Then we can just unpublish it by clicking on the unpublish button over here. 0:22 Actually it says Published, and then underneath it says Unpublish this app. 0:26 Or we can build a whole new APK, increment the version, and 0:30 then publish that new one. 0:33 Actually, let's do that real quick so you can see what I mean. 0:34 Let's make a small change to our app. 0:37 Let's add a new fact, so let's go to our Factbook. 0:39 And here in our facts array, go to the end, add a comma. 0:42 And then I have this new interesting fact about humanoid robots or androids. 0:48 Okay. So, I'll save this change and 0:55 the project is ready, but there are two important things that we 0:56 need to change in our bill.gradle file for the versioning. 0:59 So, let's go back there. 1:03 Over here in the App module we find build.gradle. 1:05 So the fields we are interested in are over here inside android and 1:09 then default config. 1:12 We wanna look at the version code and version name. 1:13 The version code is an integer value and we need to 1:16 increment it each time we upload a new version of the APK to Google Play. 1:19 We can just add 1 to it each time, so let's change this to 2. 1:24 And now the version name is the version that appears on our listing. 1:27 Let's go back to our listing to see, so we're currently at version 1.0, 1:32 which if we scroll down we see, down here, listed as the current version. 1:36 Now, it's up to you to change the version however you want. 1:40 Typically, for a small change like this, it would be a point release. 1:43 So we would make it either 1.1 or even 1.0.1. 1:47 We generally reserve the higher number changes for 1:50 bigger changes, like a complete redesign or a whole new feature. 1:53 But it's kind of up to you. 1:56 I'll just change this one to 1.1 and 1:58 then we want to save our changes and sync the gradle files. 1:59 We already have a warning up here, 2:03 but we can click on the Gradle Sync button right here, and it executed and finished. 2:04 Okay, cool. So 2:09 now we're ready to build a new release-ready APK. 2:09 We can use the same keystore as before so it goes real quickly. 2:12 Go to Build > Generate Signed APK again, and you may or 2:15 may not get a prompt here for the Master Password. 2:19 In Android Studio, there is a Master Password for the tool that allows you to 2:22 use things that are password protected, like a keystore. 2:27 So, I'm gonna type mine in. 2:29 [SOUND] And click OK. 2:30 Okay, once again we're building for the App Module. 2:35 Click Next. 2:37 Keep everything the same from before. 2:38 Click Next. 2:39 And build it to the same place and finish. 2:40 Okay, it's executing down here. 2:43 And we'll watch. 2:45 And, all right, we generated it successfully. 2:45 Let's close here and go back to the Developer console. 2:48 Thankfully we don't need to go through the whole publishing process for updates. 2:51 We just need to upload the new APK, add some notes about the update and 2:55 then make it active. 2:58 So here, in the middle, we see a button for Upload New APK to Production. 3:00 And we can Browse Files or 3:04 we can once again drag it directly from Android Studio. 3:05 So I'm going to grab app-release.apk and pull it into this section here. 3:08 Okay, so it uploaded successfully. 3:15 It has the new version code that we set and a new version name. 3:16 We'll scroll down a little bit. 3:19 It says, what's new in this version? 3:20 And we simply, added a new fun fact. 3:22 It says the current production APK will be archived. 3:26 So, all we need to do is set Publish now to Production. 3:30 And, once again, we get the message that it may take several hours until it's 3:34 available through Google Play. 3:37 But that's it, the new version will now be available when we come back to this 3:38 URL and refresh. 3:41 Again, it'll take just a little while but we'll come back and check the current 3:42 version and it should be 1.1 with the release notes that we just added. 3:46 So back here in the Developer console, we can now view Statistics about our app, and 3:50 this shows different things like, Current installs by device. 3:56 So this is very interesting to see who is using your app and 3:59 what version bandwidth they are running it on. 4:02 It also gives you some additional facts about versions of Android, 4:05 which is very helpful. 4:08 So take a look at the Developer console and 4:09 let us know in the Treehouse Forum if you have any questions. 4:11 But you did it. 4:14 Congratulations. 4:15 You are now an official Android developer. 4:16
You need to sign up for Treehouse in order to download course files.Sign up