No code in this tutorial... and this is actually the last in the series. But never fear! I'll be writing more tutorials, I've simply written these 5 to get you familiarised with android. Hopefully, you're feeling quite confident on some of the aspects now, and you could well be on your way to developing the next killer app!
With that said, I'm going to explain how you can publish your app. It's a simple process, but you also have to sign your apk before you can publish it to the market.
First off, we need to create a keystore. To do this, you'll need the JDK installed. Open up a command prompt, and change to whereever you want to save the keystore. Then, type the following:
keytool -genkey -v -keystore mykeystore.keystore -alias my_alias -keyalg RSA -validity 10000
- Replace mykeystore.keystore with whatever_you_want_to_call_it.keystore
- Replace my_alias with whatever alias you want to use (example, android)
Also, if you get this error:
'keytool' is not recognised as an internal or external command, operable program or batch file.
You may want to set the PATH variable. You can do it in the computer properties, but since this isn't exactly a windows tutorial, I won't go into that much detail. Instead, let's do this:
then try the first command again.
NOTE: Replace the path with the path of wherever you installed Java. (Typically you'll find it in C:\Program Files\Java\jdk%.%.%_%%\bin)
ANOTHER NOTE: This is of course a windows path. Depending on your operating system, this may vary.
After executing the keytool command, it will ask you for various details. Simply enter the values, and it will create your keystore. Make sure you take note of your alias and password, it will ask you for it every time you come to sign an app!
For reference, the questions it will ask are:
- Enter keystore password:
- Re-enter new password:
- What is your first and last name?
- What is the name of your organisational unit?
- What is the name of your organisation?
- What is the name of your City or Locality?
- What is the name of your State or Province?
- What is the two-letter country code for this unit?
You now have your keystore. When you want to sign an apk, you will need to use the following command:
jarsigner -verbose -keystore "/path/to/mykeystore.keystore" "/path/to/myapk.apk" my_alias
Enter your password, and you will see some output similar to this:
Your apk file is now signed! (Note that you need to sign it every time before uploading, since building will reset it)
Publishing your app
The next step is of course publishing your newly signed apk file to the android market. Simply navigate your web browser to http://market.android.com/publish/Home and follow the steps to register as a developer. If you want to register to sell your apps, you will also need to go through an additional process to become a "registered seller".
Once you've registered and logged in, you'll reach the page which displays all your registered apps. Of course, if you're following this tutorial, you probably don't yet have any, so you won't have a list of apps to see.
When you're ready, click on "Upload Application". You will then be presented with a form where you can upload the apk and a maximum of two screenshots, a promotional graphic, and fill in various details such as the title, description and price.
As soon as you click publish, your application will be on the market -- there's no approval system like the iPhone's app store, so as soon as you search in the market, you should see your app.
You are now officially a dev. Make me proud. :')