简体   繁体   English

Android应用程序,如何登录网站并显示信息?

[英]Android app, how to log into website and display information?

I'm trying to build an android app that will log into a website, scrape the website for data specific to the user, then format that data nicely on a mobile screen. 我正在尝试构建一个Android应用程序,该应用程序将登录到网站,抓取网站以获取特定于用户的数据,然后在移动屏幕上很好地格式化该数据。

I've noticed that there are several similar questions to my own, and after reading some of the documentation, I am still very confused as to how I should go about this. 我注意到我有几个类似的问题,在阅读了一些文档之后,我仍然很困惑应该如何去做。

Here's what I know 这就是我所知道的
The site that I want to log into utilizes asp.net and the login.aspx uses POST for the login form. 我要登录的站点利用asp.net,login.aspx使用POST作为登录表单。
There is no API for this website 该网站没有API
There is also no single sign on 也没有单一登录

I'm very new to Android and a novice JAVA programmer at best. 新的Android和新手JAVA程序员的最好的。 Will someone please help me carve the path of research that I need to do in order to write this app? 有人可以请我帮助我完成编写此应用程序所需的研究工作吗? I feel that I mostly need help with connecting to the website and getting the data, I'll be able to figure out the layouts and formatting myself. 我觉得我最需要连接网站和获取数据的帮助,我将能够弄清楚布局和格式化自己。

I am more than willing to research and read whatever is necessary, but I would like to minimize any irrelevant information that would ultimately lead to more confusion. 我非常乐于研究和阅读必要的内容,但是我想尽量减少所有不相关的信息,这些信息最终会导致更多的混乱。

Thank you in advance for the help 预先感谢您的帮助

For the purpose of accessing the website all you need to know about is HTTP. 为了访问该网站,您只需要了解HTTP。 It doesn't matter whether your target website is built with PHP or ASP etc. As you're only concern is how to communicate with the website through HTTP which is independent of technology used by the website. 您的目标网站是用PHP还是ASP等构建的都没有关系。您只关心如何通过HTTP与网站进行通信,而HTTP与网站使用的技术无关。 You can try wikipedia for descriptions of these methods. 您可以尝试使用Wikipedia来描述这些方法。

It might be worthwhile reading the Java URL tutorials for how to use Java classes . 可能值得阅读有关如何使用Java类Java URL教程 As regards extracting the data itself you might want to read up on Parsers. 至于提取数据本身,您可能想在解析器上阅读。 This link might give you some first ideas. 链接可能会给您一些初步的想法。

I'd use the Jsoup API. 我将使用Jsoup API。 I've posted many many threads on that issue. 我已经在该问题上发布了许多主题。 This'll probably help you login. 这可能会帮助您登录。 I don't know how android manages SSL certificates. 我不知道android如何管理SSL证书。 So that you'll have to research on your own. 这样您就必须自己进行研究。 But this right here is a good start. 但这是一个好的开始。

Jsoup Cookies for HTTPS scraping 用于HTTPS抓取的Jsoup Cookies

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM