user3788055
user3788055

Reputation:

use prebuild libcurl.a with my android project

I have libcurl.a compiled for armeabi, armeabi-v7a and x86. I want to include it in my android project and successfully execute this simple code, The problem is I'm not quite sure what to write in android.mk and application.mk to make it happen!

I have written this so far: Android.mk

LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_SRC_FILES := com_Hazem_test_Hazem.c
LOCAL_MODULE:= com_Hazem_test_Hazem
include $(BUILD_SHARED_LIBRARY)

Application.mk

APP_ABI := armeabi armeabi-v7a x86

kindly, help me figure out the contents of those two files.

Upvotes: 1

Views: 1130

Answers (1)

Alex
Alex

Reputation: 3381

You have to include these lines after LOCAL_PATH := $(call my-dir) and before the part that uses the libcurl

include $(CLEAR_VARS)

LOCAL_MODULE            := curl_static
LOCAL_SRC_FILES         := <path>/libcurl.a
LOCAL_EXPORT_C_INCLUDES := <path>/curl/include


include $(PREBUILT_STATIC_LIBRARY)

and to use:

LOCAL_STATIC_LIBRARIES += curl_static

Upvotes: 5

Related Questions