I know this is possible to decompile and recompile an apk. And I saw this post : Injecting code into APK before, But what I want is not decompiling or reverse engineerin
For something simple like this, all you need is baksmali/smali. Just insert a single call into the assembly into your custom class, and you can write the rest in Java.
Decompiling/recompiling rarely works and is overkill for this situation anyway. Using smali will work even for obfuscated applications, though some applications calculate integrity checks on themselves and will refuse to run if modified.