更新时间:2023-02-27 08:56:14
中获取手机信号塔的位置(地址)您可以执行以下搜索: ^ ] .
如果会告诉您有某些服务,您可以订阅以按地址或其他搜索条件获取位置.
您可以找出是否有Web服务并充当客户端.即使是常规网站,也可以以编程方式(基本上是使用Web浏览器模拟常规用户的行为)执行HTTP请求,以登录并开始搜索,然后获取HTTP响应并进行解析. >
这实际上与 Web抓取中的技术相同:
http://en.wikipedia.org/wiki/Web_scraping [ http://developer.android.com/reference/org/apache/http/client/HttpClient.html [^ ],
http://developer.android.com/reference/java/net/HttpURLConnection.html [ ^ ],
http://developer.android.com/reference/org/apache/http/client/ResponseHandler.html [ ^ ].
我发现的第一个相关代码示例是:
http://***.com/questions/2323617/android-httppost-how-获得结果 [ ^ ].
您可以使用上述信息在Google搜索中找到更多关键词.
当您收到HTTP响应时,您将需要解析HTML代码.理想情况下,如果响应是格式正确的XML,则很容易.您可以在此讨论中找到一些示例:
http://***.com/questions/2971155/what-is-the-fastest-way-to-scrape-html-webpage-in-android [ http://jsoup.org/ [ ^ ].—SA
You can do this search: http://bit.ly/AaS4oU[^].
If will show you that there are cervices you can subscribe to to get locations by address or other search criteria.
You can find out if there is a Web service and act as a client. Even if the case of a regular Web site, you can perform HTTP requests programmatically (basically, simulating behavior of a regular user using a Web browser) to log in and start the search, and then get HTTP response and parse it.
This is practically the same technique as in Web scraping:
http://en.wikipedia.org/wiki/Web_scraping[^].
Basically, you would need to use the classesHttpClient
orHttpURLConnection
andResponseHandler
:
http://developer.android.com/reference/org/apache/http/client/HttpClient.html[^],
http://developer.android.com/reference/java/net/HttpURLConnection.html[^],
http://developer.android.com/reference/org/apache/http/client/ResponseHandler.html[^].
First relevant code sample I''ve found was this one:
http://***.com/questions/2323617/android-httppost-how-to-get-the-result[^].
You can find some more using the above information for key words in Google search.
When you get a HTTP response, you would need to parse HTML code. Ideally, it''s easy if the response is a well-formed XML. You can find some samples in this discussion:
http://***.com/questions/2971155/what-is-the-fastest-way-to-scrape-html-webpage-in-android[^].
If not, you would need some HTML parser which could deal with some code. You can try this one:
http://jsoup.org/[^].—SA