I have Android app and 1 php application. I want to invoke android function when the button is clicked on my php application (on latop-pc browser). So basically Php to android communication. How to achieve that?

Recommended Answers

All 2 Replies

Use HttpRequest to invoke the PHP scripts. Please do not ever enter your mySQL details into an Android application for direct communication ever! Anyone can decompile the app and get the db credentials. Instead make PHP scripts that do this for you and make calls to this from the app. You can set a login and then a secret key exchange and pass messages using this shared key to get this done..! Otherwise if you develop the application and it gets adopted by many your likely to get hacked in no time!

I liked the above response as the tutorial shows how to this using JSON messages. Encryption can easily be added over this.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.