Android httpclient中的会话到Google App Engine中的Webview

Android httpclient中的会话到Google App Engine中的Webview,android,google-app-engine,session,cookies,webview,Android,Google App Engine,Session,Cookies,Webview,我随后从Android应用程序验证了agains应用程序引擎 我已经有代币了。如何使用此令牌在android webview中打开appengine站点?我的意思是,我有webapp,例如example.appspot.com,我想在本地android部分进行身份验证后在android webview中打开它 这是Nick教程的一部分: private class GetCookieTask extends AsyncTask<String, Void, Boolean> {

我随后从Android应用程序验证了agains应用程序引擎

我已经有代币了。如何使用此令牌在android webview中打开appengine站点?我的意思是,我有webapp,例如example.appspot.com,我想在本地android部分进行身份验证后在android webview中打开它

这是Nick教程的一部分:

private class GetCookieTask extends AsyncTask<String, Void, Boolean> {
    protected Boolean doInBackground(String... tokens) {
        try {
            // Don't follow redirects
            http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, false);
            HttpGet http_get = new HttpGet("https://example.appspot.com/_ah/login?continue=http://localhost/&auth=" + tokens[0]);
            HttpResponse response;
            response = http_client.execute(http_get);
            if(response.getStatusLine().getStatusCode() != 302)
                // Response should be a redirect
                return false;

            for(Cookie cookie : http_client.getCookieStore().getCookies()) {
                if(cookie.getName().equals("ACSID"))
                    return true;
            }
        } catch (ClientProtocolException e) {
            e.printStackTrace();
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_REDIRECTS, true);
        }
        return false;
    }

    protected void onPostExecute(Boolean result) {
        new AuthenticatedRequestTask().execute("http://example.appspot.com/home");
    }
}
私有类GetCookieTask扩展异步任务{
受保护的布尔doInBackground(字符串…标记){
试一试{
//不要跟随重定向
http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_重定向,false);
HttpGet http_get=新的HttpGet(“https://example.appspot.com/_ah/login?continue=http://localhost/&auth=“+代币[0]);
HttpResponse响应;
response=http\u client.execute(http\u get);
if(response.getStatusLine().getStatusCode()!=302)
//响应应该是重定向
返回false;
用于(Cookie Cookie:http_client.getCookieStore().getCookies()){
if(cookie.getName().equals(“ACSID”))
返回true;
}
}捕获(客户端协议例外e){
e、 printStackTrace();
}捕获(IOE异常){
e、 printStackTrace();
}最后{
http_client.getParams().setBooleanParameter(ClientPNames.HANDLE_重定向,true);
}
返回false;
}
受保护的void onPostExecute(布尔结果){
新建AuthenticatedRequestTask()。执行(“http://example.appspot.com/home");
}
}