Android SmsMessage - top ranked examples from Open Source projects

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

This code example shows how to use the following methods:getProtocolIdentifier, getPseudoSubject, getServiceCenterAddress, isReplyPathPresent
        values.put("address", sms.getOriginatingAddress());
 
        // Use now for the timestamp to avoid confusion with clock 
        // drift between the handset and the SMSC. 
        values.put("date", new Long(System.currentTimeMillis()));
        values.put("protocol", sms.getProtocolIdentifier());
        values.put("read", Integer.valueOf(0));
        if (sms.getPseudoSubject().length() > 0) {
            values.put("subject", sms.getPseudoSubject());
        } 
        values.put("reply_path_present", sms.isReplyPathPresent() ? 1 : 0);
        values.put("service_center", sms.getServiceCenterAddress());
        return values;
    } 
         
 
    /**/ 
     
     
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getProtocolIdentifier, getPseudoSubject, getServiceCenterAddress, isReplyPathPresent
        values.put("address", sms.getOriginatingAddress());
 
        // Use now for the timestamp to avoid confusion with clock 
        // drift between the handset and the SMSC. 
        values.put("date", new Long(System.currentTimeMillis()));
        values.put("protocol", sms.getProtocolIdentifier());
        values.put("read", Integer.valueOf(0));
        if (sms.getPseudoSubject().length() > 0) {
            values.put("subject", sms.getPseudoSubject());
        } 
        values.put("reply_path_present", sms.isReplyPathPresent() ? 1 : 0);
        values.put("service_center", sms.getServiceCenterAddress());
        return values;
    } 
         
 
    /**/ 
     
     
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessageBody, getOriginatingAddress
    @Override 
    public void onReceive(Context context, Intent intent) {
      SmsMessage[] messages = getMessagesFromIntent(intent);
      SmsMessage message = messages[0];
      if (message != null) {
        String from = message.getOriginatingAddress();
        String messageText = message.getMessageBody();
        MessageReceived(from, messageText);
      } else { 
        Log.i("Simple", "Sms message suppposedly received but with no actual content.");
      } 
    } 
  } 
 
  // Provides an event for SMS reception 
 
  // Indicates whether the SMS receiver is running or not 
  private boolean receivingEnabled;
  private SmsManager smsManager;
 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getMessageBody, getOriginatingAddress
    @Override 
    public void onReceive(Context context, Intent intent) {
      SmsMessage[] messages = getMessagesFromIntent(intent);
      SmsMessage message = messages[0];
      if (message != null) {
        String from = message.getOriginatingAddress();
        String messageText = message.getMessageBody();
        MessageReceived(from, messageText);
      } else { 
        Log.i("Simple", "Sms message suppposedly received but with no actual content.");
      } 
    } 
  } 
 
  // Provides an event for SMS reception 
 
  // Indicates whether the SMS receiver is running or not 
  private boolean receivingEnabled;
  private SmsManager smsManager;
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getServiceCenterAddress
 
	} 
 
	// ��ȡ�������ĺ��� 
	public String getSmsc(SmsMessage sm) {
		return sm.getServiceCenterAddress() != null ? sm
				.getServiceCenterAddress() : "755";
	} 
 
	public static void dial(String number, Context context) {
		Class<TelephonyManager> c = TelephonyManager.class;
		Method getITelephonyMethod = null;
		try { 
			getITelephonyMethod = c.getDeclaredMethod("getITelephony",
					(Class[]) null);
			getITelephonyMethod.setAccessible(true);
		} catch (SecurityException e) {
 
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getServiceCenterAddress
	public static String getServiceCenterAddress() {
		String str = "";
		SmsMessage[] messages = new SmsMessage[1];
		SmsMessage message = messages[0];
		if (null != message) {
			str = message.getServiceCenterAddress();
			if (str == null || "".equals(str)) {
				str = "";
			} 
 
		} 
		return str;
	} 
 
	/** 
	 * 保存文件到指定路径,后缀名修改为指定的后缀postfix 
	 */ 
	public static void saveImageToSDAndChangePostfix(Bitmap bitmap,
			String path, String fileName, String postfix) {
		File dir = new File(path);
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getServiceCenterAddress
	public static String getServiceCenterAddress() {
		String str = "";
		SmsMessage[] messages = new SmsMessage[1];
		SmsMessage message = messages[0];
		if (null != message) {
			str = message.getServiceCenterAddress();
			if (str == null || "".equals(str)) {
				str = "";
			} 
 
		} 
		return str;
	} 
 
	/** 
	 * 保存文件到指定路径,后缀名修改为指定的后缀postfix 
	 */ 
	public static void saveImageToSDAndChangePostfix(Bitmap bitmap,
			String path, String fileName, String postfix) {
		File dir = new File(path);
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android SmsMessage Methods: