从别人那里抠的,代码有点乱,仅供自己参考,需要的自己整理下吧,或直接链接到作者的博客地址:

http://dev.10086.cn/cmdn/wiki/index.php?doc-view-7305.html转载请说明

C/C++代码

  1. //调用浏览器
  2. Uriuri=Uri.parse("");
  3. Intentit=newIntent(Intent.ACTION_VIEW,uri);
  4. startActivity(it);


复制到剪贴板C/C++代码
  1. //显示某个坐标在地图上
  2. Uriuri=Uri.parse("geo:38.899533,-77.036476");
  3. Intentit=newIntent(Intent.Action_VIEW,uri);
  4. startActivity(it);


复制到剪贴板C/C++代码
  1. //显示路径
  2. Uriuri=Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
  3. Intentit=newIntent(Intent.ACTION_VIEW,URI);
  4. startActivity(it);


复制到剪贴板C/C++代码
  1. //拨打电话
  2. Uriuri=Uri.parse("tel:10086");
  3. Intentit=newIntent(Intent.ACTION_DIAL,uri);
  4. startActivity(it);
  5. Uriuri=Uri.parse("tel.10086");
  6. Intentit=newIntent(Intent.ACTION_CALL,uri);


需要添加 <uses-permission id="Android.permission.CALL_PHONE" /> 这个权限到androidmanifest.xml

复制到剪贴板C/C++代码
  1. //发送短信或彩信
  2. Intentit=newIntent(Intent.ACTION_VIEW);
  3. it.putExtra("sms_body","TheSMStext");
  4. it.setType("vnd.android-dir/mms-sms");
  5. startActivity(it);


复制到剪贴板C/C++代码
  1. //发送短信
  2. Uriuri=Uri.parse("smsto:10086");
  3. Intentit=newIntent(Intent.ACTION_SENDTO,uri);
  4. it.putExtra("sms_body","cwj");
  5. startActivity(it);


复制到剪贴板C/C++代码
  1. //发送彩信
  2. Uriuri=Uri.parse("content://media/external/images/media/23");
  3. Intentit=newIntent(Intent.ACTION_SEND);
  4. it.putExtra("sms_body","sometext");
  5. it.putExtra(Intent.EXTRA_STREAM,uri);
  6. it.setType("image/png");
  7. startActivity(it);


复制到剪贴板C/C++代码
  1. //发送邮件
  2. Uriuri=Uri.parse("mailto:android123@163.com");
  3. Intentit=newIntent(Intent.ACTION_SENDTO,uri);
  4. startActivity(it);
  5. Intentit=newIntent(Intent.ACTION_SEND);
  6. it.putExtra(Intent.EXTRA_EMAIL,android123@163.com);
  7. it.putExtra(Intent.EXTRA_TEXT,"Theemailbodytext");
  8. it.setType("text/plain");
  9. startActivity(Intent.createChooser(it,"ChooseEmailClient"));
  10. Intentit=newIntent(Intent.ACTION_SEND);
  11. String[]tos={"me@abc.com"};
  12. String[]ccs={"you@abc.com"};
  13. it.putExtra(Intent.EXTRA_EMAIL,tos);
  14. it.putExtra(Intent.EXTRA_CC,ccs);
  15. it.putExtra(Intent.EXTRA_TEXT,"Theemailbodytext");
  16. it.putExtra(Intent.EXTRA_SUBJECT,"Theemailsubjecttext");
  17. it.setType("message/rfc822");
  18. startActivity(Intent.createChooser(it,"ChooseEmailClient"));


复制到剪贴板C/C++代码
  1. //播放媒体文件
  2. Intentit=newIntent(Intent.ACTION_VIEW);
  3. Uriuri=Uri.parse("file:///sdcard/cwj.mp3");
  4. it.setDataAndType(uri,"audio/mp3");
  5. startActivity(it);
  6. Uriuri=Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI,"1");
  7. Intentit=newIntent(Intent.ACTION_VIEW,uri);
  8. startActivity(it);


复制到剪贴板C/C++代码
  1. //卸载APK
  2. Uriuri=Uri.fromParts("package",strPackageName,null);
  3. Intentit=newIntent(Intent.ACTION_DELETE,uri);
  4. startActivity(it);
  5. //卸载apk2
  6. UriuninstallUri=Uri.fromParts("package","xxx",null);
  7. returnIt=newIntent(Intent.ACTION_DELETE,uninstallUri);
  8. //安装APK
  9. UriinstallUri=Uri.fromParts("package","xxx",null);
  10. returnIt=newIntent(Intent.ACTION_PACKAGE_ADDED,installUri);


复制到剪贴板C/C++代码
  1. //播放音乐
  2. UriplayUri=Uri.parse("file:///sdcard/download/sth.mp3");
  3. returnIt=newIntent(Intent.ACTION_VIEW,playUri);


复制到剪贴板C/C++代码
  1. //发送附近
  2. Intentit=newIntent(Intent.ACTION_SEND);
  3. it.putExtra(Intent.EXTRA_SUBJECT,"Theemailsubjecttext");
  4. it.putExtra(Intent.EXTRA_STREAM,"file:///sdcard/cwj.mp3");
  5. sendIntent.setType("audio/mp3");
  6. startActivity(Intent.createChooser(it,"ChooseEmailClient"));


复制到剪贴板C/C++代码
  1. //market上某个应用信,pkg_name就是应用的packageName
  2. Uriuri=Uri.parse("market://search?q=pname:pkg_name");
  3. Intentit=newIntent(Intent.ACTION_VIEW,uri);
  4. startActivity(it);


复制到剪贴板C/C++代码
  1. //market上某个应用信息,app_id可以通过www网站看下
  2. Uriuri=Uri.parse("market://details?id=app_id");
  3. Intentit=newIntent(Intent.ACTION_VIEW,uri);
  4. startActivity(it);


复制到剪贴板C/C++代码
  1. //调用搜索
  2. Intentintent=newIntent();
  3. intent.setAction(Intent.ACTION_WEB_SEARCH);
  4. intent.putExtra(SearchManager.QUERY,"android123")
  5. startActivity(intent);

更多相关文章

  1. java获取http:图片下载代码——android基础编
  2. 解决办法:error: inner element must either be a resource refer
  3. Android(安卓)Animation 高手必读 之一 Tweened Animations 代码
  4. Android(安卓)客户端通过HTTP POST发布图片和文字源代码
  5. android 浅复制和深复制-Java Generic Deep Copy 篇
  6. Android简易计算器(四)—— 完整逻辑代码
  7. Android应用开发中使用GridView网格布局的代码示例
  8. andorid 源码使用
  9. Android(安卓)Studio如何格式化XML代码顺序。

随机推荐

  1. Android输入法的显示与隐藏
  2. Android ImageView去掉周围的白边
  3. 关于一个android工程同时使用多个工程库,
  4. 从源码一次彻底理解Android的消息机制
  5. Android Google应用移植时包依赖关系
  6. Android积木之图片的生成和保存
  7. android上多样式文本的使用
  8. 给android设置代理
  9. [Android]CircleList 圆弧形 ListView
  10. android实现退出时关闭所有activity