日期:2014-05-20 浏览次数:20703 次
midlet.platformRequest("tel:1370000000")); midlet.platformRequest("http://www.baidu.com");//这样是访问网站
import com.motorola.phone.Dialer; import com.motorola.phone.DialerListener; public class CallUtil extends Thread implements DialerListener { String number = ""; public CallUtil(String number) { this.number = number; } public void run() { Dialer dialer = Dialer.getDefaultDialer(); dialer.setDialerListener(this); try { dialer.startCall(this.number); Screen.infoText = "已挂断电话"; } catch (IOException ex) { ex.printStackTrace(); Screen.infoText = "未呼出电话"; } } public void notifyDialerEvent(Dialer dialer, byte _byte) { } }
public void sendSMS(String number, String content) { MessageConnection smsconn = null; try { smsconn = (MessageConnection) Connector.open("sms://"+number); TextMessage txtmessage = (TextMessage) smsconn.newMessage(MessageConnection.TEXT_MESSAGE); txtmessage.setPayloadText(content); smsconn.send(txtmessage); Screen.infoText = "短信已发送"; } catch (Exception e) { Screen.infoText = "短信未发出"; } finally { if (smsconn != null) { try { smsconn.close(); } catch (IOException e) { e.printStackTrace(); } } } }
public void sendSMS(String number, String content) { try { com.samsung.util.SM sm = new com.samsung.util.SM();//samsung api sm.setData(content); sm.setDestAddress(number); com.samsung.util.SMS.send(sm); Screen.infoText = "短信已发送"; } catch (Exception e) { Screen.infoText = "短信未发出"; } }