I work sending SMS with the GoogleMaps link, but in some cases, the phone does not send, I can not know the reason, other links are sent normally.
Here is the image of the message:
Iwouldlikesomehelpinresolvingthisissue.And,importantly,theideaofusingSMSisnottobebindingontheinternet.
HereisthecodeIuseforthegeneration:
Stringuri="http://maps.google.com/maps?q=" + latitude + "," + longitude;
if (!preferences.getNumber(activity).equals("")) {
smsBody.append(Uri.parse(uri));
String telefone1 = preferences.getNumber(activity);
try {
smsManager.sendTextMessage(telefone1, null, msgASerEnviada, null, null);
smsManager.sendTextMessage(telefone1, null, smsBody.toString(), null, null);//mensagem com o link
Toast.makeText(activity, "Mensagem enviada para " + telefone1, Toast.LENGTH_SHORT).show();
} catch (Exception e) {
e.printStackTrace();
Toast.makeText(activity, "Há algo errado, por favor verifique o número enviado", Toast.LENGTH_SHORT);
}
}//Na edição foi adicionada mais uma barra.