• 大小: 1.45MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-08-28
  • 语言: Java
  • 标签: android  

资源简介

使用android 自带的DownloadManager实现文件下载,兼容性强,代码简单

资源截图

代码片段和文件信息

package com.azhon.app;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
 * Instrumented test which will execute on an Android device.
 *
 * @see Testing documentation
 */
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
    @Test
    public void useAppContext() throws Exception {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals(“com.azhon.appupdate“ appContext.getPackageName());
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2018-08-25 03:34  AppUpdate-master\
     文件         152  2018-08-25 03:34  AppUpdate-master\.gitignore
     文件       11358  2018-08-25 03:34  AppUpdate-master\LICENSE
     文件        5998  2018-08-25 03:34  AppUpdate-master\README.md
     目录           0  2018-08-25 03:34  AppUpdate-master\apk\
     文件     1632075  2018-08-25 03:34  AppUpdate-master\apk\appupdate.apk
     目录           0  2018-08-25 03:34  AppUpdate-master\app\
     文件           7  2018-08-25 03:34  AppUpdate-master\app\.gitignore
     文件         951  2018-08-25 03:34  AppUpdate-master\app\build.gradle
     文件         751  2018-08-25 03:34  AppUpdate-master\app\proguard-rules.pro
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\java\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\java\com\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\java\com\azhon\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\java\com\azhon\app\
     文件         733  2018-08-25 03:34  AppUpdate-master\app\src\androidTest\java\com\azhon\app\ExampleInstrumentedTest.java
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\
     文件        1099  2018-08-25 03:34  AppUpdate-master\app\src\main\AndroidManifest.xml
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\java\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\java\com\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\java\com\azhon\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\java\com\azhon\app\
     文件        6393  2018-08-25 03:34  AppUpdate-master\app\src\main\java\com\azhon\app\MainActivity.java
     文件        2365  2018-08-25 03:34  AppUpdate-master\app\src\main\java\com\azhon\app\MyDownload.java
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\res\
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\res\layout\
     文件        1787  2018-08-25 03:34  AppUpdate-master\app\src\main\res\layout\activity_main.xml
     目录           0  2018-08-25 03:34  AppUpdate-master\app\src\main\res\mipmap-xxhdpi\
     文件       34101  2018-08-25 03:34  AppUpdate-master\app\src\main\res\mipmap-xxhdpi\ic_launcher.png
     文件       39138  2018-08-25 03:34  AppUpdate-master\app\src\main\res\mipmap-xxhdpi\ic_launcher_round.png
............此处省略78个文件信息

评论

共有 条评论