//Parameters
@Override
        protected String doInBackground(Object[] par) {
            // do above Server call here
            Rule mRule = (Rule) par[0];
            String user = (String) par[1];
            HttpClient client = new DefaultHttpClient();
            HttpPost post = new HttpPost(urlRulesApi);
            List<NameValuePair> params = new ArrayList<NameValuePair>();
            //Parameters
            params.add(new BasicNameValuePair("rule_title", mRule.getRuleName()));
            params.add(new BasicNameValuePair("rule_description", mRule.getDescription()));
            params.add(new BasicNameValuePair("rule_channel_one", mRule.getIfElement()));
            params.add(new BasicNameValuePair("rule_channel_two", mRule.getDoElement()));
            params.add(new BasicNameValuePair("rule_event_title", mRule.getIfAction()));
            params.add(new BasicNameValuePair("rule_action_title",mRule.getDoAction()));
            params.add(new BasicNameValuePair("rule_place", mRule.getPlace()));
            params.add(new BasicNameValuePair("rule_creator", user));
            params.add(new BasicNameValuePair("rule", mRule.getEyeRule()));//EYE rule with prefix
            params.add(new BasicNameValuePair("command", "createRule"));
            Log.i("RULE","My ruleee"+ mRule.getEyeRule());
            String response = "";
            try {
                post.setEntity(new UrlEncodedFormEntity(params));
                HttpResponse resp = null;
                resp = client.execute(post);
                HttpEntity ent = resp.getEntity();
                response = EntityUtils.toString(ent);
            } catch (IOException e) {
                e.printStackTrace();
            }
            return response;
        }
HttpPost post = new HttpPost(urlRulesApi);
List<NameValuePair> params = new ArrayList<NameValuePair>();
//Parameters
params.add(new BasicNameValuePair("rule_title", mRule.getRuleName()));
params.add(new BasicNameValuePair("rule_description", mRule.getDescription()));
@Override
protected String doInBackground(Object[] par) {
// do above Server call here
Rule mRule = (Rule) par[0];
String user = (String) par[1];
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(urlRulesApi);
List<NameValuePair> params = new ArrayList<NameValuePair>();
//Parameters
params.add(new BasicNameValuePair("rule_title", mRule.getRuleName()));
params.add(new BasicNameValuePair("rule_description", mRule.getDescription()));
params.add(new BasicNameValuePair("rule_channel_one", mRule.getIfElement()));
params.add(new BasicNameValuePair("rule_channel_two", mRule.getDoElement()));
params.add(new BasicNameValuePair("rule_event_title", mRule.getIfAction()));
params.add(new BasicNameValuePair("rule_action_title",mRule.getDoAction()));
params.add(new BasicNameValuePair("rule_place", mRule.getPlace()));
params.add(new BasicNameValuePair("rule_creator", user));
params.add(new BasicNameValuePair("rule", mRule.getEyeRule()));//EYE rule with prefix
params.add(new BasicNameValuePair("command", "createRule"));
@Override
protected String doInBackground(Object[] par) {
// do above Server call here
Rule mRule = (Rule) par[0];
String user = (String) par[1];
HttpClient client = new DefaultHttpClient();
HttpPost post = new HttpPost(urlRulesApi);
List<NameValuePair> params = new ArrayList<NameValuePair>();
//Parameters
params.add(new BasicNameValuePair("rule_title", mRule.getRuleName()));
params.add(new BasicNameValuePair("rule_description", mRule.getDescription()));
params.add(new BasicNameValuePair("rule_channel_one", mRule.getIfElement()));
params.add(new BasicNameValuePair("rule_channel_two", mRule.getDoElement()));
params.add(new BasicNameValuePair("rule_event_title", mRule.getIfAction()));
params.add(new BasicNameValuePair("rule_action_title",mRule.getDoAction()));
params.add(new BasicNameValuePair("rule_place", mRule.getPlace()));
params.add(new BasicNameValuePair("rule_creator", user));
params.add(new BasicNameValuePair("rule", mRule.getEyeRule()));//EYE rule with prefix
params.add(new BasicNameValuePair("command", "createRule"));
Log.i("RULE","My ruleee"+ mRule.getEyeRule());
String response = "";
try {
post.setEntity(new UrlEncodedFormEntity(params));
HttpResponse resp = null;
resp = client.execute(post);
HttpEntity ent = resp.getEntity();
response = EntityUtils.toString(ent);
} catch (IOException e) {
e.printStackTrace();