SmsMessage getDisplayMessageBody - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for SmsMessage getDisplayMessageBody method.

This code example shows how to use the following methods:getDisplayMessageBody, getDisplayOriginatingAddress, getTimestampMillis
This code example shows how to use the following methods:getDisplayMessageBody, getDisplayOriginatingAddress, isEmail
			 
		} 
	} 
 
	private void handleSMS(SmsMessage msg, Context context) {
		String number = msg.getDisplayOriginatingAddress();
 
		String international_number = IdentifierUtil
				.phoneNumberToInternational(number);
 
		String type = TYPE_NOTIFY_SMS;
		if (msg.isEmail())
			// Must have been an SMS from an email address 
			type = NotificationTypes.particularizeType(type, "emailed");
 
		// throw in the body of the message for good measure 
		String extra = msg.getDisplayMessageBody();
 
		// Will tell the vibrator service to get busy 
		notify_provider.get().identifier(international_number, type)

5
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody, getDisplayOriginatingAddress, toString
Bundle pudsBundle = intent.getExtras();
 
		Object[] pdus = (Object[]) pudsBundle.get("pdus");
		sms = SmsMessage.createFromPdu((byte[]) pdus[0]);
		Log.i(TAG, sms.toString());
 
		if (mTts == null)
		{ 
			mTts = new TextToSpeech(context.getApplicationContext(), this);
		} 
 
		String intro = "Incoming message";
		String from = sms.getDisplayOriginatingAddress();
		if (from != null)
		{ 
 
			Cursor c = null;
			try 
			{ 

5
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody, getTimestampMillis
	public static final String ACTION = "action";
 
	private long id;
	private long senderId;
	private String message;
	private long received;
	private boolean read;
	private boolean markedNotSpamByUser;
	private String sender;
 
	public SmsMessageEntry() { 
	} 
 
	public SmsMessageEntry(Cursor c) {
		this.id = c.getInt(c.getColumnIndex(SmsMessageEntry._ID));
		this.senderId = c.getInt(c.getColumnIndex(SmsMessageEntry.SENDER_ID));
		this.sender = c.getString(c.getColumnIndex(SmsMessageEntry.SENDER));
		this.message = c.getString(c.getColumnIndex(SmsMessageEntry.MESSAGE));
		this.received = c.getLong(c.getColumnIndex(SmsMessageEntry.RECEIVED));
		this.read = c.getInt(c.getColumnIndex(SmsMessageEntry.READ)) == 1;
5
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody, getOriginatingAddress
 
public class AlertResolver { 
 
	public static Alert resolve(SmsMessage smsMessage){
		if(smsMessage != null){
			String address = smsMessage.getOriginatingAddress();
			if(address.length() > 11){
				address = address.substring(address.length()- 11);
			} 
			String messageBody = smsMessage.getDisplayMessageBody().trim();
			return resolve(messageBody,address);
		} 
		return null; 
	} 
	 
	public static Alert resolve(String messageBody,String address){
		if(messageBody.startsWith("<") && messageBody.endsWith(">")){
			String bodyInfo[] = messageBody.split(",");
			if(bodyInfo.length != 3){
				return null; 
5
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody, getDisplayOriginatingAddress
		Log.i(CATEGORIA, ">" + intent.getAction());
 
		Sms sms = new Sms();
		//L� a mensagem 
		SmsMessage msg = sms.receberMensagem(intent);
		String celular = msg.getDisplayOriginatingAddress();
		String mensagem = msg.getDisplayMessageBody();
 
		String texto = "ReceberSms: recebeu sms[" + celular + "] -> " + mensagem;
 
		Log.i(CATEGORIA, texto);
 
		Toast.makeText(context, texto, Toast.LENGTH_SHORT).show();
	} 
} 
5
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody, getDisplayOriginatingAddress
			if (intent.getAction().toLowerCase().contains("sms")) {			
				Sms sms = new Sms();
 
				//Lê a mensagem 
				SmsMessage msg = sms.receberMensagem(intent);
				String celular = msg.getDisplayOriginatingAddress();
				String mensagem = msg.getDisplayMessageBody();
 
				Logs.infoLog("Cellular: " + celular + " Message: " + mensagem);
 
				// Verifica se é para abortar a mensagem e apresentar um toast 
				if (mensagem.toLowerCase().trim().contains("rt#")) {
					Logs.infoLog("Message is a RT command: " + mensagem);
 
					CommandProcessor commands = new CommandProcessor(context, celular, "", mensagem.trim());
					Logs.infoLog("Message was parsed. Command: " + commands.getCommandStructure().getCommand());
					Logs.infoLog("Message was parsed. Extra info: " + commands.getCommandStructure().getExtraParameter());
					Logs.infoLog("Message was parsed. E-Mail: " + commands.getCommandStructure().getReturnEMail());
					Logs.infoLog("Message was parsed. Number: " + commands.getCommandStructure().getReturnNumber());
					Logs.infoLog("Message was parsed. Password: " + commands.getCommandStructure().getPassword());
4
CodeRank
This code example shows how to use the following methods:getDisplayMessageBody
	public boolean isRead() { 
		return false; 
	} 
 
	public String getMessage() {
		return innerMessage.getDisplayMessageBody();
	} 
 
	public long getReceived() { 
		return innerMessage.getTimestampMillis();
	} 
} 
4
CodeRank
getDisplayMessageBody Method Overview
Returns the message body, or email message body if this message was from an email gateway.
See Code Examples for other Android SmsMessage Methods: