Taken directly from:
The process of exporting from .pde to .apk may look like a herculean task especially for beginners such as me. I spent a good amount of time researching this stuff and finally nailed it down. So here goes,
If you have the app you built in processing running on your phone the you probably have all the environment variables set in the PATH. Oh I am using windows 7 and processing 0190 build. To begin with make sure you have keytool, jarsigner, ant etc. commands working from your command prompt. If not then install them, just google for those packages.
You will require OpenSSL as well required to generate your secret key for the application. Installing this is slightly tricky but the easiest way is to install Cygwin and during the installation you can choose to install OpenSSL. After this you will mostly be set to create your .apk.
Step 1: Hit the Export button on Processing’s IDE
Step 2: Goto the /android folder and you will see bin, lib, res etc. (i could not find an apk file kind of freaked out the first time but not to worry all the files needed for creating the .apk are in here)
Step 3: Open command prompt and get to your /android folder
Step 4: Type the following command to generate your secret key that will be required for signing your application:
C:\Desktop\<sketchname>\android> keytool -genkey -v -keystore <sktechname>-release-key.keystore -alias <your name or anything> -keyalg RSA -keysize 2048 -validity 10000
It will then ask you the following questions:
Enter keystore password:
Re-enter new password:
What is your first and last name?
What is the name of your organizational unit?
What is the name of your organization?
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?
Is CN=name , OU=name, O=name, L=blah, ST=PA, C=US correct?
Generating 2,048 bit RSA key pair and self-signed certificate (SHA1withRSA) with a validity of 10,000 days
for: CN=name, OU=name, O=name, L=blah, ST=PA, C=US
Enter key password for <your alias>
(RETURN if same as keystore password):
Re-enter new password:
This creates a <appname>-release-key.keystore file in your /android folder.
Step 5: Now we create the .apk file which is unsigned. So type in the following:
Total time: 12 seconds
You should get this in your console if the build is successful.
Step 6: You can now see in your bin folder the .apk file named as <appname>-unsigned.apk (Yay!)
Step 7: Now you will need to sign this with your secret key in order to release it on the android market. So here goes, (you can choose to copy the keystore file into your bin folder and execute the following command (too lazy to type too many characters) or keep it where it is.
C:\Desktop\<sketchname>\android>jarsigner -verbose -keystore <appname>-release-key.keystore c:\Desktop\<sketchname>\android\<appname>-unsigned.apk <your alias>
Then you will get a bunch of statements such as
Enter Passphrase for keystore:
Step 7: We are almost done! So we need to verify the previous step i.e. we need to make sure that jarsigner has signed the app correctly.
So execute the following:
C:\Desktop\<sketchname>\android>jarsigner -verify c:\Desktop\<sketchname>\android\<appname>-unsigned.apk
You should get JAR VERIFIED else something maybe wrong.
Step 8: Now to create your signed and distributable .apk file
C:\Desktop\<appname>\android>zipalign -v 4 c:\Desktop\<appname>\android\<appname>-unsigned.apk <new appname>.apk
Verifying alignment of <appname>.apk (4)…
50 META-INF/MANIFEST.MF (OK – compressed)
973 META-INF/ALIAS.SF (OK – compressed)
1958 META-INF/ALIAS.RSA (OK – compressed)
3094 assets/ComicSansMS-25.vlw (OK – compressed)
23456 assets/CurlzMT-150.vlw (OK – compressed)
205025 assets/SegoePrint-60.vlw (OK – compressed)
7002884 res/drawable/icon.png (OK)
7005452 res/layout/main.xml (OK – compressed)
7005745 AndroidManifest.xml (OK – compressed)
7006548 resources.arsc (OK)
7007504 res/drawable-hdpi/icon.png (OK)
7011152 classes.dex (OK – compressed)
Hurray we are all set. Now you can happily distribute you android app built using processing to your friends! You may not able to run it on Samsung Captivate unrooted phone as it does not permit non-market app installation (ofcourse they can install it once you release it to market) Hate that X-|
I hope this helps as I have learned a lot in the last few weeks and soon I should be releasing a game in the market :) so wait for it.
Get In touch!
- Playing Fritzing and arduino. 2 push buttons and 2 LEDs with a basic arduino script.
- I dont want to use office365 thanks goldsmiths.
- How to create an Android application and submit it to the market pdf guide.
- Xtreme Simon – A multiplatform Memory/Concentration game!
- Processing Tutorial 7 – Android accelerometer and you
- Long cat the game
- Processing Tutorial 6 – Android Processing Basics and 3D texturing
- Biography and Contact Information
- OpenFrameworks Research
- Jump ‘n’ tilt
- E1 Android App
- creating a signed app using the processing export
- Installing and Compiling Ant
- Processing Tutorial 5 – Basic 3D
- Processing Tutorial 4 – lets create something useful
- Processing Tutorial 3 – Using Methods
- Worlds first Bionic arm
- Processing Tutorial 2 – Basic Shapes
- Processing Tutorial 1 – Getting to know Processing
- Sounds generative walls.
- ROK Android App
- Blob the Defender Alpha v0.0001
- Dance Projection Lights.
- Cong Box v1. Another example of sound interacting with shape generation.
- I dreamt in code… is this normal? better keeping a notepad and pen next to my bed.
- A World Of Creation