通过网页链接地址下载apk安装包
2013-05-20 12:36
344 查看
String url = "http://192.168.0.1:80/test/a.apk"
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
context.startActivity(intent );
如果是一个apk文件,打开并且安装的函数为
Java代码
private void openFile(File file) {
// TODO Auto-generated method stub
Log.e("OpenFile", file.getName());
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),
"application/vnd.android.package-archive");
startActivity(intent);
}
Uri uri = Uri.parse(url);
Intent intent = new Intent(Intent.ACTION_VIEW, uri);
context.startActivity(intent );
如果是一个apk文件,打开并且安装的函数为
Java代码
private void openFile(File file) {
// TODO Auto-generated method stub
Log.e("OpenFile", file.getName());
Intent intent = new Intent();
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
intent.setAction(android.content.Intent.ACTION_VIEW);
intent.setDataAndType(Uri.fromFile(file),
"application/vnd.android.package-archive");
startActivity(intent);
}
相关文章推荐
- 通过NotificationManager一键更新下载apk安装包
- Flash Activex NPAPI PPAPI 各种网页插件完整安装包下载地址
- iOS 网址、链接、网页地址、下载链接等正则验证
- Python 网络爬虫 009 (编程) 通过正则表达式来获取一个网页中的所有的URL链接,并下载这些URL链接的源代码
- Python 网络爬虫 009 (编程) 通过正则表达式来获取一个网页中的所有的URL链接,并下载这些URL链接的源代码
- 【.net】获取网页CDM的下载链接的地址
- android推广识别,根据下载地址识别区分推广人的id(在服务器上面动态解压,打包,签名apk)亲测通过,非常完整。
- 记录通过网页QQ音乐获取下载地址与歌词的全过程
- 006_安装配置 Android Studio(附安装包下载链接)
- 通过一个链接打开本地app,或者去下载app
- PHP读取指定URL网页地址中的所有链接
- html——使用mailto在网页中链接Email地址
- d语言-下载网页,通过正则抓取对应的数据
- Visual Studio 2010 RC 公共下载开放,开发者可以通过下面的地址下载
- android sdk下载链接地址
- CDH离线安装之安装包下载地址
- 移动设备wap手机网页html5通过特殊链接:打电话,发短信,发邮件详细教程
- 用户可以根据自己输入的地址下载网络上的图片和网页信息
- 静态页面中apk文件链接,被直接打开而不是下载