How to compile libpomelo for Android

Thursday, October 23rd, 2014 | Dennis D. Spreen | Android, Pomelo

This is a tutorial on how to compile libpomelo for Android on Windows 7 (libpomelo is a C language client SDK for Pomelo).

This tutorial is based on the Pomelo Club post http://nodejs.netease.com/topic/51752189b5a2705b5a102a2e with some optimizations (no cygwin needed).

1. download and extract Eclipse ADT with the Android SDK for Windows (with a single download, the Eclipse ADT bundle includes everything you need) to C:\Android\adt-bundle-windows-x86-20140702\, then download and extract the current Android NDK for Windows to C:\Android\android-ndk-r10c\ – if not yet done (use your paths accordingly if installed in other directories).

2. download and install git, select Use Git from the Windows Command Prompt during installation

3. run Eclipse ADT (C:\Android\adt-bundle-windows-x86-20140702\eclipse\eclipse.exe) and create a new project with File->New->Android Application Project, fill in some Application, project and package names, use the blank activity template (leave default workspace setting as C:\users\%yourusername%\workspace)

4. Left click on your project then select New -> Folder and choose jni as the folder name

eclipse1



5. Left click on this new folder and select New->File

eclipse2


name it Android.mk and paste this into

6. Repeat step 5. and create a file in the same jni folder called Application.mk and fill it with

By default, the NDK build system will generate machine code only for the armeabi ABI. This corresponds to an ARMv5TE based CPU with software floating point operations. You can use APP_ABI to select a different ABI – the above APP_ABI definition creates 3 libraries with support for a ARMv5TE CPU, a ARMv7 with hardware FPU instructions and x86 devices.

7. Add a new folder as written in step 4., call it pomelo, open a terminal, navigate to this folder (e.g. C:\users\dennis\workspace\Test\pomelo\) and clone the libpomelo source into

8. Back in Eclipse with a Refresh on the pomelo folder should update your directory and file structure like this

libpomelo-eclipse-3


9. navigate with a terminal to your root project folder and type

to compile libpomelo for Android.

10. After a successful compilation you’ll find the libpomelo.so libraries in the appropriate folder in the libs\ folder.

 

Tags: ,

No comments yet.

Leave a comment

About Dennis D. Spreen

I'm an avid programmer working on a variety of platforms in a variety of languages with a wide technical interest.

Search

QR Code

Categories