安卓之新建弹窗并对弹窗中的选项添加监听事件
摘要:new AlertDialog.Builder(this) .setTitle(R.string.config_url) .setItems(new CharSequence[]{ getString(R.string.config_url_scan), getString(R.string.config_url_manual) }, new ...
阅读全文
二项式定理
摘要:其中, ,又有 等记法,称为二项式系数,此系数亦可表示为杨辉三角形。等式 的右边 即为 的展开式,称为二项展开式。 其中, ,又有 等记法,称为二项式系数,此系数亦可表示为杨辉三角形。等式 的右边 即为 的展开式,称为二项展开式。
阅读全文
算术-几何平均不等式
摘要:设x1,x2,...,xn均为正数,则它们的算术平均值不小于它们的几何平均 值,即: ,当且仅当x1=x2=x3=..=xn 时等号成立
阅读全文
淘淘商城之httpclient
摘要:一、什么是httpclient HTTP 协议可能是现在 Internet 上使用得最多、最重要的协议了,越来越多的 Java 应用程序需要直接通过 HTTP 协议 来访问网络资源;虽然在 JDK 的 java net包中已经提供了访问 HTTP 协议的基本功能,但是对于大部分应用程序来说, JDK
阅读全文
安卓之图像视图ImageView
摘要:一、有关属性说明 (1)scaleType:指定图形的拉伸类型,默认是fitCenter;拉伸类型的取值如下: (2)src:指定图形来源,src图形按照scaleType拉伸;背景图不按scaleType指定的方式拉伸,背景默认以fitXY方式拉伸 二、在代码中调用ImageView的方法 (1)
阅读全文
安卓之button按钮
摘要:一、需求 短按按钮时显示 您点击了控件:Button 长按按钮时显示 您点击了控件:Button 二、布局xml文件 三、java代码文件
阅读全文
安卓之直播间效果
摘要:一、需求 窗口的高度是固定的,新的文字消息总是加入窗口末尾,同时窗口内部的文本整体向上滚动,窗口的大小、位置固定不变 二、用到的属性与方法说明 三、布局xml文件 四、shape.xml文件 五、java代码 六、DateUtil类
阅读全文
安卓之文本视图TextView及跑马灯效果
摘要:一、基本属性和设置方法 二、跑马灯用到的属性与方法说明 三、省略方式的取值说明 四、跑马灯效果案例代码 (1)布局xml文件 (2)java代码
阅读全文
安卓之滚动视图ScrollView
摘要:(1)垂直方向滚动时,layout_width要设置为match_parent,layout_height要设置为wrap_content (2)水平方向滚动时,layout_width要设置为wrap_content,layout_height要设置为match_parent (3)滚动视图节点下
阅读全文
安卓之线性布局LinearLayout
摘要:一、xml属性 (1)orientation:指定线性布局的方向 (2)gravity:指定布局内部视图与本线性布局的对齐方式 (3)layout_weight:指定当前视图的宽或高占上级线性布局的权重 二、在代码中增加LinearLayout的方法 (1)setOrientation:设置线性布局
阅读全文
安卓之视图View的基本属性
摘要:一、在xml布局文件中常用的属性定义 (1) id:指定该视图的编号 (2) layout_width:指定该视图的宽度可以是具体的dp值;可以是match_parent,表示与上级视图一样宽;可以是wrap_content,表示与内部内容一样宽 (3) layout_height:指定该视图的高度
阅读全文
安卓之颜色
摘要:一、透明度和三原色 (1)在android中,颜色值由透明度alpha和RGB(红、绿、蓝)三原色定义,有八位十六进制数与六位十六位进制数两种编码 (2)八位十六进制,例如:FFEEDDCC,FF表示透明度,EE表示红色的浓度,DD表示绿色的浓度,CC表示蓝色的浓度 二、系统已定义的颜色常量 三、获
阅读全文
安卓之屏幕显示
摘要:一、像素 (1)android支持的像素单位有:px(像素)、in(英寸)、mm(毫米)、pt(磅,1/72英寸)、dp(与设备无关的显示 单位)、dip(即dp)、sp(用于设置字体大小),常用的单位有px、dp和sp三种 (2)px是手机屏幕上可显示的最小单位,一般同样屏幕的手机看起来更清晰说明
阅读全文
sockfd_to_family函数
摘要:#include #include #define SA struct sockaddr int sockfd_to_family(int sockfd) { struct sockaddr_storage ss; socklen_t len; len = sizeof(ss); if (getsockname(sockf...
阅读全文
family_to_level函数
摘要:#include #include int family_to_level(int family) { switch (family) { case AF_INET: { return (IPPROTO_IP); } #ifdef IPV6 case AF_INET6: { ...
阅读全文
mcast_get_ttl函数
摘要:#include #include #include #include int sockfd_to_family(int); int mcast_get_ttl(int sockfd) { switch (sockfd_to_family(sockfd)) { case AF_INET: { u_char ...
阅读全文
mcast_get_loop函数
摘要:#include #include #include #include int sockfd_to_family(int); int mcast_get_loop(int sockfd) { switch (sockfd_to_family(sockfd)) { case AF_INET: { u_char ...
阅读全文
mcast_set_ttl函数
摘要:#include #include #include #include int sockfd_to_family(int); int mcast_set_ttl(int sockfd, int val) { switch (sockfd_to_family(sockfd)) { case AF_INET: { u...
阅读全文
mcast_set_loop函数
摘要:#include #include #include #include int sockfd_to_family(int); int mcast_set_loop(int sockfd, int onoff) { switch (sockfd_to_family(sockfd)) { case AF_INET: { ...
阅读全文
mcast_set_if函数
摘要:#include #include #include #include #include #include int sockfd_to_family(int); int mcast_set_if(int sockfd, const char *ifname, u_int ifindex) { switch (sockfd_to_fami...
阅读全文
mcast_get_if函数
摘要:#include int sockfd_to_family(int); int mcast_get_if(int sockfd) { switch (sockfd_to_family(sockfd)) { case AF_INET: { /* TODO: similar to mcast_set_if() */ retu...
阅读全文
mcast_block_source函数
摘要:#include #include #define SA struct sockaddr int mcast_block_source(int sockfd, const SA *src, socklen_t srclen,const SA *grp, socklen_t grplen) { #ifdef MCAST_BLOCK_SOURCE ...
阅读全文
mcast_unblock_source函数
摘要:#include #include #define SA struct sockaddr int mcast_unblock_source(int sockfd, const SA *src, socklen_t srclen,const SA *grp, socklen_t grplen) { #ifdef MCAST_UNBLOCK_SOURCE ...
阅读全文
mcast_join_source_group函数
摘要:#include #include #include #define SA struct sockaddr int mcast_join_source_group(int sockfd, const SA *src, socklen_t srclen,const SA *grp, socklen_t grplen, const char...
阅读全文
mcast_join函数
摘要:#include #include #include #include #define SA struct sockaddr int family_to_level(int); int mcast_join(int sockfd, const SA *grp, socklen_t grplen, const char *ifnam...
阅读全文