0

I'm trying to setup cURL (or libcurl) on the .c side of my android application (in the ndk) and in order to keep this as simple as possible I'm trying to import an already built library into my project, instead of the whole source code.

I have found several websites on how to import cURL as source code on Android, but even those references seem to be dated.

In the curl download page (http://curl.haxx.se/download.html) there's an Android library, but there's not much information about it.

I have read the readme and the rest of the (few) docs that come with the library, and I have the following questions:

  • The readme makes reference to ARM. Is this library only compiled for ARM, or can I also use it with x86, x86_64, mips, and other architectures?
  • Do I just need the content of the data folder?
  • How do I call the curl library inside of the c code?

Thanks for your help!

TooManyEduardos
  • 4,206
  • 7
  • 35
  • 66
  • Where are your `Application.mk` and `Android.mk` files? – Jared Burrows Feb 20 '15 at 16:27
  • Jared I dont think its a duplicate as that SO question and answer are about compiling it as source code. I'm trying to bring the library already compiled for android. I just started making a test app for this project so I haven't made the make files yet – TooManyEduardos Feb 20 '15 at 16:29
  • You still have yet to address my first comment. You should be compiling the source using the NDK and bring into your project. – Jared Burrows Feb 20 '15 at 16:49
  • No, I answered it to you: "I just started making a test app for this project so I haven't made the make files yet" As of now I have some bare bones Android.mk and Application.mk to make a test jni application with this curl library – TooManyEduardos Feb 20 '15 at 16:51
  • The link I sent you does half the work for your. Once curl is compiled using the NDK you can add it to your NDK make files. – Jared Burrows Feb 20 '15 at 16:53
  • I'm not following you. This SO thread is all about following a blog post of compiling the source code, and having issues with the make file. What I want to do is use the already compiled library available on the curl website. – TooManyEduardos Feb 20 '15 at 17:12
  • Let me explain. Usually if it is **NOT** compile for Android, you need to compile it yourself. The tutorial shows you how to do that. Also, it comes with a project download link(at the end of the blog) showing you how to use curl. This is everything you need. – Jared Burrows Feb 20 '15 at 17:24
  • But I don't want to compile it myself – TooManyEduardos Feb 20 '15 at 17:25
  • The binary you linked to, is a command-line tool, not a library. You cannot use it on the `C` side of your Android project, which needs a static or a shared library. Note that all Android devices ship with cURL shared library, and if you don't rely on specific version, you can simply use that system lib. – Alex Cohn Feb 21 '15 at 15:38
  • @JaredBurrows - you seem to be missing the point of what the poster is trying to do. They already have an allegedly working shared library for curl, **their challenge is in using that from another jni library which they are developing.** – Chris Stratton Feb 25 '15 at 12:49

0 Answers0