title: getting error in rest call with key and secret using md5 in android?
body: <p>how to make rest call with key and secret using md5 in android?
  but I am getting an error as a response in loginService() method, </p>
  
  <p>error :
      {"status":"error","message":"Signature mismatch"}. </p>
  
  <p>the steps I followed, 
  Step 1- I made a string "param" for getting hash string using md5(string) method
  Step 2- called a method loginService() for getting response from web service</p>
  
  <p>Calling code:</p>
  
  <pre><code>{ 
      String param = "name" + first_name + last_name  + "email" + email + "facebook_user_id" + facebook_user_id + "location" + location + "zip_code" + zip_code + "birthday" + birthday + "time" + time + "api_key" + api_key;
      String signature = md5(param);
      Post_Method_Interface commonPost = new CommonPostMethod();
      getResponceForParse = commonPost.loginService(
                  first_name + last_name, email,facebook_user_id, location, zip_code, birthday,time, api_key, signature);
      Log.d("&gt;&gt;&gt; GetResponceForParse &gt;&gt;&gt; ",getResponceForParse);
  
      if (!facebook_user_id.equals(null)) {
              Post_Method_Interface commonPost = new CommonPostMethod();
              getResponceForParse = commonPost
                                  .FacebookLoginModel(first_name + last_name,
                                          email, facebook_user_id, location,
                                          zip_code, birthday, time, api_key,
                                          signature);
              Log.d("GetResponceForParse 1", getResponceForParse);
                          Intent i = new Intent(getApplicationContext(),
                                  HomeActivity.class);
  
  }
  </code></pre>
  
  <p>loginService() web service method of Post_method_Interface class,</p>
  
  <pre><code>public String loginService(String name, String email,
          String facebook_user_id, String location, String zip_code,
          String birthday, String timestamp, String api_key, String sig) {
  
      try {
          JSONObject schObject = new JSONObject();
          schObject.put("name", name);
          schObject.put("email", email);
          schObject.put("facebook_user_id", facebook_user_id);
          schObject.put("location", location);
          schObject.put("zip_code", zip_code);
          schObject.put("birthday", birthday);
          schObject.put("time", timestamp);
          schObject.put("api_key", api_key);
          schObject.put("sig", sig);
          String URL = ApiConstant.URL_FacebookLoginModel;
          JsonPostRequest postrequest = new JsonPostRequest();
          InputStream is = postrequest.doPost(schObject, URL);
          response = postrequest.inputSteamToString(is);
          Log.d("Login", response);
      } catch (Exception e) {
          // TODO: handle exception
          e.printStackTrace();
      }
      return response;
  </code></pre>
  
  <p>}</p>
  
  <p>md5() method:</p>
  
  <pre><code>private static final String md5(final String parem) {
  try {
      // Create MD5 Hash
      MessageDigest digest = java.security.MessageDigest
              .getInstance("MD5");
      digest.update(parem.getBytes());
      byte messageDigest[] = digest.digest();
  
      // Create Hex String
      StringBuffer hexString = new StringBuffer();
      for (int i = 0; i &lt; messageDigest.length; i++) {
          String h = Integer.toHexString(0xFF &amp; messageDigest[i]);
          while (h.length() &lt; 2)
              h = "0" + h;
          hexString.append(h);
      }
      return hexString.toString();
  } catch (NoSuchAlgorithmException e) {
      e.printStackTrace();
  }
  return "";
  </code></pre>
  
  <p>}</p>
  
  <p>Please help me its a very urjent !!!</p>