• 大小: 200KB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2021-05-13
  • 语言: Java
  • 标签: weathe  

资源简介

最近买了本书《Android第一行代码》,通篇看了下感觉不错,书本最后有个实战项目酷欧天气,闲来无事就照着敲了一遍代码,主要在请求天气接口和背景优化做了些小改动,现在来记录下。

资源截图

代码片段和文件信息

package com.example.coolweather;

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() {
        // Context of the app under test.
        Context appContext = InstrumentationRegistry.getTargetContext();

        assertEquals(“com.example.coolweather“ appContext.getPackageName());
    }
}

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     目录           0  2019-02-23 04:02  coolweather-master\
     文件        1002  2019-02-23 04:02  coolweather-master\.gitignore
     目录           0  2019-02-23 04:02  coolweather-master\.idea\
     目录           0  2019-02-23 04:02  coolweather-master\.idea\codestyles\
     文件        1775  2019-02-23 04:02  coolweather-master\.idea\codestyles\Project.xml
     文件        2101  2019-02-23 04:02  coolweather-master\.idea\misc.xml
     文件         359  2019-02-23 04:02  coolweather-master\.idea\modules.xml
     文件         564  2019-02-23 04:02  coolweather-master\.idea\runConfigurations.xml
     文件         180  2019-02-23 04:02  coolweather-master\.idea\vcs.xml
     文件       11357  2019-02-23 04:02  coolweather-master\LICENSE
     文件          13  2019-02-23 04:02  coolweather-master\README.md
     目录           0  2019-02-23 04:02  coolweather-master\app\
     文件           7  2019-02-23 04:02  coolweather-master\app\.gitignore
     文件        1273  2019-02-23 04:02  coolweather-master\app\build.gradle
     文件         751  2019-02-23 04:02  coolweather-master\app\proguard-rules.pro
     目录           0  2019-02-23 04:02  coolweather-master\app\src\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\androidTest\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\androidTest\java\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\androidTest\java\com\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\androidTest\java\com\example\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\androidTest\java\com\example\coolweather\
     文件         730  2019-02-23 04:02  coolweather-master\app\src\androidTest\java\com\example\coolweather\ExampleInstrumentedTest.java
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\
     文件        1083  2019-02-23 04:02  coolweather-master\app\src\main\AndroidManifest.xml
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\assets\
     文件         443  2019-02-23 04:02  coolweather-master\app\src\main\assets\litepal.xml
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\java\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\java\com\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\java\com\example\
     目录           0  2019-02-23 04:02  coolweather-master\app\src\main\java\com\example\coolweather\
     文件       10903  2019-02-23 04:02  coolweather-master\app\src\main\java\com\example\coolweather\ChooseAreaFragment.java
............此处省略74个文件信息

评论

共有 条评论