Join Lee Brimelow for an in-depth discussion in this video Signing and exporting your application, part of Developing Applications for Amazon Kindle Devices.
Okay. So, let's say you've gone through your project, everything is working perfectly, you've made sure you have all the correct resources, adhered to the best practices, and you're ready to now export your APK so you can publish it to the Amazon App Store. Well, you first need to know that the signing process for this APK is not traditional, because you have two options. First, you can export an unsigned APK, upload that to the Developer Portal and then essentially, what Amazon does is wrap it with some of their own technology so that it will work on the Amazon App Store.
And then, it will sign the APK using a certificate that's unique to your user account on Amazon. And that's definitely the easiest way to go, just let them handle the signing. Now, if for some reason you have to sign the APK with your own certificate, you can export a signed APK upload that to the developer portal then Amazon will again wrap it with their own technologies so that it's compatible with the App Store.
And then, they will send you that APK back so you can again sign it with your own key and then you can finally upload that finished APK. So, again, it's a little bit more complicated if you want to export a signed APK. But one thing that's important is you should actually export a signed APK and just hesitate to make sure that it behaves the same because all throughout this course, we've been exporting debug builts. So, I am going to right-click on my project and I am going to go to Android Tools > Export Signed Application Package and I am going to leave the name at SpinIt.
Now, this is the location of my personal certificate. Let me put in my password. You can also create one here if you don't have one. And let me put in my password for the key. And now, it's asking me where do I want to save this APK, I want to save it to my Desktop, and now it's basically exported that to my Desktop. Okay. So now, what I want to do is to install this APK onto my emulator, so I'm going to go to the terminal and say, adb install SpinIt.apk.
And we'll let it install. And I'm running the HD7 inch emulator. Okay. So, it's up there now. It's actually launch up the emulator and let me launch the app. Okay, so it's running here, let me click on Play Game. And we can try out one of the in-app purchases, so I'll go to Change the Wheel. And let's buy the camo wheel style.
So, when I click that, we can see it launches the in-app purchase UI. I'm going to purchase that and close this. And now you can see this, that has worked. So locally, anyway, the in-app purchase is working fine with this release build of our application. But, if I now go back to my Main Game, and if I actually go back to the Main Menu screen, I'm going to click on View High Scores. And you can see, it's crashed.
So, you'll remember, during the Game Circle chapter, that we actually had to create our unique hash key and put it into the portal in order to get Game Circle to work. and we base that on the Debug Key store and now we've signed it with our release certificate so Game Circle is not going to work. So, just be aware of that if you're exporting a Release Build and trying to use Game Circle. Okay. So, I'm going to minimize the emulator when we go back into our clips. Now, in our case, we're going to go the route of exporting an unsigned APK, uploading that to the portal and then, we'll let Amazon deal with signing it and all of that.
It's definitely the easiest way to go. So, I'm just going to right-click again, go to Android Tools, and this time, Export Unsigned Application Package. And, of course, it's just simply now asking me for, the location because it's not going to be signed. So, I'm going to save it to the Desktop, and it's telling me an unsigned application was saved. Click OK. And now, we have our APK that were actually going to upload to the Developer Portal which we'll be doing in the next movie.
The course also covers multiscreen development and testing with the Kindle Emulator, as well as actual deployment to the Kindle store.