首页 » 黑莓开发 » 黑莓开发中的拨打电话和发送短信函数

黑莓开发中的拨打电话和发送短信函数

3484 0

拨打电话:

public void makeCall(String phoneNumber){
PhoneArguments call = new PhoneArguments (PhoneArguments.ARG_CALL,phoneNumber);
Invoke.invokeApplication(Invoke.APP_TYPE_PHONE, call);
}
}

发送短信: 不过这种应该不支持cdma

public void makeSMS(String number){
try{
MessageConnection mc = (MessageConnection)Connector.open("sms://");
TextMessage textMessage = (TextMessage)mc.newMessage(MessageConnection.TEXT_MESSAGE); textMessage.setAddress("sms://" + number);
Invoke.invokeApplication(Invoke.APP_TYPE_MESSAGES, new MessageArguments(textMessage));
} catch (IOException e)
{
Dialog.alert(e.getMessage());
}
}

文章评分1次,平均分5.0

本文原始地址:https://www.tiandiyoyo.com/2010/01/%e9%bb%91%e8%8e%93%e5%bc%80%e5%8f%91%e4%b8%ad%e7%9a%84%e6%8b%a8%e6%89%93%e7%94%b5%e8%af%9d%e5%92%8c%e5%8f%91%e9%80%81%e7%9f%ad%e4%bf%a1%e5%87%bd%e6%95%b0/
本站所有文章,除了特别注明外,均为本站原创,转载请注明出处来自www.tiandiyoyo.com

您可能还会对以下文章感兴趣:

评论前先开启评论开关: