I am developing an app for SMS gateway. I want to count inbox SMS and compare it to the server where getway is sending the SMS if inbox sms and server SMS is equal then I want to backup my inbox sms and then delete inbox sms. In this app I am able to count,backup and delete the inbox sms, but I dont know how to make an Http request and compare my inbox sms to the server. Plz help me I am a learner. My code is here :
TextView view = new TextView(this);
Uri uriSMSURI = Uri.parse("content://sms/inbox");
long now = System.currentTimeMillis();
long last24 = now - 24*60*60*1000;//24h in millis
String[] selectionArgs = new String[]{Long.toString(last24)};
String selection = "date" + ">?";
String[] projection = new String[]{"date"};
Cursor cur = getContentResolver().query(uriSMSURI, projection, selection, selectionArgs,null);
String sms = String.valueOf(cur.getCount());
view.setText("Total incoming today SMS "+sms);
setContentView(view);