摘要:JNI是Java本地接口(Java Native Interface)的简称。它定义了托管代码(用Java编程语言写的)与本地代码(用C/C++写的)交互的一种方式(译者注:这里的托管代码应该理 解成受Java运行时环境监管的代码)。它与厂商无关,支持从动态共享库中加载代码,虽然繁琐但有时是合理有效的。你应该通读JNI spec for J2SE 6来获取对JNI是如何工作的以及它有什么可用的功能的一个认知。在你读第一遍的时候可能对JNI的某些方面的理解不会立刻就清晰,所以你会发现一下的章节可能会对你有所帮助。JNI Programmer's Guide and Specificati
阅读全文
摘要:Opcode (hex)Opcode nameExplanationExample00nopNo operation0000 - nop01move vx,vyMoves the content of vy into vx. Both registers must be in the first 256 register range.0110 - move v0, v1 Moves v1 into v0. 02move/from16 vx,vyMoves the content of vy into vx. vy may be in the 64k register range while..
阅读全文
摘要:Service是在一段不定的时间运行在后台,不和用户交互应用组件。每个Service必须在manifest中 通过<service>来声明。可以通过contect.startservice和contect.bindserverice来启动。 Service和其他的应用组件一样,运行在进程的主线程中。这就是说如果service需要很多耗时或者阻塞的操作,需要在其子线程中实现。 service的两种模式(startService()/bindService()不是完全分离的): 本地服务 Local Service 用于应用程序内部。 它可以启动并运行,直至有人停止了它或它自己停止。在
阅读全文
摘要:[*]Java interface【转】We start by defining a Java class JNIExampleInterface, which will provide the interface to calling the native functions, defined in a native (C++) library. The native functions corresponding to Java functions will need to have matching call signatures (i.e. the count and types of
阅读全文