I came across this question on Stack Overflow: How to avoid reverse engineering of an APK file?
But, if what they say there is true, and you can't completely protect the code, I am then still remained with a question:
What do you do when you have an algorithm you want to keep secret? I really find it hard to believe big apps such as Facebook, Gmail, etc. only obfuscate their code. Don't they somehow connect the Android Java code to a remote server where it runs all the background stuff?
For example: can you make a button in Android connect to a remote server which will do some PHP scripts on the server, and then return data to the app, just as you would do in web development? Or there is another way?
(*Currently trying to learn Android development, so maybe it has answer in further videos I am watching, but I am really curious now)