- 浏览: 578726 次
- 性别:
- 来自: 上海
文章分类
- 全部博客 (182)
- android/ophone开发完全讲义 (4)
- android常用代码 (6)
- android工具 (9)
- android基础 (40)
- android进阶 (75)
- android经验记录 (3)
- android框架 (2)
- android面经 (5)
- android网络 (5)
- android资讯 (0)
- android资源 (17)
- 生活印象 (3)
- androidNDK (4)
- android开源 (1)
- android性能优化 (1)
- android设计 (2)
- android博客论坛收集 (1)
- android手机用户体验 (1)
- android动画 (1)
- android外文资料 (1)
- 汉字排序 (1)
最新评论
-
小猫咪201:
困惑了很久,终于找到答案了
一个常见的android内存泄露 问题 -
王雪龙:
pixels = dps * (density / 160). ...
关于Android的nodpi,xhdpi,hdpi,mdpi,ldpi -
Turr:
楼主给力,解决了我遇到的问题
解决ActivityGroup的sub Activity中spinner的WindowManager$BadTokenException的问题 -
boyuan2000cn:
你好,我转载了您的此篇博客,如果有版权问题,请告诉我,谢谢!转 ...
关于Android的nodpi,xhdpi,hdpi,mdpi,ldpi -
twlkyao:
请教您个问题,如何将drawable对象转换为id类型?
Android中Bitmap, Drawable, Byte,ID之间的转化
显示网页:
1. Uri uri = Uri.parse("http://www.google.com");
2. Intent it = new Intent(Intent.ACTION_VIEW,uri);
3. startActivity(it);
显示地图:
1. Uri uri = Uri.parse("geo:38.899533,-77.036476");
2. Intent it = new Intent(Intent.Action_VIEW,uri);
3. startActivity(it);
路径规划:
1. Uri uri = Uri.parse("http://maps.google.com/maps?f=d&saddr=startLat%20startLng&daddr=endLat%20endLng&hl=en");
2. Intent it = new Intent(Intent.ACTION_VIEW,URI);
3. startActivity(it);
拨打电话:
调用拨号程序
1. Uri uri = Uri.parse("tel:xxxxxx");
2. Intent it = new Intent(Intent.ACTION_DIAL, uri);
3. startActivity(it);
1. Uri uri = Uri.parse("tel.xxxxxx");
2. Intent it =new Intent(Intent.ACTION_CALL,uri);
3. 要使用这个必须在配置文件中加入<uses-permission id="Android.permission.CALL_PHONE" />
发送SMS/MMS
调用发送短信的程序
1. Intent it = new Intent(Intent.ACTION_VIEW);
2. it.putExtra("sms_body", "The SMS text");
3. it.setType("vnd.android-dir/mms-sms");
4. startActivity(it);
发送短信
1. Uri uri = Uri.parse("smsto:0800000123");
2. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
3. it.putExtra("sms_body", "The SMS text");
4. startActivity(it);
发送彩信
1. Uri uri = Uri.parse("content://media/external/images/media/23");
2. Intent it = new Intent(Intent.ACTION_SEND);
3. it.putExtra("sms_body", "some text");
4. it.putExtra(Intent.EXTRA_STREAM, uri);
5. it.setType("image/png");
6. startActivity(it);
发送Email
1.
2. Uri uri = Uri.parse("mailto:xxx@abc.com");
3. Intent it = new Intent(Intent.ACTION_SENDTO, uri);
4. startActivity(it);
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_EMAIL, "me@abc.com");
3. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
4. it.setType("text/plain");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
1. Intent it=new Intent(Intent.ACTION_SEND);
2. String[] tos={"me@abc.com"};
3. String[] ccs={"you@abc.com"};
4. it.putExtra(Intent.EXTRA_EMAIL, tos);
5. it.putExtra(Intent.EXTRA_CC, ccs);
6. it.putExtra(Intent.EXTRA_TEXT, "The email body text");
7. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
8. it.setType("message/rfc822");
9. startActivity(Intent.createChooser(it, "Choose Email Client"));
添加附件
1. Intent it = new Intent(Intent.ACTION_SEND);
2. it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
3. it.putExtra(Intent.EXTRA_STREAM, "[url=]file:///sdcard/mysong.mp3[/url]");
4. sendIntent.setType("audio/mp3");
5. startActivity(Intent.createChooser(it, "Choose Email Client"));
播放多媒体
1.
2. Intent it = new Intent(Intent.ACTION_VIEW);
3. Uri uri = Uri.parse("[url=]file:///sdcard/song.mp3[/url]");
4. it.setDataAndType(uri, "audio/mp3");
5. startActivity(it);
1. Uri uri = Uri.withAppendedPath(MediaStore.Audio.Media.INTERNAL_CONTENT_URI, "1");
2. Intent it = new Intent(Intent.ACTION_VIEW, uri);
3. startActivity(it);
Uninstall 程序
1. Uri uri = Uri.fromParts("package", strPackageName, null);
2. Intent it = new Intent(Intent.ACTION_DELETE, uri);
3. startActivity(it);
//调用相册
public static final String MIME_TYPE_IMAGE_JPEG = "image/*";
public static final int ACTIVITY_GET_IMAGE = 0;
Intent getImage = new Intent(Intent.ACTION_GET_CONTENT);
getImage.addCategory(Intent.CATEGORY_OPENABLE);
getImage.setType(MIME_TYPE_IMAGE_JPEG);
startActivityForResult(getImage, ACTIVITY_GET_IMAGE);
//调用系统相机应用程序,并存储拍下来的照片
Intent intent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);
time = Calendar.getInstance().getTimeInMillis();
intent.putExtra(MediaStore.EXTRA_OUTPUT, Uri.fromFile(new File(Environment
.getExternalStorageDirectory().getAbsolutePath()+"/tucue", time + ".jpg")));
startActivityForResult(intent, ACTIVITY_GET_CAMERA_IMAGE);
uninstall apk
/**未测试
Uri uninstallUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_DELETE, uninstallUri);
*/
Uri packageURI = Uri.parse("package:"+wistatmap);
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
install apk
Uri installUri = Uri.fromParts("package", "xxx", null);
returnIt = new Intent(Intent.ACTION_PACKAGE_ADDED, installUri);
play audio
Uri playUri = Uri.parse("[url=]file:///sdcard/download/everything.mp3[/url]");
returnIt = new Intent(Intent.ACTION_VIEW, playUri);
//发送附件
Intent it = new Intent(Intent.ACTION_SEND);
it.putExtra(Intent.EXTRA_SUBJECT, "The email subject text");
it.putExtra(Intent.EXTRA_STREAM, "[url=]file:///sdcard/eoe.mp3[/url]");
sendIntent.setType("audio/mp3");
startActivity(Intent.createChooser(it, "Choose Email Client"));
//搜索应用
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
//进入联系人页面
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(People.CONTENT_URI);
startActivity(intent);
//查看指定联系人
Uri personUri = ContentUris.withAppendedId(People.CONTENT_URI, info.id);//info.id联系人ID
Intent intent = new Intent();
intent.setAction(Intent.ACTION_VIEW);
intent.setData(personUri);
startActivity(intent);
发表评论
-
AlarmManager.RTC和ELAPSED_REALTIME的区别
2012-02-16 14:08 1702AlarmManager.RTC,硬件闹钟,不唤醒手机 ... -
Android文字居中
2012-02-14 11:09 5941在宽width高height的画布上画一字符串,使字符串水平竖 ... -
在Android中实现service动态更新UI界面
2011-05-13 09:40 2622http://mobile.51cto.com/android ... -
在Android开发中使用Gallery实现“多级联动”
2011-05-13 09:39 1150http://mobile.51cto.com/hot-230 ... -
Android手势识别ViewFlipper触摸动画
2011-05-13 09:30 1210http://mobile.51cto.com/hot-232 ... -
android开发过程中遇到的一些问题(包括自定义ProgressBar, Intent, Animation, ListView, RadioButton)
2011-05-13 09:20 1829问题如下: 1.在自定义的ListView中,在一个It ... -
J2ME游戏中的碰撞检测
2011-05-10 17:42 1195我们在游戏开发中总会遇到这样那样的碰撞 , 并且会很频 ... -
android获取屏幕尺寸、密度
2011-04-27 14:29 1284有些时候,我们需要获取Android手机或Pad的屏幕的物理尺 ... -
Java压缩技术相关
2011-04-27 14:27 894http://snowolf.iteye.com/blog/4 ... -
java synchronized详解
2011-04-22 17:00 841http://www.cnblogs.com/GnagWang ... -
Android 2.2中的APK安装参数installLocation
2011-04-16 13:04 2033在Android 2.2中新的特性可以支持类似APP2SD卡上 ... -
解决EditText在光标位置插入字符串,光标不会往后挪动的方法
2011-04-13 16:06 1704EditText editor = (Ed ... -
activity事件对应的生命周期
2011-04-12 16:05 1574启动应用 onCreate onStart ... -
Android放大镜的实现
2011-04-12 12:54 1072http://www.eoeandroid.com/threa ... -
Android应用程序级的变量
2011-04-12 12:52 1026Android 应用程序开发中,有的时候我们在应用程序 ... -
介绍一个fanqiang软件,很好用,youtube都很流畅
2011-04-07 23:09 267www.tbsvpn.com -
Android软件权限知识普及
2011-04-07 09:11 1139随着Android日趋红火,其用户 数也节节上升,同时 ... -
Android屏幕的控制
2011-04-06 16:23 1084一、AndroidManifest.xml对Activity屏 ... -
关于工程会丢失R文件的问题
2011-03-31 09:16 1218工程会丢失R文件的问题,一个可能的原因:资料文件命名不正确,例 ... -
关于layout_weight
2011-03-30 11:32 866layout_weight 用于给一个线性布局中的诸多视图的重 ...
相关推荐
Android 常用的Intent的URI及示例 很全很强大
常用的Uri大全,对于Android开发人员来说很有用。
主要介绍了Android Intent调用 Uri的方法总结的相关资料,这里整理了Android Intent 调用Uri的常用方法,需要的朋友可以参考下
android意图 以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent。
import android.net.Uri; import android.os.Build; /** * DownloadManagerPro * * <strong>Get download info * <li>{@link #getStatusById(long)} get download status * <li>{@link #getDownloadBytes...
getUri(long) 得到下载uri getReason(long) 得到下载失败或暂停原因 getPausedReason(long) 得到下载暂停原因 getErrorCode(long) 得到下载错误码 源码可见DownloadManagerPro.java,更多方法及更详细参数介绍可见...
4.4 Activity中的常用事件 53 4.4.1 触摸事件 53 4.4.2 键盘事件 55 4.5 菜单 57 4.5.1 文本菜单 57 4.5.2 图片文本菜单 59 本章小结 60 第5章 UI基础控件 61 5.1 按钮 61 5.1.1 Button 62 5.1.2 ...
android系统并不自带文件管理器,但是很多情况下,我们有诸如从SD中打开文件的需要,就必须借助三方开发的资源管理器,常用的有AndExplorer等。这种情况下发布后,用户还需要安装依赖的软件,非常麻烦。下面介绍在...
:rocket:适用于Android 4.4及以上系统,兼容AndroidQ新的存储策略 :rocket:图片压缩算法参考 :backhand_index_pointing_right: :rocket: Kotlin Sample :backhand_index_pointing_right: :rocket: Java Sample :...
本文汇集36个Android开发常用经典代码片段,包括拨打电话、发送短信、唤醒屏幕并解锁、是否有网络连接、动态显示或者是隐藏软键盘等,希望对您有所帮助。 //36个Android开发常用代码片段 //拨打电话 public static...
----------------------------------- Android 编程基础 1 封面----------------------------------- Android 编程基础 2 开放手机联盟 --Open --Open --Open --Open Handset Handset Handset Handset Alliance ...
1.3 Android常用开发工具的用法 10 1.3.1 创建、删除和浏览AVD 10 1.3.2 使用Android模拟器 (Emulator) 14 1.3.3 使用DDMS进行调试 15 1.3.4 Android Debug Bridge(ADB) 的用法 16 1.3.5 使用DX...
常用的Uri有: 联系人信息Uri:content://com.android.contacts/contacts 联系人电话Uri:content://com.android.contacts/data/phones 联系人邮件Uri:content://com.android.contacts/data/ema
15.2、Android的常用传感器:方向传感器Orientation; 磁场传感器Magnetic Field; 温度传感器Temperature; 光传感器Light; 压力传感器Pressure; 第16章、GPS应用开发 16.1、支持GPS的核心API: 16.2、获取...
15.2、Android的常用传感器:方向传感器Orientation; 磁场传感器Magnetic Field; 温度传感器Temperature; 光传感器Light; 压力传感器Pressure; 第16章、GPS应用开发 16.1、支持GPS的核心API: 16.2、获取...
4、巩固所学Java语言基本知识,增进Java语言编辑基本功,掌握JDK、Editplus、Ecli pse、JCreator等开发工具的运用,拓宽常用类库的应用。 二、实训任务 1、Activity的相关知识 简单理解Activity 代表一个用户所能...
1.3 Android常用开发工具的用法 10 1.3.1 创建、删除和浏览AVD 10 1.3.2 使用Android模拟器 (Emulator) 14 1.3.3 使用DDMS进行调试 15 1.3.4 Android Debug Bridge(ADB) 的用法 16 1.3.5 使用DX编译Android应用 ...