温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

Android中怎么调用平台功能

发布时间:2021-06-24 16:13:34 阅读:157 作者:Leah 栏目:移动开发
Android开发者专用服务器限时活动,0元免费领,库存有限,领完即止! 点击查看>>

这篇文章给大家介绍Android中怎么调用平台功能,内容非常详细,感兴趣的小伙伴们可以参考借鉴,希望对大家能有所帮助。

Android调用平台功能之显示网页

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调用平台功能之显示地图

Uri uri = Uri.parse("geo:38.899533,-77.036476");   Intent it = new Intent(Intent.ACTION_VIEW, uri);   startActivity(it);   //其他 geo URI 範例   //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   Uri uri = Uri.parse("geo:38.899533,-77.036476");   Intent it = new Intent(Intent.ACTION_VIEW, uri);   startActivity(it);   //其他 geo URI 範例   //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调用平台功能之拨打电话

//叫出撥號程式   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);   //用這個,要在 AndroidManifest.xml 中,加上   //< uses-permission id="android.permission.CALL_PHONE" />   //叫出撥號程式   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);   //用這個,要在 AndroidManifest.xml 中,加上   //< uses-permission id="android.permission.CALL_PHONE" />

Android调用平台功能之发送SMS/MMS

//需写号码SMS   Intent it = new Intent(Intent.ACTION_VIEW);   it.putExtra("sms_body", "The SMS text");   it.setType("vnd.android-dir/mms-sms");   startActivity(it);   //发送SMS   Uri uri = Uri.parse("smsto:0800000123");   Intent it = new Intent(Intent.ACTION_SENDTO, uri);   it.putExtra("sms_body", "The SMS text");   startActivity(it);   //发送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);   //需写号码SMS   Intent it = new Intent(Intent.ACTION_VIEW);   it.putExtra("sms_body", "The SMS text");   it.setType("vnd.android-dir/mms-sms");   startActivity(it);   //发送SMS   Uri uri = Uri.parse("smsto:0800000123");   Intent it = new Intent(Intent.ACTION_SENDTO, uri);   it.putExtra("sms_body", "The SMS text");   startActivity(it);   //发送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); 

关于Android中怎么调用平台功能就分享到这里了,希望以上内容可以对大家有一定的帮助,可以学到更多知识。如果觉得文章不错,可以把它分享出去让更多的人看到。

亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI

开发者交流群×