Sunday, February 10, 2013

Publish free app on Google Play

The Community License allows you to publish free apps on Google Play and other public markets. This post explains how you do this.

First of all, it is assumed that you already own a Community License and dot42 has been installed.

Use the right certificate

Let's start at the very beginning. After you have installed Visual Studio, you should have a dot42 project template as shown below:


After clicking OK, you must select or create a certificate:


The browse button (green) lets you browse for an existing certificate. If you use an existing certificate, then make sure that is has a lifetime of 30 years or longer. To generate a new certificate, click the create button (red). This will start the certification wizard. After filling out your personal details and selecting a password, the following panel is shown:


Make sure to select the option "Certificate will be used for publishing in public markets.".

If you now compile your application for the first time, it will show the following error:


This error is shown if you use a Community license and you did not request a free apps key yet. Next section describes how to do this.

Request Free Apps Key

If you login to your dot42 account and go to My Licenses you will see there is a line at the bottom: "To publish your app in a public market (such as Google Play) with the Community License, you must request a Free Apps Key."



Click the link as highlighted in the above image. This will take you to the following page:



This page asks you to provide two things: 1. the APK package name of your application and 2. the MD5 fingerprint of your certificate.

APK Package Name

The APK package name can be found on the Android tab of the properties of your dot42 Visual Studio project:


MD5 Fingerprint

When you compile your dot42 project in Visual Studio, the following is shown in the output pane:


Copy-paste the MD5 to the Request Free Apps Key page like this:



After you filled out the package name and the MD5 fingerprint of your certificate, you hit the "Request!" button. The next page shows you a code snippet like this one:

[assembly: Dot42.FreeAppsKey("hCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995" +
    "777333nvvvfe6O51OJ/ff/z9cZmQBbPbOStrJniGAqsgfP358Hz8" +
    "iHj8vpvmyyY/ML8dtWxeTdZs3R49P362KOmuLavn75Fl9tPv4buc" +
    "Tr8UX1bKdh03kI6/N0+w6bIEPHr/O6yIrjyY7+d69+w93p5Pzh7P" +
    "ze/cf39UvHr/hH8+ysskf35U/Hr+sq9l62p5Us/xoVrW759nbx3f" +
    "9Dx8fT9vikns52t15SOC8Dx6/Wi/bYuENNp3dW+0+aq9X+Wcf9b7" +
    "c+Sh9tyiXzS...............................6fPfrr5vRa" +
    "T6ezVVX1QP3nwez19uPzi4U/8dP6Tl9+9+/pp+9Xb3eNPdmZl+3u" +
    "1T64n85PZ/fV33n7y4Mnd5otnLyaT5fHrel3ufvLTrz69t6yevVx" +
    "/9/yn6oc/9fqTuxcv9u5+++m3380/md77srj89BcdPDuvf9Ey+6p" +
    "5vt9++vpNnR0/e7p6/RNv3xQ/9a787ieL1U+e/OTz7G72xbMv9k6" +
    "/evuDn3qx/PZPvjp+9xPVqn1ydfEZzYjF2w7r6P8B")]

Add this code snippet to your application and you are done!



2 comments:

  1. Where exactly in my application do I add this?

    [assembly: Dot42.FreeAppsKey("7b0HYBxJliUmL23Ke39K9UrX4HS" +
    "hCIBgEyTYkEAQ7MGIzeaS7B1pRyMpqyqBymVWZV1mFkDM7Z28995" +
    "777333nvvvfe6O51OJ/ff/z9cZmQBbPbOStrJniGAqsgfP358Hz8" +
    "iHj8vpvmyyY/ML8dtWxeTdZs3R49P362KOmuLavn75Fl9tPv4buc" +
    "Tr8UX1bKdh03kI6/N0+w6bIEPHr/O6yIrj7KDWfYgu/fpvf185+G" +
    "nO3uP7+oXj9/wj2dZ2eSP78ofj1/W1Ww9bU+qWX40q9rd8+zt47v" +
    "+h4+Pp21xyb0cHdx/sP/4rvfB41frZVssvMGms3ur3Uft9Sr/7KP" +
    "elzsfpe8W5bJ5hEaffTRv29Wju3evrq7GV/fGVX1xd29nZ/fu7/3" +
    "F89fTeb7Itotl02bLaf5Revfo8d0IYV8XF8usXdf50Zuz3+f3yXb" +
    "fvX27PvnJveIHzfN1cfITd6uz2XlT/V4PX/z0wXxv78vJw/yTg7f" +
    "f/c69F1/sv72/+4uy6vc527m+V69enuxcN7tf3P9k/8nnL+Yvq5P" +
    "yp5/Mr3/Rye/96uV3s8+vv/r0p052vjz/Tr13kn95/0W+nEx/nza" +
    "/V794/eJq9cXpTvtJ+/YnLn6f+/vf/skv7z8tp9O3P/jiJy+z9fX" +
    "L0xflT/zE3ev7u7uvzr/8wauLp9/Z3fmMZsTibYd19P8A")]

    ReplyDelete
    Replies
    1. save in file and use with wizard as described above
      "Use the right certificate"

      Delete