Forum > C++ > libcurl can't work on Android?

libcurl can't work on Android?

By valleywoods Posted 2012-03-15 09:00 Comments 5
valleywoods
  • Posts: 11

[version] 0.12.0

I use curl to connect a web link, like http://www.google.com; The program works well on ios (both device and simulator works well).

But it can not work on android (both device and simulator can not work)

on andorid, the return code of the function curl_easy_perform is CURLE_COULDNT_CONNECT (int:7).

Then I tried to remove the line “<uses-permission android:name="android.permission.INTERNET"/>” from AndroidManifest.xml,

the return code of the function curl_easy_perform changed to CURLE_COULDNT_RESOLVE_HOST (int 6).

<———>

Finally, I tried the test demo in 0.12.0 . It worked well on IOS (both device and simulator)

But on android, it still can work . The return code of curl_easy_perform is 6 (CURLE_COULDNT_RESOLVE_HOST).

<——->

BTW, I tried it on simulator and 2 android devices ;

valleywoods
  • Posts: 11

#1 RE: 2012-03-15 09:02

sorry, the test demo on andorid still can not work.

festevezga
  • Posts: 29

#2 RE: 2012-03-15 12:28

There are some features that, even being on tests or part of the documentation, are still not working.

Apparently this is one of those :(

chenium
  • Posts: 7

#3 RE: 2012-03-19 18:11

Is this seriously an issue? This will really put a hold to the progress of my project. Can anyone else confirm if libcurl can or cannot be used with Android?

bing
  • Posts: 27

#4 RE: 2012-05-03 10:41

I got libcurl downloading an image on my android, so it works for me: cocos2d-x 0.12.0, and you need <uses-permission android:name="android.permission.INTERNET"/> in your manifest file.

928675268
  • Posts: 3

#5 RE: 2013-06-27 00:34

right, you should add internet access permission in manifest file

Loggin to reply

Copyright © 2010 - 2013 Cocos2d-x.orgClustrmaps