Android: Is it possible to add folders to APK through commands - android

I am having a android source and i am building that source and generate apk manually. Manually in the sense using ant release jarsigner and zipalign. I got the singed APK working. Now i am trying to add folders to the apk before signing it or It is possible to add it while the ant build process .Is this possible if so share me the commands.I saw aapt command is used to add files but not folders..
Thanks in Advance
Regards,
Deepak

Related

Android Studio: How to separate Run APK & Build APK

When I run an APK from Android studio it generates a partial apk in the build folder. When I click on Build APK, it generates the full apk in the same folder. They overwrite each other. I need to separate the output so that if I just hit on Run, the apk will have its own "run" folder, and when I build the apk, it would not be overwritten by Run APK. If this is possible, can someone guide me through the setup? Probably a config in gradle, or in Studio itself? Thank you very much!
When you run the app from android studio and create a build apk its the same thing so it overwrites the apk. It builds the app-debug.apk file. I think you are trying to create a app-release apk. You need to create an apk using generate signed apk for this. It will seperate the debug and release apk in two folders as debug and release.

android how can I export signed apk file programitically

I want to create an application creator. It means that I want user to create its own application using my application and export signed apk file on its device.
Is this possible in android?
If it is possible then please help me so that I can implement it.
Thank You.
This is possible but it requires Rooted Device.
Now you need to create script (android commands) for
compiling
packaging
creating key-store
signing to key-store into release mode
We are allowed to do above all things using command. Try to follow it one by one and you can generate .apk file.

Android Signing application on Windows

I am trying to Sign up APK to upload it on to the Play Store Market. I am following the steps underlined here
I am getting the following error
When i try to Sign the Application using Eclipse project->Android Tools->Export Signed Application Package.
You don't need to do it with commands. In Eclipse, right click on your project->Android Tools->Export Signed Application Package.
Follow the wizard and you will have an signed apk without pain.
Edit:
After a quick search about the new error, this thread seems to contain possible fix for you. At instance, please try to clean your project and build it again. If it does not fix your problem, also try the fix mentioned in the link.
Copy your keystore file to a directory which has no spaces. Your current path is C:\Program Files (x86)\Java\jdk1.6.0_27\bin\my-release-key.keystore which contains the directory Program Files (x86) with spaces. JarSigner cannot identify directories with spaces.

Batch exporting of Android APKs

Let's say I have a whole lot of Android projects, how would I go about, export and digitally sign them all at once, is it even possible to do through eclipse?
Any thoughts of the matter will be greatly appreciated.
In Eclipse it's not possible to export multiple projects without human intervention.
You can script it by creating ANT build.xml files for all of your projects. The ANT build files allow you to specify the keystore path and key alias that you want to use to sign your APK.
You can create a simple script that goes through all of your projects, and calls the ant release target. This will generate a signed APK file.
That way, you can export all of your apps with a single script.
More information can be found on :
http://developer.android.com/guide/developing/building/building-cmdline.html

How to zipalign the .apk file using eclipse?

Can anyone tell me how to zipalign my .apk file with using eclipse. I have made my .apk file by giving command like,
Right Click on Project Folder
Click on "Android Tools" option from menu.
Click on "Export Signed Application Package..." and my .apk generated in given application alias.
Now want to do zipalign for this above generated .apk file. Does any tool require to do so OR anything that can solve my problem.
If you did what you described above then Eclipse has already zipaligned your apk for you. You can't zipalign an already zipaligned package
I think this will help you
D:\android-sdk\android-sdk\tools>zipalign -f -v 4 "C:\Users\name\Desktop\project_name\projectname_signed.apk" "C:\Users\name\Desktop\project_name\projectname__zipaligned.apk"
Using the steps given, Eclipse will do zipalign for you.
This is a very tricky part and initially i was also ran in to strange problems . Before uploading to android market you must do the following steps.
Create a Certificate
Signing your application apk
Finally Zip align the signed apk
Check this site: How to sign Android project apk
Eclipse zipalign APKs when you export them by default.
zipalign is basically a tool available in tools directory of your android sdk.
In case you are not using eclipse to build, you can use this tool directly to zipalign your apk.
zipalign [-f] [-v] <alignment> infile.apk outfile.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.
For more detail, check this link
http://developer.android.com/tools/help/zipalign.html
If you to signed and zip aligned your APK file, so that you could redistribute your file and upload it play store. Then follow these simple steps
Open Eclipse
File--> Export
Browse-->Select your project
Next-->Next
So, after all of that you will get an APK which will be signed and zip aligned.
Eclipse zipalign apk automatically. When you export the project, eclipse must be generating signed apk to a different destination. Check properly where it prompts when you generate a signed apk
Eclipse automatically zipaligns your .apk file if you did what you described above.

Categories

Resources