Tuesday, May 31, 2011

Google App Inventor Publisher

There are plenty of people out there that want to tap into the smartphone market.   Google hasn't only been hard at work making a great smartphone OS but it has also been making it easy for amateur app developers to make apps for their phones without any knowledge of java. Currently, most people believe that app inventor apps can not be published to the market but this is not true.

The creation of the app is accomplished by a Google lab project known as "app inventor", which can be found here. All you have to do is follow the setup instructions on their website any you are ready to start making apps.  It is so easy to use that today I will make my first app with this software.  To start click on the new button in the my projects section then enter a project name. I would recommend playing around with this software for a couple of days before you start making your project or else you will get in over your head.

Once you have finished your app you can download it to your phone through app inventor yourself or you can download it to your computer.  Since I want to publish this app I will download it to my computer.  Once downloaded you will have a ".apk" file.  To procede you will also need the following(windows users only):

The entire process will consist of making a keystore to sign your app(required for market publishing), decompiling your .apk, editing the manifest file, recompiling your apk, signing your apk and zipaligning your apk.  The commands used are written in the command prompt, cmd.

1.)---- CD to the JDK/bin path. For me the command looked like this "cd\program files\java\jdk1.6\bin". (it might be sun instead of java, for some)

----The you run the following command to make the keystore. "keytool.exe -genkey -v -keystore my-release-key.keystore -alias aliasname -keyalg RSA -keysize 2048 -validity 10000". This will make a keystore called my-release-key.keystore in the JDK/bin path. Please write down and remember the password and aliasname of the keystore for future updates.  This is because google requires you to use the same keystore for each update put out by the same app.

2.) In this step you will first move your apk from where you downloaded it to the apktool folder. Next, in the cmd, CD to the apktool folder then run the following command "APKTOOL d -s YOURAPK.apk". You should now have a folder in your apktool folder named whatever your apk was called(YOURAPK).

3.) Next you will go to the folder called "YOURAPK" and edit the manifest file.  You will want to add the following bold items to the file:

<manifest package="appinventor.InventorName.AppName"
android:versionCode = "1"
android:versionName = "1.0"

You will also have to REMOVE the debuggable item from the application tag.

<application android:label="AppName" android:icon="@drawable/ya" android:debuggable="true">

4.) Now you have to recompile your apk file. You will have to CD to the parent folder that contains the decompiled apk folder(it should be the apktool folder path). Then use the following cmd command "APKTOOL b YOURDECOMPILEDAPPDIRECTORY YOURAPPOUTPUT.APK". 

FYI-YOURAPPOUTPUT.APK needs to be different than the original YOURAPP.APK.

5.)Now you have to sign the new apk file. To do this move YOURAPPOUTPUT.APK to the JDK/bin path also make sure that your keystore is still in this folder and if it is not please move it to here.  Next, use the following cmd command "jarsigner.exe -verbose -keystore  my-release-key.keystore YOURAPPOUTPUT.apk aliasname"

FYI-If you want to verify the the sign was ok run the following command "jarsigner.exe -verify -verbose -certs apkname.apk"

6.)The last step is to ZipAlign the apk. To do this move the signed YOURAPPOUTPUT.apk to the  AndroidSDK\tools directory(c:\android\tools). Next, CD to that same directory. Then run the zip align command "zipalign -v 4 input.apk output.apk"(zipalign -v 4 YOURAPPOUTPUT.apk YOURAPPOUTPUTALIGNED.apk)

You can now upload this final apk, YOURAPPOUTPUTALIGNED.apk, to the android market with a publishers account.

You can check out the app that I made in app inventor at https://market.android.com/details?id=appinventor.ai_ippolitejoe.commander

1 comment:

  1. de iPhonedokter voor al uw herstellingen aan Apple, iPod, iPhone, iPad, Blackberry, Htc en Samsung. Vakkundig reparatie, originele onderdelen, goede prijzen en op verschillende locaties!

    De iPhonedokter