Android 7.0 Contacts Address Field - android-7.0-nougat

Does anyone know why Contact addresses in N are a multiline text area and not the separate inputs for street, city, state ,zip code, and country? Is this a new feature?

Related

Geolocation: How to derive the Country using an address/city/place?

I have a .csv file with Twitter profiles including information such as username, name, description etc. One column is geolocation. In this text the user may have a country (i.e., UK), a city or town (i.e., Cambridge), an actual address (5 Tyrian Place, WR5 TY1), a state (i.e, California, CA) or something silly (i.e., West of Hell).
Is there an API/library/automatic way of taking this information and deriving the country? For example, if the location is Cambridge the output should be UK, if the address is in the UK, the output should be UK, etc.
Google has a reverse geocoding service which you can access through their Maps API:
https://developers.google.com/maps/documentation/geocoding/start
They let you make 2500 free requests per day. One nice feature is it will give you correct latitude, longitude, state, country, etc for things like "Golden Gate Bridge" and "The Big Apple." Twitter users enter all sorts of (sarcastic) phrases for their location -- like "West of Hell," "Mars," etc -- and Google will reverse geocode that as well. Though, that may not be very useful.
As another level of checking, you can compare the user's timezone ("utc_offset"), if it is present, to the place that Google returns. It's a bit involved and requires that you compare the timezone's latitude boundaries to the latitude and longitude in Google's response.

iOS formatting phone numbers from address book

My app uses the user's phone number as unique username, and it also sync all of his contacts so he can send them messages.
So, I need a way to format all the phone numbers I'm getting from the phone's address book.
I need to know for a given number:
Country code (if exists).
The number itself.
And if the number includes some international call prefix, it should be remove from the number.
So for example if I have a contact with the number
014 1 3728834122
The format should tell me that the country code is 1 and that the number is 3728834122 (I don't care about the 014 prefix)
What interesting is that the native phone address book seems to know how to format the number, I can see it while typing a new number, it added () or spaces when needed.
So my question is:
Can I query the native address book for a given number, what's his country code & number?
Does anyone knows a good library that do this kind of formatting?

Get a list of cities around a city with a given radius with google places api

I'm using google places api for autocomplete on a RoR project.
I want to get a list of cities around the typed city with a given radius.
For instance:
I type "Paris, France" in the input. I want to have a list (JSON or whatever) which contains all the cities around the city with a given radius (maybe 10 miles or more, it'll be a constant in the project).
How can I do that?
Thanks!
-EDIT-
I've end up with this:
https://maps.googleapis.com/maps/api/place/nearbysearch/json?location=48.534031,2.632121999999981&language=fr&types=locality&sensor=false&rankby=distance&key=YOUR_KEY_HERE
The lat and lng must point to a town near Paris called "Le Mee sur Seine" (https://maps.google.fr/maps?hl=fr&q=48.534031,2.632121999999981).
I want to list the towns surrouding this city ordered by distance but I have "ZERO_RESULTS" as a result...
The type you're tying to filter on, "locality" is specifically listed as not supported. That is, Google will not let you specifically search for locality or a number of other political geo types. See the full list of unsupported types here: https://developers.google.com/places/documentation/supported_types#table2

How to do a city/state/country code lookup based on zip/country input by the user?

Would there be a way to do a city/state/country code lookup based on zip/country input by the user? My site will be international, hence the reason for asking the user to input their country.
I'm thinking the user inputs the zip/post-code and country, which gets saved to the database and then the Google geocode API will convert this to city, state and country and print the output to their user profile. For example:
User input:
Zip - 92646
Country - USA
Output:
Huntington Beach, CA, USA
I could just let the users input their city, state and country, but in the future I want to do some geocoding. So it makes sense to set it up now rather than migrate the database at a later stage. Or do you think I'm doing the wrong thing here? I have a site built in Rails. Thanks in advance.
** Comment: Looks like the demonstration on the RubyCoder Gem allows you to input the zip and country to print the City/State/Country/Zip, which is exactly what I'm after. Thoughts on Geocoder versus Google goecoder API?
I would advise to use the geocoder gem and allow the user to enter their address on one field. It is easier for the user to enter only one field in it a convenient format. And keep it string as a full address. Then give this address to geocoder (in general geocoder will do it automatically), and from there take the coordinates, city, state, etc.
If the user enters a bad address, he simply clarify it. This is just my opinion, not the rule.

how to get telephone number from google by submitting company name and address?

A customer asked me a simple app that retrieves the telephone number given the full address of a company.
So imagine a simple edit box where I type
Dummy Company ltd - 143, High Road, 519243 DummyCity, DU - DummyCountry
and I ask "google" or something else and I get the telephone number as answer.
Of course I need to do this for many customers at once, but if I can do it for 1 it is easy to extend.
Did anyone already implemented something like this?
Why dont you try to contact the "yellow pages" in your region and ask them, guess they provide such an API, take a look at the canadian one for example

Resources