Android Gradle: What is javaMaxHeapSize “4g”?

As it mentioned in the answer above, it is just an option to specify the maximum memory allocation pool for a Java Virtual Machine (JVM) for dex operation. And it’s the same, as to provide to java the -xmx argument. Due to it’s source codes from here, it’s setter look like: if (theJavaMaxHeapSize.matches(“\\d+[kKmMgGtT]?”)) { javaMaxHeapSize … Read more

How to decompile DEX into Java source code?

It’s easy Get these tools: dex2jar to translate dex files to jar files jd-gui to view the java files in the jar The source code is quite readable as dex2jar makes some optimizations. Procedure: And here’s the procedure on how to decompile: Step 1: Convert classes.dex in test_apk-debug.apk to test_apk-debug_dex2jar.jar d2j-dex2jar.sh -f -o output_jar.jar apk_to_decompile.apk … Read more

Android support multidex library implementation

The Blog was the old solution. With Android Studio 0.9.2 & Gradle Plugin 0.14.1, you only need to: Add to AndroidManifest.xml: . android:name=”android.support.multidex.MultiDexApplication” or Add MultiDex.install(this); in your custom Application’s attachBaseContext method or your custom Application extend MultiDexApplication add multiDexEnabled = true in your build.gradle . android { defaultConfig { … multiDexEnabled = true } … Read more

How to execute the dex file in android with command?

Let’s say you have a the following code in file HelloWorld.java: public class HelloWorld { public static void main(String[] args) { System.out.println(“Hello World!”); } } To run it on an android device: javac HelloWorld.java dx –dex –output=classes.dex HelloWorld.class zip HelloWorld.zip classes.dex adb push HelloWorld.zip /sdcard/ For GB or earlier, you should be able to simply … Read more

What are .dex files in Android?

About the .dex File : One of the most remarkable features of the Dalvik Virtual Machine (the workhorse under the Android system) is that it does not use Java bytecode. Instead, a homegrown format called DEX was introduced and not even the bytecode instructions are the same as Java bytecode instructions. Compiled Android application code … Read more