- 博客(7)
- 收藏
- 关注
原创 android 生命周期 通过代码验证
本文章主要讨论android生命周期中,几个重要函数的调用场景。这几个重要函数为:onStartonRestartonResumeonCreateonStoponDestroyonPause直接上部分代码:@Override protected void onStart() { // TODO Auto-generated method
2014-02-16 23:55:20 738
原创 linux c 获取一个文件or目录的绝对路径
用realpath函数可以实现:char *realpath(const char *src,char *out);src是一个相对目录or绝对目录,绝对路径会写入out,返回值也是out的指针。很简单,直接替代码:#include #include #include int main(){ char *path=
2014-02-10 12:49:09 1694
原创 protobuf使用方法(c++为例)
protobuf使用方法(c++为例)1. 定义数据结构;2. 实现数据结构与byte的相互转换;首先解释下为何一个数据结构要平白无故的转换成byte:因为网络上传输的都是二进制,所以要实现数据结构和byte的相互转换;一般流程是:发送方:数据结构->byte 将byte发送;接收方:接收byte,转换:byte->数据结构下面
2014-01-29 20:35:15 2263
原创 protobuf_实现rpc的初步原理
背景:google的protobuf确实给力,解决了大部分网络传输数据的问题;protobuf的下载页:http://code.google.com/p/protobuf/简单地说,任何的结构体数据都可以用protobuf转化为字节序列,从而可以在网络通信中传播。对于rpc,protobuf的源码中仅仅给出了实现的架构,却没有给出实现方案...为此无数开源大
2013-12-28 21:26:14 1297
原创 linux c socket client与server实例代码
这是最典型的client server通信代码,网上实例很多,但大部分无法编译通过(囧)#include #include #include #include #include #include #include #include int main(){ int server_fp=socket(AF_INET, SOCK_STREAM, 0);
2013-12-22 23:21:56 630
原创 java_遍历map类型的容器
遍历容器是个很常见的操作。java的map遍历实例如下:import java.util.HashMap;import java.util.Iterator;import java.util.Map;import java.util.Map.Entry;public class ClientMain { public static void main(String[]
2013-12-21 22:26:12 362
转载 /*for android*/ 关于数字音视频的介绍的链接
http://blog.csdn.net/zjc0888/article/category/801374 //android的音视频处理的知识 http://3xin2yi.info/wwwroot/tech/doku.php/tech:multimedia:digital_media //数字媒体技术介绍 http://3xin2yi.info/wwwroot
2013-01-09 15:30:28 289
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人