Posts

Showing posts from November, 2016

Check availability of Google Play Services in android

This blog is about how we can check that Google Play service are available or not in Device. First of all, we can Create a method which will check Play services status with Status code. private void checkService ( int statusCode ) { switch ( statusCode) { case ConnectionResult . API_UNAVAILABLE : //API is not available in device break ; case ConnectionResult . NETWORK_ERROR : //Network error break ; case ConnectionResult . RESTRICTED_PROFILE : //Profile is restricted by google. break ; case ConnectionResult . SERVICE_MISSING : //Plat Service is missing break ; case ConnectionResult . SIGN_IN_REQUIRED : //service available but user is not signed in break ; case ConnectionResult . SUCCESS :

How to get custom HTTP Headers PHP

This blog is about how to read All/Custom headers in PHP. Below code is used to get all Headers. $headers = getallheaders(); There is an alternative for getting HTTP headers. apache_request_headers() These functions are getting all HTTP headers like below:- Array ( [ Host ] => localhost [ Connection ] => keep - alive [ Content - Length ] => 171 [ Authorization ] => "My Custom Header Yo Yo!!" [ Postman - Token ] => 4 c6308bd - da37 - 6 fdf - 6806 - f945c59136f8 [ Cache - Control ] => no - cache [ Origin ] => chrome - extension: //fhbjgbiflinjbdggehcddcbncdddomop [ User - Agent ] => Mozilla / 5.0 ( Windows NT 10.0 ; Win64 ; x64 ) AppleWebKit / 537.36 ( KHTML , like Gecko ) Chrome / 54.0 . 2840.71 Safari / 537.36 [ Content - Type ] => application / json [ Accept ] => */* [ Accept - Encoding ] => gzip , deflate , br [ Accept - Language ] =>