android天气预报app源码(包运行)

本实例讲解了一个天气预报的android项目, 项目只有前台,没有后台, 后台获取的天气预报数据取自网络上的一个服务, 本项目可以显示全国所有地理位置信息,选择省份后,可以选择相对应的市, 然后选择市下面的县和县级市, 最后显示县及市的天气状况  【点击下载实例】

项目对应的实例代码可以通过右侧【下载实例】按钮获取

开发工具: Android Studio 2.2.2

【项目包含内容】(见下图):   

【CoolWeather_New】          项目源代码

blob.png

【项目配置】

1. 将项目导入到 Android Studio 2.2.2

2.build.gradle

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

android {

    compileSdkVersion 25

    buildToolsVersion '25.0.2'

    defaultConfig {

        applicationId "com.coolweather.android"

        minSdkVersion 21

        targetSdkVersion 25

        versionCode 1

        versionName "1.1"

    }

    buildTypes {

        release {

            minifyEnabled false

            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'

        }

    }

    aaptOptions.cruncherEnabled = false

    aaptOptions.useNewCruncher = false

}

dependencies {

    compile fileTree(dir: 'libs', include: ['*.jar'])

    testCompile 'junit:junit:4.12'

    compile 'com.android.support:appcompat-v7:25.2.0'

    compile 'com.github.bumptech.glide:glide:3.7.0'

    compile 'org.litepal.android:core:1.3.2'

    compile 'com.squareup.okhttp3:okhttp:3.4.1'

    compile 'com.google.code.gson:gson:2.7'

}

3. gradle-wrapper.properties

1

2

3

4

5

distributionBase=GRADLE_USER_HOME

distributionPath=wrapper/dists

zipStoreBase=GRADLE_USER_HOME

zipStorePath=wrapper/dists

distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip

【项目运行效果】

blob.png  blob.png

猜你喜欢

转载自blog.csdn.net/weixin_42600182/article/details/81387195
今日推荐