How to retrieve contact numbers and save them? - contacts

I am developing an emergency Android application and I don't know how to retrieve contacts (for ex. 4) from the phone's catalogue firstly, and then save the selected in the app. database. Thus, whenever I want to send an emergency sms I don't have to retrieve contacts again or add any numbers. This is for an assignment so any ideas would be very useful for me. Thanks!

Related

search specific number in iphone contacts

I am developing a Voip application. My application has its own call logs and screen is same as native call logs. Application also has its own contacts received from server and also has iphone contacts option which display iphone's contacts like Skype.
Problem :
If any contact suppose "9999999999" is stored in native contacts i.e. in iphone contacts. It will be stored as "99-99-999999" in iphone. Now suppose incoming call in my application comes from "+919999999999" number (means with country code).
My app should find name for that number and display it. And call log detail screen should display all information which is stored in iphone's contacts (like photo, multiple number, etc.)
To search name for number I have used This. But given method in like compares exact number (not compare number with or without country code).
Is there any API available ?
I don't know how it is possible because "Bria" and "Viber" application does this.
Any help....
Thanks in advance.

How to take a diff of app contacts against phoneBook or diff of 2 ABAdressBookRef's?

I have a contact book on my application and need to sync those contacts with server cum phonebook regularly.
Rather taking total phoneBook to update app's contacts, I am thinking of diff of changed contacts for which I didn't find a functionality in ABAddessBook API. Problem is that the contact objects in the app are of different type to contact objects that I get from phoneBook
via function ABAddressBookCopyArrayOfAllPeople().
If I get difference of changed contacts efficiently, then I can just sync those contacts only.
Will that be possible?
Hey! I found that we can register to ABAdressBook change by ABAddressBookRegisterExternalChangeCallback, but is there a way to get diff of changed contacts?
Thanks.

How to determine if phone number has changed?

Currently I am developing an authentication module for my application. The user provides his phone number and a SMS with some pin code is send to him.
The user enters the code and if it is valid his phone number is authenticated. Maybe you know WhatsApp, it does quite the same when you run the app first time.
However if the user puts a new sim card in his phone he should authenticate it again.
I want to know how to determine if phone number has changed. I read in some other question that it is not possible to determine the phone number itself. But e.g. WhatsApp recognizes that there is another phone number.
Any ideas?
Update 2
One (not the best) way it's detecting carrier changing. Here you can see how to get carrier's name. Save it at first launch and do compare on next launches.
Update 3
I'd recommend to you look at Core Telephony Network reference and especially at CTTelephonyNetworkInfo reference
subscriberCellularProviderDidUpdateNotifier allow you respond on events such like:
... when the user’s cellular provider information changes. This occurs, for example, if a user
swaps the device’s SIM card with one
from another provider, while your
application is running

Can i build an app that edits the conatct list on the iphone?

Hey everybody,
I want to create an app that handles some sort of recognition of another person in my area, and creates a new contact based on his info. regardless to how it is done, my question is more basic - can i, or maybe i should ask will Apple approve an application that edits the contact list in the IPhone?
The AddressBook framework allows access to a centralized contacts database, called the Address Book database, that stores a user’s contacts.
Yes of course you can edit the contact List from your application by using the address book API.
Cheers

iPhone programming: Sending data from one iPhone to another?

I am new to iPhone development. I created an iPhone application, using which user can create a Business Card kind of UI in TableView. I want to know how can i send a Business Card(which i created programmatically) data into another iPhone via SMS? I want to know the technology which i should use to sending such thing from one iPhone to another via SMS or Email, i shouldn't use WiFi/Bonjour service which can send only upto nearest area.
thanks.
Calve/
SMS wasn't designed for this, and so it probably won't work like you're describing. Here's what I would do:
You have your BusinessCard object. Upload it to your servers and give it a unique identifier. This identifier is what should be sent to the other person, whereupon they can use the identifier to download the appropriate card.
If you wanted to be super cool about it, you could maybe construct a URL like: "card://12345678890", where 1234567890 is the identifier. You could then set your app up to respond to "card://" urls. Then send the card URL around via SMS. When a user taps on the link in their SMS app, it'll automatically open up your app (providing that they have it downloaded and installed, and that nothing else has registered "card://").
For additional awesomeness, you can allow people to create "shortcuts" to their identifier (like bit.ly), so they can send around "card://my-cool-business" instead of "card://1234567890".
You could encode your business card data as a base64-encoded custom URL, assuming it isn't too large. An example of doing this kind of URL-driven data exchange (which does not require uploading anything to a server) can be found here.
I doubt that you'll be able to encode enough information in the tiny size of an SMS message (unless you were just sending compressed text, no images), but this approach would work well with email.
Where MMS is available you can send a VCard formatted object attachment by that route. The receiving phone will detect the attachment format and allow you to manipulate it.
This will also work to non iPhone devices.