Android模拟器互发短信
2010-09-06 08:15:00 来源:WEB开发网messageText.append(" ");
messageReplyText.setText("");
} catch (Exception e) {
Log.e("SmsSending", "SendException", e);
}
bar.setVisibility(ProgressBar.INVISIBLE);
}
});
}
/**
* get the name by his tel number.
*
* @param telNum
* @return
*/
private String getNameByIdTelnum(String telNum) {
Cursor mCursor = this.getContentResolver().query(Uri.parse("telNum"),
null, null, null, null);
String result = mCursor.getColumnName(1);
Log.e("test name", result);
return "";
// mCursor.getColumnIndex("Sun");
}
}
最后别忘记加入权限:
Xml代码
< uses-permission android:name="android.permission.RECEIVE_SMS" />
< uses-permission android:name="android.permission.SEND_SMS" />
< uses-permission android:name="android.permission.RECEIVE_SMS" />
< uses-permission android:name="android.permission.SEND_SMS" />
测试的时候开两个模拟器,号码填入对方模拟器号即可 下载源码
更多精彩
赞助商链接