在 Android 中使用 cURL [英] Using cURL in Android

查看:55
本文介绍了在 Android 中使用 cURL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的 android 应用程序中以本机代码使用 cURL 库(使用 NDK r5b,最新版本).在网上研究之后,似乎在 android 中使用 cURL 的唯一方法是使用 curl 构建整个 android 源代码树,并且以某种方式生成 cURL 在 Android 上工作的必要配置文件.我没有任何从头开始构建 android 源代码的经验,想知道是否有一种方法可以在 Android 中使用 cURL 库而无需从源代码重建 android.理想情况下,能够仅使用 cURL 作为静态或共享库将是完美的.我尝试按照此处提到的步骤进行操作...

I would like to use cURL library in my android application in native code (using NDK r5b, the latest). After researching online, it seems the only way to use cURL in android is to build the entire android source tree with curl in it, and somehow this generates a necessary config file for cURL to work on Android. I don't have any experience building the android sources from scratch and was wondering if there is a way to use cURL library in Android without having to rebuild android from source. Ideally, being able to just use cURL as a static or shared library would be perfect. I tried following the steps mentioned here...

http://curl.haxx.se/mail/lib-2009-12/0071.html

但最终在文件 curlrules.h 中出现错误,例如 CURL_SIZEOF_LONG 定义丢失!

but end up getting errors in the file curlrules.h like CURL_SIZEOF_LONG definition is missing!

我认为这些错误是由于没有我提到的那个配置文件,但上面链接中的步骤没有提到任何这些并报告成功.有什么想法吗?

I assume these errors are due to not having that config file I mentioned but the steps in the above link didn't mention any of that and reported success. Any ideas?

推荐答案

我也有类似的问题!我现在正在开发一个需要 cURL 的应用程序,就在今晚我的搜索中,我在这里看到了你的帖子,我认为答案是:

I'm on a similar quest! I'm working on an app right now that requires cURL and just tonight in my search I came across your post here, and what I believe to be the answer:

http://thesoftwarerogue.blogspot.com/2010/05/porting-of-libcurl-to-android-os-using.html

与您引用的链接不同,其他人的一些后续评论也声称已按照说明取得成功.如果您设法在我之前编译它,并且不介意将库发送给我,请在此处发布跟进!(我对堆栈溢出很陌生,所以我不知道你是否可以 pm.)希望这对我们俩都有效!

Unlike the link you referenced, there are several follow-up comments from other people who claim to have success also following the instructions. If you manage to get it compiled before me, and wouldn't mind sending me the library, post a follow up here! (I'm pretty new to stack overflow so I don't know if you can pm.) Hope this works out for both of us!

这篇关于在 Android 中使用 cURL的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆