- 浏览: 857834 次
- 性别:
- 来自: 上海
最新评论
-
waterflow:
感谢分享
简单的ChartDirector生成图表例子 -
YQuite:
写到最后一种文件才看到这个,洼的一声哭了出来 - - !
java简单解析docx、pptx、xlsx文档 -
q394469902:
Android通过selector改变界面状态 -
db6623919:
直接粘贴别人帖子还是英文的,有意思?
实现RTSP协议的简单例子 -
ykou314:
请问下,这些超级命令,是否需要android root权限,尤 ...
Android系统在超级终端下必会的命令大全(七)
下面的一些例子是从网上找的,他有点像J2ME的platformRequest,能调用手机平台的一些如SMS,浏览器,MMS,TEL等功能
显示网页
Uri uri = Uri.parse("http://google.com"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it);
显示地图
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("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" />
发送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);
发送EMAIL
Uri uri = Uri.parse("mailto:xxx@abc.com"); Intent it = new Intent(Intent.ACTION_SENDTO, uri); startActivity(it); Intent it = new Intent(Intent.ACTION_SEND); it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com"); it.putExtra(Intent.EXTRA_TEXT, "The email body text"); it.setType("text/plain"); startActivity(Intent.createChooser(it, "Choose Email Client")); Intent it=new Intent(Intent.ACTION_SEND); String[] tos={"me@abc.com"}; String[] ccs={"you@abc.com"}; it.putExtra(Intent.EXTRA_EMAIL, tos); it.putExtra(Intent.EXTRA_CC, ccs); it.putExtra(Intent.EXTRA_TEXT, "The email body text"); it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); it.setType("message/rfc822"); startActivity(Intent.createChooser(it, "Choose Email Client")); //传送附件 Intent it = new Intent(Intent.ACTION_SEND); it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text"); it.putExtra(Intent.EXTRA_STREAM, "file:///sdcard/mysong.mp3"); sendIntent.setType("audio/mp3"); startActivity(Intent.createChooser(it, "Choose Email Client"));
播放多媒体
Intent it = new Intent(Intent.ACTION_VIEW); Uri uri = Uri.parse("file:///sdcard/song.mp3"); it.setDataAndType(uri, "audio/mp3"); startActivity(it); Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it);
Android Market
//寻找应用 Uri uri = Uri.parse("market://search?q=pname:pkg_name"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); //where pkg_name is the full package path for an application //显示应用详细列表 Uri uri = Uri.parse("market://details?id=app_id"); Intent it = new Intent(Intent.ACTION_VIEW, uri); startActivity(it); //where app_id is the application ID, find the ID //by clicking on your application on Market home //page, and notice the ID from the address bar
卸载应用
Uri uri = Uri.fromParts("package", strPackageName, null); Intent it = new Intent(Intent.ACTION_DELETE, uri); startActivity(it);
安装应用
Uri uri = Uri.parse("url_of_apk_file"); Intent it = new Intent(Intent.ACTION_VIEW, uri); it.setData(uri); it.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); it.setClassName("com.android.packageinstaller", "com.android.packageinstaller.PackageInstallerActivity"); startActivity(it); //make sure the url_of_apk_file is readable for all users
How to destroy an Activity in android
android之view获取getWidth()和getHeight()
发表评论
-
One省电卫士 - Android内核级省电App
2013-02-03 19:32 3505One省电卫士是一款androi ... -
(转)Windows下Eclipse集成Cygwin配置Android NDK环境编译JNI库程序步骤
2012-05-09 16:11 5545前戏准备: 1. 搭建Eclipse Android ... -
Android-Task和Activity相关的一些属性[转]
2011-08-23 09:21 2990android:allowTaskReparenting用来标 ... -
GC_FOR_MALLOC
2011-07-01 11:44 2245GC_FOR_MALLOC means that the ... -
ProgressBar 样式
2011-05-01 23:06 3103The four attributes that you me ... -
ShellCommand.java
2011-04-07 19:38 1527/** * ShellCommand.java runs co ... -
Android任务管理终极发布AndTask 3.1(安安任务管理)
2011-04-04 07:50 1608安安任务管理是一款android任务管理软件,可通过手动或自动 ... -
AndMemory 安安内存管理 1.1 发布
2011-03-08 23:42 1844AndMemory is an android memory ... -
预测今年将是android应用普及年和android安全年
2011-03-06 21:53 1901经过去年一年的实践,预测今年将是android应用 ... -
Android之混淆(Obfuscate)
2011-03-06 16:07 2829下载Android安安软件请到:http://code. ... -
Android内存信息
2011-02-21 21:40 2117下载Android安安软件请到:http://code.goo ... -
How to decompile .dex file on Android(转)如何反编译.dex文件
2011-02-20 11:34 2815下载Android安安软件请到:http://code.goo ... -
(转)android JNI 学习笔记1
2011-02-17 10:08 2742下载Android安安软件请到:http://code.goo ... -
(转)Android内存管理机制之一:lowmemory killer
2011-02-15 15:00 2579下载Android安安软件请到 ... -
(转)内存管理Memory Management in Android
2011-02-14 23:31 4127下载Android安安软件请到:http://code.goo ... -
转-Andriod被排出Linux内核的原因
2011-01-12 22:36 1477下载Android安安软件请到:http://code.goo ... -
Ubuntu 开启 Android 的 USB 调试模式
2011-01-06 20:51 7702在Android开发者网站中, 它提供了在 Ubuntu 下实 ... -
解决Conversion to Dalvik format failed: Unable to execute dex: null
2010-12-12 23:17 2347解决Conversion to Dalvik format f ... -
AndBox发布最新版AndRootFile(安安文件管理) 3.0 beta 版
2010-11-27 09:56 1718The ultimate file manager for r ... -
(转)区分Activity的四种加载模式
2010-11-20 10:09 1727在多Activity开发中,有可能是自己应用之间的Activi ...
相关推荐
android调用平台功能,从网上找的,可以看看,不全,我 想找个调用手机平台的网络设置功能,不知道哪位人士能帮助
android 调用系统照相机功能 ,包括摄像机视频调用
本文实例讲述了Android调用摄像头功能的方法。分享给大家供大家参考,具体如下: 我们要调用摄像头的拍照功能,显然 第一步必须加入调用摄像头硬件的权限,拍完照后我们要将图片保存在SD卡中,必须加入SD卡读写权限...
在Android开发过程中,有时需要调用手机自身设备的功能,本演示项目侧重摄像头拍照功能的调用。
Android调用系统锁屏,实现默认锁屏密码
Android调用google翻译的javascript实现翻译单词功能,在线翻译,用户输入单词,就可。 WebSettings webSettings = wv.getSettings();//取得WebSettings webSettings.setJavaScriptEnabled(true);//设定可执行...
android 调用自带录像功能 保存自定义路径
an android demo to use openai's api 调用openai提供的接口,实现与ChatGPT对话 功能: 支持至Gpt-3.5模型(因为本人买不起plus) ✓ 无需代理即可与ChatGPT对话(可以使用自己的服务器中转) ✓ 支持带记忆的...
调用Android自带日历功能
Android APP使用WebView调用H5页面完成摄像头扫描二维码 项目使用Android Studio,打开项目可以直接运行,用过的都说好:)
DelphiXE10调用Android标准功能录象
android 调用微信扫一扫(调用微信.so实现)
Android调用系统分享文本信息、单张图片、多个文件和指定分享到微信、QQ的实例代码: //www.jb51.net/article/112057.htm 同时分享图片和文字 private void share(String content, Uri uri){ Intent shareIntent =...
android版本的多功能日历,完成日历框架的会址,2D接口的使用.
android 系统调用WPS打开word excel ppt pdf 等,将代码类移入的你项目,有对6.0 7.0及以上系统做文件读取方法
浏览器下载,浏览器弹出框,javascript调用客户端,客户端调用javascript
android调用系统的一些自动功能,完成对系统自带功能的访问
学习使用AndroidStudio开发App
使用android studio调用AP接口判断登录注册是否成功