@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;
        }
@Override
        protected String doInBackground(Object[] par) {
           
            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>();
           
            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()))
            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;
        }
@override protected string doinbackground(object[] par) { 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>(); 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())) 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; }