Code example for SmsManager

Methods: divideMessage, sendMultipartTextMessage

0
	public void sendSms(String message, String phoneNumber) {
 
		Log.d("Contacter", "sendSms to "+phoneNumber+" : "+message);
 
		if ( this.realMode == true ) {
			ArrayList<String> smsTexts = this.smsManager.divideMessage(message);
			this.smsManager.sendMultipartTextMessage(phoneNumber, null, smsTexts, null, null);
		} 
	} 
	 
	public void sendEmail(String message, String emailAddress) {
	 
		Log.d("Contacter", "sendEmail to "+emailAddress+" : "+message);
		 
		PreferencesService preferencesService = ThiefTracker.getPreferencesService();
		String account = preferencesService.getPreference("mailAccount");
		String password = preferencesService.getPreference("mailPassword");
		if ( !account.equals("") && !password.equals("") )
		{ 
			Mail mail = new Mail();
			mail.setSubject("A message from ThiefTracker on device "+ThiefTracker.getDeviceId());