Click here to Skip to main content
16,020,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to get cell tower location(address) in android
Posted

1 solution

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 classes HttpClient or HttpURLConnection and ResponseHandler:
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://stackoverflow.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://stackoverflow.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
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900