How to compile libpomelo for Android
This is a tutorial on how to compile libpomelo for Android on Windows 7 (libpomelo is a C language client SDK for Pomelo).
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
5. Left click on this new folder and select New->File
name it Android.mk and paste this into
1 2 3 4 5 6 7 8 9 10 |
LOCAL_PATH := $(call my-dir) include $(CLEAR_VARS) LOCAL_MODULE := libpomelo_shared LOCAL_MODULE_FILENAME := libpomelo LOCAL_WHOLE_STATIC_LIBRARIES := pomelo_static include $(BUILD_SHARED_LIBRARY) LOCAL_CFLAGS := -D__ANDROID__ $(call import-module,libpomelo) |
6. Repeat step 5. and create a file in the same jni folder called Application.mk and fill it with
1 2 3 |
APP_ABI := armeabi armeabi-v7a x86 |
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
1 2 3 |
git clone https://github.com/NetEase/libpomelo.git |
8. Back in Eclipse with a Refresh on the pomelo folder should update your directory and file structure like this
9. navigate with a terminal to your root project folder and type
1 2 3 |
C:\Android\android-ndk-r10c\ndk-build NDK_MODULE_PATH=./pomelo/ |
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.
No comments yet.
Leave a comment
About Dennis D. Spreen
Search
Recent Posts
- How to compile Lua 5.4.0 for Android as a dynamic library using Android Studio 4
- Please make inline vars usable for production – fix RSP-28892
- How to compile Lua 5.4.0 as a Mac OS X dynamic library
- How to compile Lua 5.4.0 for Linux as a shared library
- How to compile Lua 5.4.0 for Windows
- Daily Wage – a Spigot/Bukkit plugin that pays out a daily wage
- How to compile Lua 5.3.5 for Windows
- Better Collada exporter for Blender with custom properties
- MOS6502-delphi – a MOS 6502 CPU emulator for Delphi
- Pass a multidimensional array as a parameter (with a hidden caveat)
Categories
Tags
Archives
- May 2020
- March 2020
- June 2019
- March 2017
- August 2016
- July 2016
- June 2016
- January 2016
- September 2015
- February 2015
- January 2015
- October 2014
- September 2014
- August 2014
- May 2014
- March 2014
- February 2014
- November 2011
- June 2011
- February 2011
- March 2010
- September 2009
- August 2009
- July 2009
- May 2009
- March 2009
- February 2009
- January 2009
- November 2008
- October 2008
- February 2008
- June 2007
Delphi Feeds
- Delphi and AI[5]: Encoding a multi-line string January 19, 2025
- Code Snippet Collection v2.2.2 released January 19, 2025
- 30 pages d'applications Android disponibles sur Google Play pour les 30 ans de Delphi ? January 17, 2025
- [EN] Vectors & Features Extraction January 16, 2025
- Vectors & Features Extraction January 16, 2025
- Creating Excel Reports in .NET Core with EPPlus: A Comprehensive Guide January 15, 2025
- Dew Lab Studio 2025 Update R1 January 15, 2025
- TMS Academic program update for Delphi and C++ developers January 15, 2025
- Delphi sorcery: Introducing Spring.Benchmark – a port of Google benchmark January 14, 2025
- 30 présentations en ligne pour les 30 ans de Delphi January 14, 2025