Changing application package name in custom Ant build step

This is the way I do it (working) <target name=”-package-resources” depends=”-crunch” > <!– only package resources if *not* a library project –> <echo message=”Current Package name: ${app.custompackagename}” /> <do-only-if-not-library elseText=”Library project: do not package resources…” > <aapt androidjar=”${project.target.android.jar}” apkfolder=”${out.absolute.dir}” assets=”${asset.absolute.dir}” buildType=”${build.target}” command=”package” debug=”${build.is.packaging.debug}” executable=”${aapt}” ignoreAssets=”${aapt.ignore.assets}” libraryPackagesRefid=”project.library.packages” libraryRFileRefid=”project.library.bin.r.file.path” libraryResFolderPathRefid=”project.library.res.folder.path” manifest=”${out.manifest.abs.file}” manifestpackage=”${app.custompackagename}” nocrunch=”${build.packaging.nocrunch}” previousBuildType=”${build.last.target}” resourcefilename=”${resource.package.file.name}” resourcefilter=”${aapt.resource.filter}” versioncode=”${version.code}” … Read more

You uploaded an APK that is not zip aligned error

You can run zipalign manually in command line: zipalign [-f] [-v] <alignment> infile.apk outfile.apk Note that zipalign is located inside ${sdk.dir}\tools For more details visit zipalign [Update] Also, If you need to sign it you can run: jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore YOURKEYSTORE unsigned.apk alias_name (jarsigner is located inside java JDK_HOME/bin)

Multiple Android Application Package .apk files from single source code

I’m generating 2 different APK’s (demo and production) from one single source tree with 3 small modifications: 1) I have public static final DEMO=true; //false; in my Application class and depending on that value I used to switch code between demo/production features 2) There are 2 main activities, like: package mypackage; public class MyProduction extends … Read more