隐藏的android web视图,这可能吗? [英] android hidden webview, Is it possible?

查看:117
本文介绍了隐藏的android web视图,这可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想建立一个应用程序,它需要用户/用户从信息传递,并用它在https网页,并提取该页面返回原始的HTML code。

I want to build an application which takes user/pass information from user and use it on an https webpage and extract the returned raw html code from that page.

我想知道的是这可能吗?

I want to know is this possible?

如果是这样,我应该使用什么样的班。可以将其与一些隐藏的WebView机制来实现。正弦我认为我们可以从我们的应用程序网页视图访问Java脚本变量。因此,这是可能的。或者,我只是浪费我的时间在这个方向。

If so, what sort of class i should use. Can it be done with some hidden webview mechanism. Sine i think we can access the java script variable in a webview from our application. So is this possible. Or i am just wasting my time in this direction.

推荐答案

pretty老主题在这里,但我看到,我没有面临这种情况下,唯一的一个。

Pretty old subject here, but I see that I'm not the only one facing this situation.

这是我的理解是:

HttpClient的对象和对象的WebView不会共享通过您的应用程序相同的会话范围。
也就是说,如果你有这个URL执行认证,并开始在网站上一个有效的会话;并遵循,您尝试打开这些网站的一个网页 - 会话保护 - 通过网页视图,好像没有会话中提供的网页视图动作。的WebView不知道HttpClient的会话。

HttpClient objects and WebView objects will not share the same "session" scope through your application. That is, if you have this URL that performs authentication and starts a valid session on a website; and following that, you try to open one of those website pages - session protected - through the webview, the webview will act as if no session were available. WebView is not aware of the HttpClient session.

一个解决方案,那就是打电话,通过这样的方法WebView.postUrl启动会话的网址:

A solution to that is to call the URL that starts a session through the WebView.postUrl method like this:

webView.postUrl(URL,EncodingUtils.getBytes(postParameters,BASE64));

我敢肯定,这可以在一个隐藏的web视图来完成。

I'm sure this can be done in a hidden webView.

这篇关于隐藏的android web视图,这可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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