2014年2月12日
摘要: 在做项目的过程中,需要实现Activity非全屏显示、窗口背景透明显示的效果。在实现这些功能的过程中,涉及到Window与WindowManager两个类,经过查一些相关资料,了解二者之间的不同点如下所示:1)WindowManager继承自ViewManager这个接口,这个接口主要有以下的实现子接口: * addView(); * updateViewLayout(); * removeView(); 在WindowManager中,addView方法表示的是将主窗口中的顶级view(也就是DecorView)添加到WindowManager中,并建立会话。 WindowM... 阅读全文
posted @ 2014-02-12 17:52 meizixiong 阅读(15623) 评论(0) 推荐(0) 编辑
  2013年12月27日
摘要: 1.send 函数 int send( SOCKET s, const char FAR *buf, int len, int flags ); 不论是客户还是服务器应用程序都用send函数来向TCP连接的另一端发送数据。客户程序一般用send函数向服务器发送请求,而服务器则通常用send函数来向客户程序发送应答。 该函数的第一个参数指定发送端套接字描述符; 第二个参数指明一个存放应用程序要发送数据的缓冲区; 第三个参数指明实际要发送的数据的字节数; 第四个参数一般置0。 这里只描述同步Socket的send函数的执行流程。当调用该函数时, (1)send先比较待发送数据的长度... 阅读全文
posted @ 2013-12-27 18:43 meizixiong 阅读(476) 评论(0) 推荐(0) 编辑
  2013年10月25日
摘要: 本文讲述AndroidJava域与C域互操作:Java域调用c域的函数;c域访问Java域的属性和方法;c域生成的对象的保存与使用。重点讲解c域如何访问Java域。虽然AndroidJNI实现中,c实现与c++实现是有所区别的,但行文中并未区分c还是c++。0. Android中的JNIAndroid 的APP开发一般是用Java,用到的系统服务和操作系统相关的东西是用c写的。Java到c的访问,通过JNI(Java Native Interface),一般情况下的考虑是Java -> c,也有c -> Java的情形,这在Android中经常使用。1. Java域调用c域的函数通 阅读全文
posted @ 2013-10-25 17:58 meizixiong 阅读(316) 评论(0) 推荐(0) 编辑
  2013年10月13日
摘要: TheonInterceptTouchEvent()method gives a parent the chance to see any touch event before its children do. If you returntruefromonInterceptTouchEvent(), the child view that was previously handling touch events receives anACTION_CANCEL, and the events from that point forward are sent to the parent' 阅读全文
posted @ 2013-10-13 17:52 meizixiong 阅读(157) 评论(0) 推荐(0) 编辑
摘要: 1、关于on的返回值a return value oftruefrom the individualonmethods indicates that you have handled the touch event. A return value offalsepasses events down through the view stack until the touch has been successfully handled.true表示你已经处理了此touch事件,false则会将事件一直传到view栈,直到touch事件被处理。2、关于onDown()事件Whether or no 阅读全文
posted @ 2013-10-13 17:42 meizixiong 阅读(208) 评论(0) 推荐(0) 编辑
摘要: 定义schema: 1 public final class FeedReaderContract { 2 // To prevent someone from accidentally instantiating the contract class, 3 // give it an empty constructor. 4 public FeedReaderContract() {} 5 6 /* Inner class that defines the table contents */ 7 public static abstract clas... 阅读全文
posted @ 2013-10-13 13:16 meizixiong 阅读(303) 评论(0) 推荐(0) 编辑
摘要: 将数据保存在外部存储器上 1 /* Checks if external storage is available for read and write */ 2 public boolean isExternalStorageWritable() { 3 String state = Environment.getExternalStorageState(); 4 if (Environment.MEDIA_MOUNTED.equals(state)) { 5 return true; 6 } 7 return false; 8 } 9 10 ... 阅读全文
posted @ 2013-10-13 12:37 meizixiong 阅读(246) 评论(0) 推荐(0) 编辑
  2013年8月28日
摘要: Android系统本身提供了很多系统服务,如WindowManagerService,PowerManagerService等。下面描述一下添加一个系统服务的具体步骤。1、 撰写一个aidl文件,定义服务的接口,将在编译过程中通过aidl工具生成对应的java接口。一般系统服务的aidl文件都放在framework\base\core\java\android\os目录中。以我所写的IMyTool.aidl为例。在.aidl中定义自己需要加入的方法,编写规则和java接口差不多,这里不多说。2、 将aidl文件名添加到frameworks\base\目录下的Android.mk编译脚本文件中。 阅读全文
posted @ 2013-08-28 16:12 meizixiong 阅读(367) 评论(0) 推荐(0) 编辑
  2013年8月22日
摘要: Makefile的规则如下:target ... : prerequisites ...command ... ...target可以是一个目标文件,也可以是Object File(例如helloworld.obj),也可以是执行文件和标签。prerequisites就是生成target所需要的文件或是目标。command也就是要达到target这个目标所需要执行的命令。下面就是编译helloworld的makefile。helloworld : helloworld.o cc -o helloworld helloworld .ohelloworld.o : helloworld.c cc 阅读全文
posted @ 2013-08-22 22:45 meizixiong 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 一、有用的网址:https://forum.videolan.org/search.php二、只编译Java apk部分:source env.shmake distcleanmake -e编译全部:sh compile.sh见https://forum.videolan.org/viewtopic.php?f=35&t=108965&p=369068&hilit=compile+java#p369068三、启动vlc:Intent in = new Intent(Intent.ACTION_VIEW, Uri.parse("udp://@10.11.11.1 阅读全文
posted @ 2013-08-22 19:57 meizixiong 阅读(275) 评论(0) 推荐(0) 编辑