Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Optimize the project code

I have been working on one project which is too complex and contain very much space with so many images and Java files as well.

Somewhere I have read about the proguard which optimizes the code.

I have used it, but it's still does not have an effect on my final APK file.

It might be I have made a mistake somewhere. I have the following this like http://developer.android.com/guide/developing/tools/proguard.html.

How can I optimize my code?

like image 752
dharam Avatar asked Dec 15 '25 16:12

dharam


1 Answers

You can add it to the default.properties. I've been adding manually without having a problem so far.

If you add the line:

proguard.config=proguard.cfg

As said it will only use ProGuard when exporting signed application (Android Tools => Export Signed Application)

If you start the project with the SDK before Android 2.3 the proguard.cfg file will not be created (next to default.properties as in 2.3>).

To enable automatic creation of it, just simply update to the SDK of Android 2.3 and create a new project with existing sources (which are the sources of the project you currently have).

Automagically the proguard.cfg fill will be created.

Without optimizations the compiler produces very dumb code - each command is compiled in a very straightforward manner, so that it does the intended thing. The Debug builds have optimizations disabled by default, because without the optimizations the produced executable matches the source code in a straightforward manner.

like image 166
Yog Guru Avatar answered Dec 17 '25 04:12

Yog Guru



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!