CURL Library for Android

After many attempts, I managed to set up this Android NDK project on eclipse:

https://github.com/gcesarmza/curl-android-ios 

... and now it works. All he does is connect to www.google.com: This is the curl call I make in the main operation:

 String url = "https://www.google.com"; byte[] content = downloadUrl(url); 

I am new to the NDK of this CURL library, how can I execute a more complex CURL request such as this file upload command ???

 curl -F file=@audio.wav http://myserver.com 
0
source share
1 answer

The trial project that you reproduced does just that, downloadUrl.

If you want something else, you need to write (in C or C ++) your own code that uses libCURL. You can start with a general tutorial .

You also need to define some JNI wrapper, for example.

 native bool pushFile(String file) 

Alternatively, you can use an existing JNI wrapper .

0
source

Source: https://habr.com/ru/post/919677/


All Articles