这是根据youtube上的教学视频编写的天气app,教学视频有几处bug,自己调整了几处代码,视频地址:https://www.youtube.com/watch?v=CmUxsupaBdk&list=PLZsd_1glHoeRaq5zGzBHbRa_ktWH9NwcN&index=74
代码地址:https://github.com/jowang2016/weatherapp20160728
程序准备:
manifest:
<uses-permission android:name="android.permission.INTERNET"/>
build.gradle:dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:24.1.0' compile group: 'cz.msebera.android' , name: 'httpclient', version: '4.4.1.1' }加入httpclient依赖是十分必要的,以便程序使用httpget等方法,这个在教学视频中没有提及。