Page 1 of 1

Android, Part V: Signing and Publishing

#1 gabehabe  Icon User is offline

  • GabehabeSwamp
  • member icon




Reputation: 1385
  • View blog
  • Posts: 10,962
  • Joined: 06-February 08

Posted 10 October 2009 - 07:15 AM

Publishing your apps
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
NOTES:
- 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:
PATH="C:\Program Files\Java\jdk1.6.0_14\bin"
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:

Quote

adding: META-INF/ALIAS_NA.SF
adding: META-INF/ALIAS_NA.RSA
signing: res/drawable/icon.png
signing: res/layout/main.xml
signing: AndroidManifest.xml
signing: resources.arsc
signing: classes.dex


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. :)
NOTE: This page uses a hell of a lot of javascript. Make sure it's turned on.

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. :')

Is This A Good Question/Topic? 2
  • +

Replies To: Android, Part V: Signing and Publishing

#2 mushin  Icon User is offline

  • New D.I.C Head

Reputation: 1
  • View blog
  • Posts: 18
  • Joined: 21-August 09

Posted 18 February 2010 - 05:41 PM

Great tutorials!
Was This Post Helpful? 0
  • +
  • -

#3 batesy3k  Icon User is offline

  • D.I.C Regular

Reputation: 41
  • View blog
  • Posts: 299
  • Joined: 10-September 09

Posted 15 August 2010 - 04:59 AM

Why do you have to pay $25 dollars to publish apps on the market?

Quote

Before you can publish software on the Android Market, you must do three things:
•Create a developer profile
•Pay a registration fee ($25.00) with your credit card (using Google Checkout)
•Agree to the Android Market Developer Distribution Agreement

Was This Post Helpful? 0
  • +
  • -

#4 lexxe  Icon User is offline

  • New D.I.C Head
  • member icon

Reputation: 4
  • View blog
  • Posts: 44
  • Joined: 05-December 10

Posted 26 April 2011 - 08:40 AM

View Postbatesy3k, on 15 August 2010 - 06:59 AM, said:

Why do you have to pay $25 dollars to publish apps on the market?

Quote

Before you can publish software on the Android Market, you must do three things:
•Create a developer profile
•Pay a registration fee ($25.00) with your credit card (using Google Checkout)
•Agree to the Android Market Developer Distribution Agreement

Because when you upload an app via the market, you get a place to host your app, a way to make money off of your app with their collection services, a venue to be seen by millions of people, and a way to view any responses from consumers.
Was This Post Helpful? 0
  • +
  • -

#5 arashzz  Icon User is offline

  • New D.I.C Head

Reputation: 5
  • View blog
  • Posts: 39
  • Joined: 28-September 09

Posted 30 June 2011 - 09:58 AM

I don't know why but I still the get the error
" 'keytool' is not recognised as an internal or external command, operable program or batch file. "
although I've added the path in my computer properties, and the address is correct, I've double checked it. Any suggestions ? thnx in advance .
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1