在Android中使用JNI笔记

为什么在Android中使用JNI

JNI是JAVA调用C的一个接口。在Android中使用JNI的原因很多:JNI调用C执行效率可能会提高、JNI的存在使得一些成熟的C库可以被JAVA程序调用。我这里使用JNI主要是和底层交互。JAVA可以调用C,C可以调用汇编,那么JAVA就没什么做不到的了。

Update kernel image and modules for Cubian

Update kernel image and modules for Cubian

You have a lot of reason to replace the kernel, if you are reading this article.

First, you should setup building environment. FYI, check this if you are going to employ cross compilation.

Compile the kernel and modules using:

make uImage
make modules
make install
make modules_install

However, the later two command won’t work well on Cubian/cubieboard. We should do something ourself. That’s not very difficult.

First, replace /boot/uImage with the new.

Then copy ‘*.ko’ files into /lib/moduels/<kernel-verion>/kernel. Make the directory just like it used to be, but with new modules. I did that this way:

cp -R <directorys' names> /lib/modules/<kernel-version>/kernel/
find not -name "*.ko" -exec rm {} \;

Reboot. That’s it!

BACK UP YOUR DATA BEFORE ACTION.

Android真机内核实验环境搭建的一种简便方法(俗称:单刷内核)

前面的文章中提出了如何在真机中安装自己编译内核的方法:编译内核得到zImage,再用Bootimg打包得到新的Boot.img,再zip打包成ROM最后刷机的.该方法是我和徐凌云(maxwellxxx)摸索出来的土路子,通过它我们熟悉了Android系统的结构.不过操作十分繁琐,不能满足高效实验的需要.另一方面该方法的弊端在于刷机时替换了整个系统,丢失了大量系统数据.今天发现一个新的更简便的实验方案,主要是结合fastboot工具单刷内核.(之前徐凌云就一直跟我提,我也没好好试试.所以真的需要经常接受新事物 :D)

开源工具的使用

1 MarkDown和GitHub的简介

1.1 MarkDown

MarkDown是一种标记语言,通常被用来作为开源图书、博客的写作工具。不同于Microsoft Word,MarkDown可以让写作者不用过多地去担心排版而集中精力去完成内容的写作,并且记号简洁明了,效果美观大方。