If you have followed the previous post on this tutorial series, you now have a Python interpreter embedded in your Android application. Before we move on to fix the Python standard library, in this post we are going to set up some code to allow “prints” inside Python to be redirected to the Android logcat. The source code is adapted from the bootstrap code for python-for-android.
In the previous post, i have shown how to create an Android application which uses the Java Native Interface to interface with C/C++ code. Specifically, we have created a Java class which exports a native “square(int)” method which returns the square of a number computed in native code. In this post, I will show how to do something similar, but using an embedded Python interpreter to do the calculations. Since we are going to use CPython, the official Python interpreter in C, we must use JNI again to interface with it.
In this tutorial I will show how to write an Android application which uses the Java Native Interface to access native code in C/C++. This will be useful later because we will access our Python interpreter from Java through JNI and C/C++. Our application will be able to compute the square of a number in C/C++ and print it on the Android log. I will assume that the readers know the basic structure of an Android application source code layout, have access to an Android device or simulator, and to its log (logcat).
In the last months I have been implementing a Python library for a cross-platform application of mine. I’ve chose Python for many reasons: it is cross-platform, allows for fast development, has very concise code and great standard library, has many extensions, it is quite popular, and allows to interface with C/C++ using projects such as Cython. Cython lets you write extensions in C/C++ or interface with existing C/C++ libraries in a relatively easy way. Read the rest of this entry »
Yesterday I’ve published a post on how to install Mac OS X – Snow Leopard - in Virtualbox 4.2 using external boot loaders. Unfortunately that method causes a lot of kernel panics and is not reliable because sometimes it boots successfully, sometimes it does not. In this post I will show another way of installing Snow Leopard in Virtualbox, but using the EFI method. With this method your Mac OS virtual machine will be more reliable, and you will be able to do basic things from the Operating System such as reboots, shutdowns and the simple “About my Mac”. The only downside so far is that it seems you won’t be able to set screen resolutions outside of 640×480, 800×600, 1024×768, 1280×1024 and 1440×900.
In CM9, device’s kernels source code should be integrated with CM9′s source code. So, if you have the CM9 source code, you probably have a kernel/ folder with the source code.
Imagine you need to check if some device driver is activated on the kernel. Basically, you need to check it in the kernel build configuration file, but where is it? Read the rest of this entry »
When uploading patches:
If you get something like:
Permission denied (publickey).
fatal: The remote end hung up unexpectedly
make sure your .gitconfig has the correct username, like:
username = xxxxx
Your review.cyanogenmod.org username may be different of you firstname.lastname@example.org, so check your Profile..
Edit: Changed from cyanogenmod.com to cyanogenmod.org (since cyanogenmod is now hosted at a .org domain)