第一个博客(我的收藏CSDN收藏)

按时间

按收藏关键字

按分类

1.JAVA基础
1.1 java基础io流——OutputStream和InputStream的故事(温故知新)
重点介绍了 write read的两种形式,并加入了BufferedOutputStream和BufferedInputStream,重写了copy file。
对应的链接
1.2 内存操作流ByteArrayOutputStream
ByteArrayOutputStream bos = new ByteArrayOutputStream();
// 写数据
for (int x = 0; x < 10; x++) {
bos.write((“hello” + x).getBytes());
}
byte[] bytes = bos.toByteArray();
内存操作流ByteArrayOutputStream,CharArrayWriter, StringWriter
2.下载文档
2.1 OKhttp 下载文件
安卓最简单的文件下载, 基于OkHttp,包含下载进度、断点续传
OkHttp官方教程解析-彻底入门OkHttp使用
问题点1:

    3.更新软件
   3.1 Android 轻松实现后台搭建+APP版本更新
   [地址](https://blog.csdn.net/u012422829/article/details/46355515)
   point1 :下载文件部分,采用了HttpClient,目前不太友好
   	void downFile(final String url) { 
   point2:SD卡存储-----目前不太友好
   	if (is != null) {
					File file = new File(
							Environment.getExternalStorageDirectory(),
							"Test.apk");
					fileOutputStream = new FileOutputStream(file);
	point3: 安装文件的固定写法,采用setDataAndType(Uri.fromFile,目前不太友好。
	//安装文件,一般固定写法
void update() {                    
	Intent intent = new Intent(Intent.ACTION_VIEW);
	intent.setDataAndType(Uri.fromFile(new File(Environment
			.getExternalStorageDirectory(), "Test.apk")),
			"application/vnd.android.package-archive");
	startActivity(intent);
}
安装文件,其他博客的建议为
[cnblogs的建议](https://www.cnblogs.com/kongxiaoshuang/p/5996358.html)
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);
     }

3.2 Android实现app内部自动检测版本更新、自动安装及数据库更新升级
https://blog.csdn.net/Nirvana_lss/article/details/89879571

按个人日记

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值