购物APP项目开发(2)——热销商品的展示
2016-06-13 本文已影响504人
leeqico
一、搭建服务端:
1.下载tomcat服务器
2.eclipse集成tomcat才可以将项目部署到tomcat才可以开发web系统
3.导入fk_ec系统(服务端系统)
4.准备数据库环境和脚本(mysql)
5.配置服务器系统的数据库连接!
jdbc.properties 配置正确的数据库地址和用户名密码!
driver=com.mysql.jdbc.Driver
url=jdbc:mysql:// localhost:3307/ec_db
username= root
password= 123456
注:这是我的服务器配置,一般你们的端口号是3306
二、使用网格容器 GridView(在fragment_home.xml中)

三、使用适配器BaseAdapter(HotActivityAdapter.java)

四、界面布局的设计(layout_hot_article_gv_item.xml)

五、4.注意适配手机的分辨率(将当前的图片进行缩放:缩放成手机宽度的1/3 )

六、安卓的通信请求需要满足两个条件:
1.配置上网权限

2.网络操作必须放在子线程中。




效果图如下:(广告轮播下篇文章会介绍)
