您好,登錄后才能下訂單哦!
這篇文章給大家介紹Android中怎么調(diào)用平臺(tái)功能,內(nèi)容非常詳細(xì),感興趣的小伙伴們可以參考借鑒,希望對(duì)大家能有所幫助。
Android調(diào)用平臺(tái)功能之顯示網(wǎng)頁(yè)
Uri uri = Uri.parse("http://google.com"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); Uri uri = Uri.parse("http://google.com"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it);
Android調(diào)用平臺(tái)功能之顯示地圖
Uri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//其他 geo URI 範(fàn)例
//geo:latitude,longitude
//geo:latitude,longitude?z=zoom
//geo:0,0?q=my+street+address
//geo:0,0?q=business+near+city
//google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,
zoom&mz=mapZoomUri uri = Uri.parse("geo:38.899533,-77.036476");
Intent it = new Intent(Intent.ACTION_VIEW, uri);
startActivity(it);
//其他 geo URI 範(fàn)例
//geo:latitude,longitude
//geo:latitude,longitude?z=zoom
//geo:0,0?q=my+street+address
//geo:0,0?q=business+near+city
//google.streetview:cbll=lat,lng&cbp=1,yaw,,pitch,
zoom&mz=mapZoom
Android調(diào)用平臺(tái)功能之撥打電話
//叫出撥號(hào)程式 Uri uri = Uri.parse("tel:0800000123"); Intent it = new Intent(Intent.ACTION_DIAL, uri); startActivity(it); //直接打電話出去 Uri uri = Uri.parse("tel:0800000123"); Intent it = new Intent(Intent.ACTION_CALL, uri); startActivity(it); //用這個(gè),要在 AndroidManifest.xml 中,加上 //< uses-permission id="android.permission.CALL_PHONE" /> //叫出撥號(hào)程式 Uri uri = Uri.parse("tel:0800000123"); Intent it = new Intent(Intent.ACTION_DIAL, uri); startActivity(it); //直接打電話出去 Uri uri = Uri.parse("tel:0800000123"); Intent it = new Intent(Intent.ACTION_CALL, uri); startActivity(it); //用這個(gè),要在 AndroidManifest.xml 中,加上 //< uses-permission id="android.permission.CALL_PHONE" />
Android調(diào)用平臺(tái)功能之發(fā)送SMS/MMS
//需寫號(hào)碼SMS
Intent it = new Intent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "The SMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
//發(fā)送SMS
Uri uri = Uri.parse("smsto:0800000123");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "The SMS text");
startActivity(it);
//發(fā)送MMS
Uri uri = Uri.parse("content://media/external
/images/media/23");Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra("sms_body", "some text");
it.putExtra(Intent.EXTRA_STREAM, uri);
it.setType("image/png");
startActivity(it);
//需寫號(hào)碼SMS
Intent it = new Intent(Intent.ACTION_VIEW);
it.putExtra("sms_body", "The SMS text");
it.setType("vnd.android-dir/mms-sms");
startActivity(it);
//發(fā)送SMS
Uri uri = Uri.parse("smsto:0800000123");
Intent it = new Intent(Intent.ACTION_SENDTO, uri);
it.putExtra("sms_body", "The SMS text");
startActivity(it);
//發(fā)送MMS
Uri uri = Uri.parse("content://media/external/
images/media/23");Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra("sms_body", "some text");
it.putExtra(Intent.EXTRA_STREAM, uri);
it.setType("image/png");
startActivity(it);
關(guān)于Android中怎么調(diào)用平臺(tái)功能就分享到這里了,希望以上內(nèi)容可以對(duì)大家有一定的幫助,可以學(xué)到更多知識(shí)。如果覺得文章不錯(cuò),可以把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場(chǎng),如果涉及侵權(quán)請(qǐng)聯(lián)系站長(zhǎng)郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。