Android的HTTP-POST AsyncHttpClient [英] Android HTTP-post AsyncHttpClient

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

问题描述

public void postLoginData() {
    AsyncHttpClient myClient = new AsyncHttpClient();
    RequestParams params1 = new RequestParams();
    params1.put("username", "username");
    params1.put("password", "pass");
    myClient.post(
            "https://68.164.136.217/htdocs/?action=login&returntype=JSON", //"https://68.164.136.217/htdocs/?action=login", //"http://192.168.2.148/htdocs/?action=login&returntype=JSON",
            params1, new AsyncHttpResponseHandler() {
                @Override
                public void onSuccess(String response) {
                    System.out.println("login success");
                }
            });
    PersistentCookieStore myCookieStore = new PersistentCookieStore(this);
    myClient.setCookieStore(myCookieStore);
    Log.d("Cookies", myCookieStore.getCookies().toString());
}

http://pastebin.com/htDhQpKT
登录猫。我不知道为什么它给我这个错误。我有上网权限

http://pastebin.com/htDhQpKT Log cat. I do not know why it is giving me this error. I have the internet permission

推荐答案

运行Ice Cream Sandwich的3.0内核包含一个名为netfilter的模块 xt_qtaguid 。这个过程在后台运行,并负责处理所有PID的网络使用情况,并生成统计日志,位于的/ proc /净/ xt_qtaguid /统计。这可能是因为你缺少你的内核这个模块(可能是更容易,如果你使用的是仿真器发生...否则谁知道为什么)。

The 3.0 kernel that runs Ice Cream Sandwich contains a netfilter module named xt_qtaguid. This process runs in the background and is responsible for processing the network usage for all PIDs and generating a stats log, located at /proc/net/xt_qtaguid/stats. This is probably because you missing this module in your kernel (probably more likely to occur if you are using the emulator... otherwise who knows why).

如果你真的关心不够,它可以向后移植到2.6.35内核。勾选此<一个href=\"https://github.com/Hash$c$c/android_device_motorola_solana/tree/ics/modules/netfilter/xt_qtaguid\"相对=nofollow>链接出更多的信息。你也可能需要参考这个非常相似,所以帖子

If you really care enough, it can be backported to the 2.6.35 kernel. Check this link out for more information. You may also want to consult this very similar SO post.

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

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