Real time address completion - ios

I'm working on an Windows Phone/iOS app (both native app), one feature I want is to have a textbox that auto-complete in a drop down menu as user enter a physical address (i.e. if user enter "new", the drop down should display "new york city, new orleans, etc", but only to city/county level).
Just like google's instant search complete: http://support.google.com/websearch/bin/answer.py?hl=en&answer=106230
To be more specific,
1) where should I put this city name database? I suppose local is a good idea as for city level it won't be too big and there's no delay?
2) where can I get a complete north america city list?
3) and are there any open-source library that can do the autocomplete?
Thanks!

From a WP7 point ov view. You can use the AutoComplete box. Unless there is a good reason to have a dynamic list, I would backage the list of cities within the app as that will make the autocomplete quicker.

Related

Is Appium only used for testing? What about an app/bot assistant?

i'm looking for some guidance on what the best approach is/ what software I need.
My bf owns a promotional company, books about 15 shows a month and spend a lot of time on his phone, creating event pages, linking up the bands facebook and bandcamp url to events, contacting bands with set times and backline info, etc. I thought I would help him out (and other music promoters that I've talked to) with automating some of these tasks. I know there might be other apps currently out there that have some of these capabilities, but I wanted to create something myself as it be a fun project that I could practice my programming skills(beginner-ish).
The app/bot will act as an assistant. It should be able to create an event, ask for the date and let the user input band names. Maybe there will be a series of check boxes that the user can select whether the band is from out of state(what state), touring, local, EP/album release, etc. Select co-host, location. Then depending on the # of bands and the location it will also generate a set time list, and backline info that the user can copy it and send to the bands(or maybe it will do this automatically, if it has access to the bands instagram or facebook?) Once the user presses done it will automatically create an event page, with date, and all the other info. Under the description of the event page, the app will automatically populate that with info depending on what the user selected. For example if its 2 out of state bands and 2 local bands, then it will write something like: "We welcome our 2 touring friends XX from FL? and xxx from NY? With local support from XX and xx" - something along those lines with a link to their pages.
Maybe in the future the app will also be able to go in and look at the bands facebook pages, go to their events and see what people pressed going/interest in their events, then invite those people to their upcoming show?
How do I get started. Should I use Appium and android studio to develop this app/bot assistant? Is Appium only used for testing? I have some basic programming experience from college and other courses i took, such as Selenium webdriver. More important is this doable or am I setting myself up for failure?
In addition to being a developer, I also am a part-time promoter and perform all of those same tasks that your boyfriend does. If there was some way to automate any of it, I would have done so a long time ago. Unfortunately there is, in my opinion, too much variability between different events, venues, and musical acts.
The biggest time sink for me is tracking down information about each act such as their web site URL, Facebook page URL, Soundcloud profile URL, logo, bio, and photo. (Some of the artists I deal with have a press kit but most don't.) Once the information is compiled, creating the Facebook pages is the easy part.
So, maybe a better use of time would be to create a web form that collects that information from each act and stores it in a folder in a structured way.

Best way to get user's country?

I'm about to start expanding my secondhand app, where people can put their used university books for sale.
Right now the app is only available in one country, but in the near future other scandinavian countries will follow.
As an example I want to expand to Sweden, the user should only be able to see/buy/sell books that are for sale in that country.
I have come up with 2 solutions, but none of them are quite good:
Location decides country.
User selects the country from a list.
I would like to hear your thoughts on this, since lots of apps do this - but I can't figure out how.
Why not a combination of both? Try the location services first, if for whatever reason they have location services turned off or don't allow it, have them select their country. The country selection should be one of the first prompts they are given when they open the app (if location services aren't on). Otherwise, before they are allowed to post any books for sale. In other words they shouldn't be allowed to put a book up for sales without the app knowing which country they are in.
Are you using swift (what version) or objective-c?
https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/
You'll need a list of countries: How do I get a list of countries in Swift ios?
If you are willing to pay some. You could look at a ip based Solution like the www.maxmind.com api. It Gives country info and more. And we bought 50.000 queries for 50 dollars. And as we check once per user, we did not even finísh our bought queries!
I believe your application should do a guesswork and provide easy-to-use alternative for the case when the guess was incorrect. Get the country by location or IP. When the user installs the app, show the selected country and make sure your user can easily change it both in the installer and in the app itself (if, for instance, one student moves from a country to the other).

Obtaining a list of cities/time zones as used in Apple's Clock app

I am currently working on an something that contains the ability for a user to do simple time conversions to various time zones based on City, so a user would select a city name and then select the time they wish to convert to the other time zone selected. I am currently using the time zones found in NSTimeZone's database, which I loop through and then create an NSTimeZone object using the method knownTimeZoneNames. My issue is that this database that NSTimeZone presents to me seems to be different to the one being used by Apple in their clock app. Multiple cities that I can access through Apple's built in app are simply not available to me in when looping through knownTimeZoneNames.
I have looked into the tz or zoneinfo database created by IANA but it seems this database is also lacking a number of the places I can see, again, in the Clock app. An example of this would be Geneva, Switzerland.
Does anyone have any idea where this database may have come from? Or is it potentially another database that contains other cities and timezone's that are then matched to the existing database in NSTimeZone?
Another thing I'm not sure of is where the country database comes from. In the NSTimeZone database you only get the region (Asia, Europe, America, etc.) and the city name, but for example many of the African cities it would be best practise to have the city name and country name - where does this come from?
Thanks.
An easy way of obtaining city/timezone data is hack a widget called World Clock (for OS X), which is developed by Apple, Inc. Navigate to the big Library folder and then to Widgets. Right click on World Clock and open the file named WorldClock.js with a text editor. This file contains lines of city names and their corresponding timezone names. That's what I use for my clock application.
You should may be check : The google Timezone API. As it seems that it needs lat, lng, you should first use the google geocoding API in order to convert city name to coordinates.

How does Square's iPhone app programmatically retrieve the user's contact information?

When I install the Square app on a brand-new iPhone, it prepopulates my first name, last name, and e-mail into the signup fields. All I have to type is a password. That's really neat.
How does that work, and how does it know who I am? Is this using a privileged API? There's no programmatic way to get a user's name, AFAIK.
I was actually curious about this too, so I checked it out myself earlier. It's a very clever trick. Here's how it works:
First, Square accesses the name of your iPhone. (This isn't a protected API.)
For most people, the default name of the phone is something along the lines of "Steve Smith's iPhone". A regular expression match is performed, parsing out "Steve Smith".
"Steve Smith" is then searched for in your contact list.
If an entry is found, it brings back the first/last names and the e-mail address for that contact. The signup form is prepopulated accordingly.
If an entry is not found, the signup form will stay blank. Likewise, if the name of your iPhone is something other than the default format -- even if it's just one character off -- the prepopulation mechanism won't fire.
You can prove that this works by changing the name of your iPhone to an arbitrary contact, as in "Dave Wilson's iPhone", and noticing that Dave Wilson's contact info will now be prepopulated.

Foursquare: check if a user visited a city

I was just wondering...Is it possible to check whether a specific user has checked in a specific city?
For example, if John has previously checked in at some restaurants in London and Paris, is it possible to test from within my application if John has visited something in London or Paris?
Thanks!
Sure, within reason.
The user authenticates via OAuth2
You produce a number of recents to the checkin history https://developer.foursquare.com/docs/users/checkins.html - will probably need to use offset and limit to explore ALL of their check-ins
You will want to write an algorithm to figure out what 'city' means to you - perhaps X miles within the lat/long of the city center? For more detail, use a GeoCode API such as Google's or Bing's http://msdn.microsoft.com/en-us/library/ff701713.aspx

Resources