2

I'm really new to Android programming, so this may seem silly to do this...but

I want to communicate to a PHP server (I assume using JSON is best). So...would I use a HTTP connection or what? IS there anyway to make this 'secure', like if I was sending site user credentials over the wire?

will
  • 1,287
  • 3
  • 23
  • 43
  • Take a look at these thread : http://stackoverflow.com/questions/2253061/secure-http-post-in-android and http://stackoverflow.com/questions/995514/https-connection-android – kv-prajapati Sep 28 '11 at 02:41

1 Answers1

4

Secure - against what?

Secure against eavesdropping in the middle - just use HTTPS instead of HTTP.

Secure against devices being stolen - introduce user authentication on the site.

Seva Alekseyev
  • 55,897
  • 22
  • 151
  • 252
  • first one. Anything special I have to do to send HTTPS? – will Sep 28 '11 at 02:43
  • 1
    The configuration is all on the server side. Just read the docs on enabling SSL for your Web service (Apache, IIS or whatever). Depending on the hosting package (if any), you may already have it. In the DIY scenario, you'll have a purchase a SSL certificate (Verisign, among others, sells them). On the Android side, all you have to do is specify https:// URL instead of http:// – Seva Alekseyev Sep 28 '11 at 02:45
  • 1
    nothing special. while creating the http request, the URL that you provide should be https://... instead of http://... – Hemant Sharma Sep 28 '11 at 02:46