nkcmr
nkcmr

Reputation: 11000

positively identifying http requests from java HttpClient

I am building an Android app that communicates with a remote server to get data. How can I use PHP to positively identify a request coming from an HttpClient Android app?

One might think to use $_SERVER['HTTP_USER_AGENT'], but that can be easily spoofed.

Any suggestions?

Upvotes: 1

Views: 103

Answers (1)

Eric Levine
Eric Levine

Reputation: 13564

The Android Developers Blog has an in depth posting on identifying applications: http://android-developers.blogspot.com/2011/03/identifying-app-installations.html

The basic idea is to have the Android app generate a unique identifier when it is installed. You can pass that to the server when making requests. In your case, it might not need to be unique on a per installation basis though.

Upvotes: 1

Related Questions