随笔- 40  文章- 0  评论- 23 
10 2011 档案
Andriod: 在xml布局中使用自定义属性
摘要: 今天在看android froyo的launcher2 源码的时候,在launcher.xml中看到有这么一段代码: <com.android.launcher2.DragLayer xmlns:android="http://schemas.android.com/apk/res/android" xmlns:launcher="http://schemas.android.com...阅读全文
posted @ 2011-10-27 23:36 Braincol 阅读(490) | 评论 (1) 编辑
DHCP之简要分析及问题解决
摘要: DHCP 主要有四个过程: discover、offer、request、ack。 step 1:客户端(PC机或移动终端)以广播包的形式,找寻可以提供分配ip的服务器或路由器,这即为discover阶段。 step 2:所有收到这个discover广播包,并且可以有分配IP功能的服务器或路由器,会回应这个广播包;发包的方式可能是广播报文,也可能是 单播报文 (这因路由器的不同而可能不同)。这即...阅读全文
posted @ 2011-10-26 11:43 Braincol 阅读(177) | 评论 (1) 编辑
Android: 在WebView中获取网页源码
摘要: 1. 使能javascript: webView.getSettings().setJavaScriptEnabled(true);2. 编写本地接口final class InJavaScriptLocalObj { public void showSource(String html) { Log.d("HTML", html); }} 3. 向网页暴露本...阅读全文
posted @ 2011-10-26 10:43 Braincol 阅读(1730) | 评论 (1) 编辑
libcurl在android下的移植、编译与测试
摘要: 由于项目需要在NDK中使用网络开发,对于c语言网络开发来说,libcurl库是个很不错的选择,但android系统中并没有自带该库,所以就得自己移植了。 下面是移植步骤: 1. 下载curl源码 我这里下载的是curl-7.22.0,源码下载地址为:http://curl.haxx.se/download.html 2. 准备android源码编译环境, android源...阅读全文
posted @ 2011-10-15 23:53 Braincol 阅读(838) | 评论 (0) 编辑
正则表达式pcre在Android下的移植
摘要: 因为项目需要在android的NDK开发中使用pcre正则表达式库,而android系统中并没有自带该库,所以就得另外移植了, 下面是移植的详细步骤: 1. 下载pcre源码,可以到http://sourceforge.net/projects/pcre/下载源码。 我这里使用的是pcre-7.8.tar.gz 。 2. 将pcre-7.8 的源码拷贝至android源码树...阅读全文
posted @ 2011-10-15 22:24 Braincol 阅读(277) | 评论 (0) 编辑
字符串列表的C语言实现:c_strlist
摘要: 前两天需要用到字符串数组,需要动态的增加和减少,类似于java里的ArrayList<String>提供的功能,但C里又没有现成的库和函数,所以就自己动手写了一个。 废话也不多说了,可能会有朋友需要,所以这里直接把代码贴出来: #include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct{ unsigned ...阅读全文
posted @ 2011-10-15 14:19 Braincol 阅读(194) | 评论 (0) 编辑