Midlet SMS from Moto V3
I've tried 2 ways.
1) Not adding anything to the permissions API and letting the phone prompt me
2) Adding the "javax.microedition.io.Connector.sms" to the API permissions.
Either way fails. Here's what happens:
1) App is always installed (OTA) fine.
2) I am able to connect using the HttpConnection class and I am correctly prompted by the phone for permission authorization.
3) I am never able to successfully use the MessageConnection class. I am never prompted to authorize. It simply throws the following error: "javax.microedition.sms was denied"
What a, I doing wrong?
package hello;
import javax.microedition.io.Connector;
import javax.microedition.io.HttpConnection;
import javax.wireless.messaging.MessageConnection;
import javax.wireless.messaging.TextMessage;
public class SMSConnector{
public static void sendSMS() throws Exception{
MessageConnection clientConn = null;
HttpConnection msgCon = null;
// not the number I am using. I am using my cell phone number
// this is just the format of the number I am using
String smsAddr = "sms://18605551212";
// This works fine. I am prompted by the phone to authorize
// this access attempt as I would expect
msgCon = (HttpConnection)Connector.open("http://www.sun.com");
// This fails. I am not asked to authorize the attempt
// I simply get a
clientConn = (MessageConnection)Connector.open(smsAddr);
}
}

