摘要: AppWidget1.声明AppWIdget的布局文件。2.声明AppWidget的元数据文件3,声明Appwidget的控制器,该类继承子AppWidgetProvider4.在manefast文件中注册<receiver android:name=“com.example.android_day 阅读全文
posted @ 2016-03-06 23:44 gentspy 阅读(137) 评论(0) 推荐(0) 编辑
摘要: 1.构建PendingIntent Intent intent=new Intent(context,Activity.class); PendingIntent pendingIntent=PendingIntent.getActivity(intent); 2.给Notification对象设置 阅读全文
posted @ 2016-03-06 23:24 gentspy 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 1,如何获取notifycation NotificationManager manager=context.getSystemService(NOTIFICATION_SERVICE);2.构建notification实例Notification.Builder().setxxx().setxxx 阅读全文
posted @ 2016-03-06 20:53 gentspy 阅读(359) 评论(0) 推荐(0) 编辑
摘要: 音乐播放器网络版的客户端:客户端:com.tarena.musicClientactivity 存放ActivityMainActiivtyonCreate(){//加载音乐列表new MusicBiz().execute();}biz 存放业务类MusicBiz extends AsyncTask 阅读全文
posted @ 2016-03-06 19:31 gentspy 阅读(120) 评论(0) 推荐(0) 编辑
摘要: JSONArray//JSON数组String str=[{"name":"zs"},"hello",true,["c","h"]];JSONArray ary=new JSONArray(str);ary.length();ary.getJSONObject(0).getString("name" 阅读全文
posted @ 2016-03-06 17:45 gentspy 阅读(211) 评论(0) 推荐(0) 编辑
摘要: JSON 轻量级的数据交换语言JSON:{“name”:“zs”,"age":20,"gender":"m","aihao":["0","a","."],"married":false,"school":{”name":"tarena","loc":"bj"}}; String str={“name 阅读全文
posted @ 2016-03-06 17:44 gentspy 阅读(152) 评论(0) 推荐(0) 编辑
摘要: GET与POST请求方法1.请求参数的存放位置 GET:请求资源路径后拼接 POST:存放在请求实体2.安全性3,是否适合传递中文GET: 不适合POST:较适合4,是否适合大数据提交 POST:适合 *发送GET请求//创建HttpClient对象HttpClient client=new Def 阅读全文
posted @ 2016-03-06 17:43 gentspy 阅读(271) 评论(0) 推荐(0) 编辑
摘要: Android中Context的学习理解Context是一个抽象基类,通过它getResuources.getAssets and start 其他组件(Activity,Service,broadCast,getSystemService),可以这样理解:Context提供了一个运行环境for A 阅读全文
posted @ 2016-03-06 17:42 gentspy 阅读(123) 评论(0) 推荐(0) 编辑
摘要: HTTp协议的请求格式1.RequestLine GET/day02/load.jsp HTTP/1.12.若干消息头 Header用于告诉服务端,客户端的状态及客户端传递的请求参数的状态。key:value3.请求实体 Entity 存储post请求时给服务端传递的参数 响应数据包:1 statu 阅读全文
posted @ 2016-03-06 17:41 gentspy 阅读(114) 评论(0) 推荐(0) 编辑
摘要: 群聊天室服务端:准备在线Socket列表:list<Socket>sockets;ServerSocket ss; while(ture){Socket s=ss.accept();sockets.add(s);new WorkThread(s).start();}WorkThread{for(in 阅读全文
posted @ 2016-03-06 17:40 gentspy 阅读(187) 评论(0) 推荐(0) 编辑
摘要: socket服务端处理多个客户端的请求:while(true){Socket s=ss.accept();new WorkThread(s).start();}class WorkThread edtends Thread{private Socket s;public WorkThread(Soc 阅读全文
posted @ 2016-03-06 17:39 gentspy 阅读(373) 评论(0) 推荐(0) 编辑