http://blog.csdn.net/Alinaxz/archive/2010/04/19/5503168.aspx

Android操作系统那个可以通过调用手机平台来实现一些特定的功能,诸如网页的显示,邮件的发送等等。那么今天就为大家总结了几个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调用平台功能的相关内容就为大家介绍到这里

更多相关文章

  1. Android中一个Activity调用另一个Activity — Intent对象的使用
  2. android的启动过程
  3. android下发送中文短消息
  4. Android事件分发机制
  5. 《Android秘籍.第一卷》
  6. 浅谈Android系统启动过程
  7. Android之间互相的录屏直播 --点对点传输(tcp长连接发送h264)(一
  8. [转]Android(安卓)DNS 代码分析
  9. Android(安卓)Studio引入.so文件的正确姿势 以及调用.so 文件时

随机推荐

  1. Eclipse 开发高版本Android(安卓)应用
  2. 32、详解Android(安卓)shape的使用方法
  3. Android(安卓)BLE连接问题笔记
  4. android 开发 View _1_ View的子类们 和
  5. Android(安卓)仿qq 点赞功能
  6. android 模拟back键
  7. Android优雅的控制用户点击按钮的频率
  8. ListView一些相关知识
  9. Android入门笔记 - 多媒体 - MediaPlayer
  10. 动画 -- View动画 -- 透明度动画