How to compile native C library and daemon using ?

To compile any c library inside android, we need to write an makefile, for reference please check below,

$ mkdir external/mysource
$ cd external/mysource

In below makefile we assume, you have a C library code in library_source.c file and application using this c library in main.c

$ vim

To compile as Shared Library,

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := library_source.c

LOCAL_MODULE := libmylib
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils libm

To compile as executable, using above shared library ( append to above )

include $(CLEAR_VARS)
LOCAL_MODULE := main-exececutable
LOCAL_SYSTEM_SHARED_LIBRARIES := libc libcutils libm

Change red color as per your library, source,

To compile, above source, type from top android source ” make libmylib” i.e. whatever name you have given in LOCAL_MODULE.

Simple CRUD in Vue.JS Web Applicati... x
Simple CRUD in Vue.JS Web Application | Vue.JS Projects with Source Code

Leave a Comment

Sign up to our newsletter!

ADB Commands Android Android Applications Android Build system Application Libraries Application Stack / User Interface Bash / Shell Scripts Bluetooth driver Cloud Technologies Commands and Packages Compilation Content Management System Core Kernel C Programs Development, Debugging and Performance Tools Development and Build Development Environment Setup Django & REST Api Errors & Failures Git Hardware Platforms HTML JAVA Programs Linux, OS Concepts and Networking Linux Device Drivers Linux Host, Ubuntu, SysAdmin Linux Kernel Linux Networking Middleware Libraries, HAL Multimedia NDK / Middleware / HAL Operating System Concepts PHP Programming Languages Scripting and Automation Search Engine Optimisation ( SEO ) Social Media Source Code Management ( SCM ) System Administration, Security Testing and Debugging Uncategorized Web Design and Development Website Hosting Wordpress Yocto Embedded Linux