Search code examples
javaandroidapache.htaccessaccess-token

Is there a simple way to allow access to my website only through my Android application?


Is there like any method to only allow direct access to my website only from the Android application.

Any other requests coming from any where else being blocked or redirected to a restricted access page or similar.

Please do provide any ideas or simple solutions and any step by step procedure to do so would be greatly appreciated.


Solution

  • a little idea here:

    Make all your request to index HTML and then redirect according to user agent

    On index validate the request headers seeking for user agent and if it's not android then redirect to another site.

    Info about user-agent at mozilla site: here

    Edit: As MrWhite says, make sure that Android app sends a unique user-agent.