20140419 電話撥打 簡訊傳送

2021-06-21 14:47:58 字數 864 閱讀 4475

撥打**主要**:

string number_ = number.gettext().tostring();//定義字串存放得到的文字框的字串(號碼)

intent intent = new intent();//建立乙個意圖用來執行打**的操作

intent.setaction(intent.action_call);//意圖的動作時action_call打**

intent.setdata(uri.parse("tel://17951" + number_));//執行動作,打**

startactivity(intent);

發簡訊:

簡訊的傳送有乙個專門的類:smsmanager(import android.telephony.smsmanager;包中的);

具體**:

string number = send.gettext().tostring();//獲取**號碼

string msg_main = msg.gettext().tostring();//獲取資訊內容

smsmanager manager = smsmanager.getdefault();//建立簡訊傳送物件

manager.dividemessage(msg_main);//自動分割簡訊

manager.sendtextmessage(number, null, msg_main, null, null);//傳送簡訊

其中sendtextmessage(傳送的號碼,資訊中心號碼(預設的自動識別**卡的為

null

), 資訊內容, 傳送成功要執行的意圖, 送達成功執行的意圖);

命令列模擬撥打電話 簡訊

1.啟動android emulator,檢視標題欄找出埠。一般是android emulator 5554 其中 5554就是埠。2.開啟命令列,輸入telnet localhost 5554。程式將會連線到android console,返回 android console type help ...

iOS撥打電話

1,這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 nslog str str 2,這種方法,打完 後還會回到原來的程式,也...

iOS 撥打電話

1.這種方法,撥打完 回不到原來的應用,會停留在通訊錄裡,而且是直接撥打,不彈出提示 nsmutablestring str nsmutablestring alloc initwithformat tel 186 x6979 2.這種方法,打完 後還會回到原來的程式,也會彈出提示,推薦這種 nsm...