use of dev.sagar.smsblocker.tech.utils.SMSUtil in project SMSBlocker by sagarpawardev.
the class SilentSMSSenderActivity method init.
private void init() {
final String methodName = "init()";
log.justEntered(methodName);
gSMSUtil = new SMSUtil(this);
log.returning(methodName);
}
use of dev.sagar.smsblocker.tech.utils.SMSUtil in project SMSBlocker by sagarpawardev.
the class ThreadActivity method init.
private void init() {
final String methodName = "init()";
log.justEntered(methodName);
try {
// TODO Analytics App
sAnalytics = GoogleAnalytics.getInstance(this);
sTracker = getDefaultTracker();
sTracker.setScreenName("Image~HomeActivity");
sTracker.send(new HitBuilders.ScreenViewBuilder().build());
} catch (Exception e) {
log.info(methodName, "Logging Error..");
log.error(methodName, e);
}
recyclerView = (RecyclerView) findViewById(R.id.lv_sms);
btnSend = (ImageButton) findViewById(R.id.btn_send);
etMsg = (EditText) findViewById(R.id.et_msg);
holderBodyET = findViewById(R.id.holder_sms_et);
tvReplyNotSupported = findViewById(R.id.tv_reply_not_supported);
holderLoader = findViewById(R.id.holder_loader);
holderMain = findViewById(R.id.holder_main);
if (inboxUtil == null)
inboxUtil = new InboxUtil(this, this);
smsUtil = new SMSUtil(this);
smsReceivedReceiver = new LocalSMSReceivedReceiver(this);
smsDeliveredReceiver = new LocalSMSDeliveredReceiver(this);
smsSentReceiver = new LocalSMSSentReceiver(this);
// From Previous Activity
Bundle basket = getIntent().getExtras();
address = basket.getString(KEY_ADDRESS);
adapter = new RVThreadAdapter(this, this, smses);
amCallback = new AMCallbackThread(this, adapter);
LinearLayoutManager mLayoutManager = new LinearLayoutManager(getApplicationContext());
mLayoutManager.setReverseLayout(true);
recyclerView.setLayoutManager(mLayoutManager);
recyclerView.setAdapter(adapter);
log.returning(methodName);
}
use of dev.sagar.smsblocker.tech.utils.SMSUtil in project SMSBlocker by sagarpawardev.
the class NotificationBroadcastReceiver method onReceive.
@Override
public void onReceive(Context context, Intent intent) {
if (REPLY_ACTION.equals(intent.getAction())) {
// do whatever you want with the message. Send to the server or add to the db.
// for this tutorial, we'll just show it in a toast;
CharSequence message = getReplyMessage(intent);
Bundle bundle = intent.getExtras();
String lAddress = bundle.getString(KEY_ADDRESS);
int notifId = bundle.getInt(KEY_NOTIF_ID);
SMSUtil smsUtil = new SMSUtil(context);
SMS sms = smsUtil.sendSMS(lAddress, message.toString());
if (sms != null) {
NotificationUtilSingleton.getInstance().notifySMSSent(context, notifId);
} else {
NotificationUtilSingleton.getInstance().notifySendingFailed(context, notifId);
}
}
}
Aggregations