0

After much struggling, I managed to setup this Android NDK project on eclipse:

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

...and now it runs. All it does is connect to www.google.com: This is the curl call I make in the Main Activity:

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

I am new to NDK an 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
Josh
  • 6,251
  • 2
  • 46
  • 73
  • Check this question http://stackoverflow.com/q/4952169/4596556 and http://thesoftwarerogue.blogspot.in/2010/05/porting-of-libcurl-to-android-os-using.html – Madhukar Hebbar Dec 14 '15 at 13:23
  • Hi @MadhukarHebbar , I had already checked both links, but they talk more about setting up the library, dont tell how to do a request such as: curl -F file=@audio.wav http://myserver.com (might be I am still too green on this, sorry) – Josh Dec 14 '15 at 13:34
  • `String url = "http://myserver.com/audio.wav";` And you forgot to tell what exactly your curl request does. – greenapps Dec 14 '15 at 15:57

1 Answers1

0

The test project that you reproduced does only this, 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 generic tutorial.

You will also need to define some JNI wrapper, e.g.

native bool pushFile(String file)

Alternatively, you can use an existing JNI wrapper.

Alex Cohn
  • 56,089
  • 9
  • 113
  • 307