Question: Refer to the second point here(Encrypt Class Files) How to make apk Secure. Protecting from Decompile how can i encrypt and decrypt class file in Android?

Answer: 
You can obfuscate code with [proguard](https://developer.android.com/studio/build/shrink-code.html) (free) and [dexgaurd](https://www.guardsquare.com/en/dexguard) (enterprise)

in your app gradle:

```
buildTypes {
    release {
        minifyEnabled true
        shrinkResources true

        proguardFile 'proguard-google-play-services.pro'
        proguardFile 'proguard-butter-knife.pro'
        proguardFile 'proguard-volley.pro'

    }
    debug {
        minifyEnabled false
    }
}

```

with this code in release mode your code obfuscate.

some files must not obfuscate so you can create some files in root of app folders and on that you can set which file must not obfuscate

volley files for example:

```
-keep class com.android.volley.** {*;}
-keep class com.android.volley.toolbox.** {*;}
-keep class com.android.volley.Response$* { *; }
-keep class com.android.volley.Request$* { *; }
-keep class com.android.volley.RequestQueue$* { *; }
-keep class com.android.volley.toolbox.HurlStack$* { *; }
-keep class com.android.volley.toolbox.ImageLoader$* { *; }

```

usually in libraries readme they write what you have to write for prevent obfuscating for some classes.
also consider you can only make it harder but not impossible.
Code Signing is one option to make your apk file secure. It ensures the authenticity and integrity of your source code. You may go through the below link for more details

[Sign your app](https://developer.android.com/studio/publish/app-signing.html)

Now coming to your question on protecting the apk file from de-compiling, it is not possible completely but you can still use some preventive measures to make it tough. Please go through below link

[How to avoid reverse engineering of an APK file?](https://stackoverflow.com/questions/13854425/how-to-avoid-reverse-engineering-of-an-apk-file)