初学android,做一个天气预报的实现
天气预报的实现主要是通过google提供的接口,解析XML,显示
接口有两种途径:
1.http://www.google.com/ig/api?hl=zh-cn&weather=,,, + 城市CODE,如上海的是31399999,121470001
则天气预报接口为:
http://www.google.com/ig/api?hl=zh-cn&weather=,,,31399999,121470001
2.http://www.google.com/ig/api?hl=zh_cn&weather= + 城市名称,如要显示上海天气则为:
http://www.google.com/ig/api?hl=zh_cn&weather=上海
能过URL会得到当前天气和后四天预报天气,通过XML解析,得到图片、温度等值,变显示到自定的界面上即可。
下面将本人做的天气预报截图贴上:
主界面:
不带动画的天气截图
带动画的天气截图
动画透明设置:
<alpha android:fromAlpha="0.1" android:toAlpha="1.0" android:duration="3000" />
左移:
<translate android:repeatCount="-1" android:fromXDelta="-100" android:toXDelta="420" android:fromYDelta="50" android:toYDelta="50" android:duration="15000" />
右移:
<translate android:repeatCount="-1" android:fromXDelta="403" android:toXDelta="-83" android:fromYDelta="50" android:toYDelta="50" android:duration="10000" />
大致就是这样了。
23 楼 txin0814 2011-12-14
24 楼 txin0814 2011-12-14
25 楼 dotfeng 2011-12-14
26 楼 cqw4013 2011-12-17
楼主,给一份源代码看看吧,学习一下大牛们的程序,谢谢! 邮箱:[email protected]
27 楼 malong26 2011-12-17
求楼主给我传一份,谢谢.想学习动画特效那部分
[email protected]
[email protected]
28 楼 txin0814 2011-12-19
29 楼 txin0814 2011-12-19
30 楼 txin0814 2011-12-19
31 楼 malong26 2011-12-19
32 楼 txin0814 2011-12-20
33 楼 DarkWarlords 2012-03-17
楼主 求个源码呗,非常感谢![email protected]
34 楼 xiaoyun4 2012-03-21
楼主介意给我一份源码吗?多谢!
35 楼 xiaoyun4 2012-03-21
楼主麻烦你发一下源码![email protected]
36 楼 txin0814 2012-03-21
37 楼 leonshuang 2012-03-31
麻烦楼主给份源码 感谢感谢~!
[email protected]
[email protected]
38 楼 amaker.jzy 2012-04-09
能发一份源码吗?
39 楼 amaker.jzy 2012-04-09
40 楼 amaker.jzy 2012-04-09
楼主,发一份源码:[email protected]
41 楼 shannil 2012-04-25
楼主,求源码! [email protected]
42 楼 zd1201 2012-05-15
楼主: 源发份源码我吗? [email protected] 谢谢!