Why do we need JDK when we are already using Android SDK? After all, we are not developing for JVM.
The Android build process depends on a number of tools from the JDK. Check out the build system overview documentation.
The first big piece we need from JDK is javac
- all your source code written in Java needs to be compiled before it can be converted to the DEX foramt.
Once your code has been compiled, dexed, and packaged into an APK, we need jarsigner
to sign the APK.
Is there any difference between using JDK 1.6, 1.7 and 1.8?
That depends on what features you are using from each. Older projects that don't use Java 7 features can use Java 6 without issue. I personally recommend Java 7 for most modern projects. If you can use it, why not?
There are some efforts out there to bring Java 8 features to Android, most notably gradle-retrolambda. Some of these require JDK 8 to compile properly.