摘要:
AndroidManiFest加入的权限 需注册service组件需注册广播接收者 BootReceiver 中实现onReceive方法 收到广播启动服务public class... 阅读全文
摘要:
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 ... 阅读全文
摘要:
1 public class MainActivity extends Activity implements OnClickListener { 2 3 private static final String TAG = "MainActivity"; 4 protec... 阅读全文
摘要:
1 package com.example.contentobserverdemo; 2 3 import android.app.Activity; 4 import android.app.ActionBar; 5 import android.app.Fragment; 6 import ... 阅读全文
摘要:
public void backupSms(View v) { // 1. 查出所有的短信 Uri uri = Uri.parse("content://sms/"); ContentResolver resolver = getContentResolver(); Cursor cur... 阅读全文
摘要:
1 public class Test extends TestCase { 2 3 public void test() throws IllegalStateException, RuntimeException, IOException { 4 writeX... 阅读全文
摘要:
网络编程1.TCP/UDP特点1.TCP1.面向连接(流式套接字SOCK_STREAM)2.数据完整安全,可靠,有序PS:数据完整不丢失,有序,数据完整采用CRC循环冗余校验,数据不丢失采用重传机制和超时机制,有序的发送端的拆分编号,接收端排序组合。若在某一段时间内接收端到的为两个一样的数据,则选择... 阅读全文
摘要:
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... 阅读全文
摘要:
三、组播模型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 {... 阅读全文
摘要:
广播模型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])... 阅读全文