摘要: AndroidManiFest加入的权限 需注册service组件需注册广播接收者 BootReceiver 中实现onReceive方法 收到广播启动服务public class... 阅读全文
posted @ 2015-05-04 15:15 尾巴草 阅读(263) 评论(0) 推荐(0) 编辑
摘要: Problems:Write a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For example, the ... 阅读全文
posted @ 2015-04-27 20:11 尾巴草 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 1 public class MainActivity extends Activity implements OnClickListener { 2 3 private static final String TAG = "MainActivity"; 4 protec... 阅读全文
posted @ 2015-04-24 11:06 尾巴草 阅读(209) 评论(0) 推荐(0) 编辑
摘要: 1 package com.example.contentobserverdemo; 2 3 import android.app.Activity; 4 import android.app.ActionBar; 5 import android.app.Fragment; 6 import ... 阅读全文
posted @ 2015-04-22 15:57 尾巴草 阅读(462) 评论(0) 推荐(0) 编辑
摘要: public void backupSms(View v) { // 1. 查出所有的短信 Uri uri = Uri.parse("content://sms/"); ContentResolver resolver = getContentResolver(); Cursor cur... 阅读全文
posted @ 2015-04-22 14:23 尾巴草 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 1 public class Test extends TestCase { 2 3 public void test() throws IllegalStateException, RuntimeException, IOException { 4 writeX... 阅读全文
posted @ 2015-04-15 17:12 尾巴草 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 网络编程1.TCP/UDP特点1.TCP1.面向连接(流式套接字SOCK_STREAM)2.数据完整安全,可靠,有序PS:数据完整不丢失,有序,数据完整采用CRC循环冗余校验,数据不丢失采用重传机制和超时机制,有序的发送端的拆分编号,接收端排序组合。若在某一段时间内接收端到的为两个一样的数据,则选择... 阅读全文
posted @ 2014-06-16 16:19 尾巴草 阅读(186) 评论(0) 推荐(0) 编辑
摘要: echoserver_select.c 1 #include 2 3 #define BACKLOG 10 4 #define PORT 8080 5 #define MAXCLIENT 20 6 #define LEN_BUF 255 7 8 fd_set grset; 9... 阅读全文
posted @ 2014-06-16 16:10 尾巴草 阅读(256) 评论(0) 推荐(0) 编辑
摘要: 三、组播模型muticast.c 1 #include 2 3 #define PORT 8088 4 5 #define MULTIIP "225.0.0.1" 6 7 int main(int argc,char **argv) 8 { 9 if(argc!=2)10 {... 阅读全文
posted @ 2014-06-16 16:04 尾巴草 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 广播模型broadcast.c 1 #include 2 3 #define PORT 8088 4 5 int main(int argc,char **argv) 6 { 7 if(argc!=2) 8 { 9 printf("%s \n",argv[0])... 阅读全文
posted @ 2014-06-16 16:02 尾巴草 阅读(137) 评论(0) 推荐(0) 编辑