Help IM STUCK! w/ Zip Align HELP HELP HELP!

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

Help IM STUCK! w/ Zip Align HELP HELP HELP!

Postby fleishher » Tue Jan 05, 2010 6:06 pm

Can someone please for the love of god tell me how to zip align my apk file so I can finally submit this thing! Where in the world am I supposed to enter this command. Talk to me like I am 5 please.


Usage
To align infile.apk and save it as outfile.apk:

zipalign [-f] [-v] <alignment> infile.apk outfile.apk
To confirm the alignment of existing.apk:

zipalign -c -v <alignment> existing.apk
The <alignment> is an integer that defines the byte-alignment boundaries. This must always be 4 (which provides 32-bit alignment) or else it effectively does nothing.

Flags:

-f : overwrite existing outfile.zip
-v : verbose output
-c : confirm the alignment of the given file
fleishher
Freshman
Freshman
 
Posts: 2
Joined: Thu Dec 17, 2009 8:46 pm
Location: New York, NY

Top

Postby mitutitu » Thu Jan 21, 2010 11:33 am

Hi fleishher, there are two ways to solve your problem of aligning.

1. If you are using Eclipse as your development IDE then the eclipse ADT will handle it. So to do in this way you need to sign your apk through the eclipse export wizard. Like :

ADT (starting with 0.9.3) will automatically align release application packages if the export wizard is used to create them. To use the wizard, right click the project and choose "Android Tools" > "Export Signed Application Package..."


2. the second way is manually by using command prompt of your windows. Like:

In order to manually align a package, zipalign is in the tools folder of the Android 1.6 SDK. It can be used on application packages targeting any version of Android. It should be run after signing the apk file, using the following command:
zipalign -v 4 source.apk destination.apk
Verifying alignment:
The following command verifies that a package is aligned:
zipalign -c -v 4 application.apk


That's all you have to do for aligning :)

The Android encourages the developers to use the second process (manually).

thanks,
mitu
User avatar
mitutitu
Senior Developer
Senior Developer
 
Posts: 113
Joined: Tue Jun 09, 2009 7:40 am
Location: St. John's, NL, Canada

Top

Return to Novice Tutorials

Who is online

Users browsing this forum: No registered users and 8 guests