Track the exact location of IP address - java

I am trying to create an app to find the exact location of IP address. I did some research on IP addresses and many more. But whenever I try to locate an IP address it provides the location of Internet Service Provider. I want to track the exact geolocation or long & lat of that place. So can anyone help me out to let me know how to find the geolocation of Dynamic IP address

The information upon which such a service might (hypothetically) be based is not available. Ergo, the ISP level information is about as good as you are likely to get for wired IP addresses.
#salocinix wrote:
"The exact position of an end-user's IP is only store at the ISP database and is normally not given away."
The second part is definitely true. They don't and shouldn't give away details about their customers' physical locations. There are obvious privacy concerns with doing that.
But it is quite possible that the ISP doesn't store the customer's physical location at all. Certainly, there is no need for them to store it in the form of longitude and latitude. Whether they need to store it depends on who owns the wires. In Australia for instance, many customers' ISPs don't own the wires that carry the traffic to the customers' dwelling. In that case, the ISP (in theory) only needs to know the billing address for the customer. And then there is the case of ISPs who sell internet connectivity for mobile devices ... where the physical location of a given IP address can change on a minute-by-minute basis.
... just asking because google maps shows the exact location of my PC on map how does it work
The PC is most likely geolocating itself via a combination of GPS and triangulation of local wireless base stations.

The exact position of an end-user's IP is only store at the ISP database and is normally not given away by the IS-provider. Try out the following link, you'll not achieve much more precision.
http://www.iplocation.net/index.php

I urge you to read the following thread on NANOG which was written by Fred Baker of Cisco, author of 50 network related RFC's.
Well, let me ask you you think 171.70.120.60 is. I'll give you a hint;
at this instant, there are 72 of us.
Here's another question. Whom would you suspect 171.71.241.89 is? At
this point in time, I am in Barcelona; if I were home, that would be my
address as you would see it, but my address as I would see it would be
in 10.32.244.216/29. There might be several hundred people you would
see using 171.71.241.89;
Geolocating is gimmicky at best.

Related

How to ban a specific country from using my app programmatically - android java

so let's say that i want to ban the country X from using my app, i banned it from the google play store but it can still be downloaded via VPN is there a way to ban this country using code (maybe trying to detect the user's location or something?)
my government has a very big problem with a neighboring country and i'll go to jail for like forever if i had users in it.
my government has a very big problem with a neighboring country and i'll go to jail for like forever if i had users in it.
There is no technological way that you can guarantee that your mobile application can't / won't be used by someone in another country. Anything that you do in your application can be defeated by a user with sufficient ingenuity / time.
You need to talk to a good local lawyer to find out precisely what your country's law means, and what you need to do to comply with it1. But if the law requires you to do things that are technically impossible, your safest bet may be to not write / publish any mobile apps. Seriously.
1 - It is unlikely that anyone here really knows. I certainly don't!
Locale.getDefault()
Gives you the locale information about the phone, this information come from settings and can be changed by user
but if you want ensure the user from specific country doesn't use you app just get the GPS position and in case of be that country close it
You can perform multiple checks like does a user's IP match banned country IPs, you can check mobile carrier, you can eventually make location check which of course will require user's permission.

OpenstreetMap how to validate post addresses

I am working on a project where I should develop an application to validate post addresses in Germany, Switzerland and Austria. For that I need to set up a address database with all information. But I don't know where i can get the data. I googled for a long time but I didn't find an answer for my problem.
I have 2 questions:
can I work with the rest service of nominatim in a productive environment? the application will process approximately over then 300000 request a day.
can I import an openstreetmap file (*.osm) in a DB (MySql) and work with that? ist there all the informations i need to validate addresses. such as streetname exists? housenumber exists? fit street to housenumber and town?
thans in advance
Achraf
Yes, you can use Nominatim in a productive environment. However not
OSM's public instance (take a look at the usage policy for the
reasons). Just install your own Nominatim instance or use one of the other alternatives.
That depends on the exact information you need. Some adress information are implicitly contained (usually address, house number), some others need to be calculated first (often the city, municipality, state, post codes etc.) because they are often not attached to the address elements directly but to administrative boundary relations instead. Nominatim does all of these processing for you.
Also take a look at other OSM search engines. And remember that OSM doesn't contain every possible address.

How to get longitude/latitude from an URL using Google Place API or any JAVA API

I have an URL (of a restaurant or a place), and I want to get the location (latitude and longitude) of that place using any JAVA API.
With Google Place API, this is possible only after querying the system and giving a description of places we are searching for. But all what we have as input here is the URL.
This is why solutions given here and here are not responding to what I'm seeking for.
One solution could be to find the address by looking into
Bottom Of home page (some sites put their address at footer)
Find address from following pages linked to the main page Contact Us, About Us
None of the above approach is guaranteed to retrieve an address ...but is one step closer.
Next option could be to lookup the whois to find the registered address. If you are a paid user of lookup service you may be able to lookup address for a particular registrar. But then, there are registries that keeps the address hidden (my own website has the address hidden, it shows the address of service provider).... so not always a success.
You can also lookup other services like Crunchbase, and any other directory service as a fallback.
So , let's say we assume you are able to get address of 60-70% websites with all techniques mentioned above. There are situation, where you will end up getting multiple address. You should have a logic to resolve to a particular address. Just think of getting address of Pizza Hut from pizzahut.com :-)
You can add more intelligence...but hope this is good enough to get you started on right direction.

Using the getAccuracy wrong

I'm building a location based application and I would like to avoid from this kind of location: "Tel Aviv, Tel Aviv, Israel" which is very not accurate.
I use the following condition before using a location:
if(!(this.location == null || this.location.getAccuracy() > 700))
// use the location
But I keep getting this locations (Tel Aviv, Tel Aviv, Israel), and Tel Aviv is not small enough to pass this condition.
I'm missing something? What's wrong?
You haven't specified a couple of parameters involved but I'll give it a try.
The exact Location parameters depend on the source of that particular Location, i.e. how it was obtained and using what geolocation source(s). For example:
If you use GPS, the Location will have reliable accuracy values.
If you use cellular network radio stations (BTS), the accuracy you'll receive will be limited to the database of BTS around the world, their location and range.
If you use Wi-Fi networks and their reported signal strength, the accuracy will depend on the quality of the database of the Wi-Fi networks. Unfortunately such databases are not cheap to maintain and create. For example Google buys such databases and uses Google Street View cars for scanning such networks.
If you use localization based on public IP address, your accuracy will be limited to a town, because that is the most accurate information contained in IANA IP address space registry. Also, it can be fooled by using a proxy servers.
The accuracy you'll receive from a location service represents a distance (in meters) from the reported location in which the device is likely to be in the moment the location was obtained.
So (if I understand your question correctly), I presume your using a low-accuracy method of obtaining current device location. You simply must switch to a source of Location with greater accuracy.
Please also note that the location-acquiring method (i.e. the service used to find the location as described above) used by the location service might actually not be able to provide accuracy for returned Location. To understand what I mean by that consider a following scenario and their two outcomes - note that they both come from the same locating method based on Wi-Fi networks:
You are in range of several Wi-Fi networks. You ask the location service about device location. All Wi-Fi networks in range happen to be in location service DB. The location service is thus able to get your location with decent accuracy.
You are in range of several Wi-Fi networks. However, none of them happens to be well known to location service in that their origin (town) is known, but their exact location and range is not known. In that case the location service is able to tell you which country/town you are in, but has no idea on your precise location. In turn, location service can give you a location with no accuracy.
You must make yourself prepared for such an occasion by testing if the accuracy is available at all. You can do this by issuing Location.hasAccuracy(). If the returned value is false, you can't call Location.getAccuracy() (actually you can, but beware - it'll return 0!). So, your condition should be more like:
if (this.location != null && this.location.hasAccuracy() && this.location.getAccuracy() < 700) {
// do something
}

Get the list of WiFi access points in J2ME

To the developers under J2ME.
Is it possible to get a list of all available WiFi points in the moment in Java? Class IAPInfo gives me just a list of available network connections, where there are different internet and other connections, such as internet.mts.ru etc. and besides there is the connection 'Search for WLAN' (like so) and there are no access points themselves there. Already seen examples of a list of WiFi points in C + + for Symbian, but I'm writing in Java. I need a list of access points to define an exact position of mobile phone. I know about cellular communications and GPS, but I also need WiFi.
You can't get a list directly from J2ME.
A better idea is to use JSR 179's LocationProvider which will use any means at its disposal to provide you with a location reading (this may or may not include WIFI locating).

Categories