hdiz
hdiz

Reputation: 1161

Get Location ID of Cities in android app

I write an application which use Xhanch api for getting prayer time I use this link for this purpose , but i don't know where can i get location id of several cities , please help me . Thanks

Upvotes: 0

Views: 217

Answers (1)

Drormat
Drormat

Reputation: 169

What you looking for called geoNameId. You could try the following API service.you have to specify the country as an ISO and recieve back info about the country include the geoNameId.

example: http://api.geonames.org/countryInfoJSON?formatted=true&lang=en&country=DE&username=demo&style=full

result:

{
  geonames: [
    {
       continent: "EU",
       capital: "Berlin",
       languages: "de",
       geonameId: 2921044, //here is the geoNameId for Germany
       south: 47.2701236047002,
       isoAlpha3: "DEU",
       north: 54.9113475100612,
       fipsCode: "GM",
       population: "81802257",
       east: 15.0418156516163,
       isoNumeric: "276",
       areaInSqKm: "357021.0",
       countryCode: "DE",
       west: 5.86625035072566,
       countryName: "Germania",
       continentName: "Europa",
       currencyCode: "EUR"
    }
  ]
}

check geoNames site for more info: http://www.geonames.org/

Upvotes: 1

Related Questions