Methods Summary |
---|
private void | bindXmppService()
bindService((new Intent()).setComponent(
com.google.android.xmppService.XmppConstants.XMPP_SERVICE_COMPONENT),
null, mConnection, 0);
|
private android.content.Intent | getIntentToSend()
Intent intent = new Intent(XmppDataMessageReceiver.ACTION);
intent.putExtra("poke", "Hi, I am Sam.");
intent.putExtra("question", "would you like to eat green eggs and ham?");
return intent;
|
private boolean | isValidUsername(java.lang.String username)
if (TextUtils.isEmpty(username)) {
return false;
}
if (username.indexOf('@") == -1) {
return false;
}
return true;
|
protected void | onCreate(android.os.Bundle icicle)
super.onCreate(icicle);
setContentView(R.layout.xmpp_data_message_sender);
mUsernameField = (EditText)findViewById(R.id.username);
mUsernameField.setOnClickListener(mOnClickListener);
mUsernameField.requestFocus();
mSendButton = (Button)findViewById(R.id.send);
mSendButton.setOnClickListener(mOnClickListener);
mSendButton.setEnabled(false);
bindXmppService();
|
protected void | onDestroy()
super.onDestroy();
unbindService(mConnection);
|
private void | showMessage(java.lang.CharSequence msg)
NotificationManager nm = (NotificationManager)getSystemService(
Context.NOTIFICATION_SERVICE);
nm.notifyWithText(123, msg, NotificationManager.LENGTH_LONG, null);
|