Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

chinnu

macrumors newbie
Original poster
Oct 27, 2009
14
0
Australia
i'm new to iphone sdk.
how to write an application which accesses contacts and sms messages and pictures etc of iphone and show them in sumulator when iphone is connected to computer(mac).
is it possible?
plz reply me.
thanks in advance.
 
my intention is,

i'm sorry. i'm not presenting my question it seems.
my intention is,
iphone is connected to mac.
then data is available as a files.
my application running in simulator should read those files display data on simulator.
Q1:when iphone is connected to mac, do we get contacts information file.
is my question clear?
thanks for previous reply robbieduncan u are helping me alot.
 
my application running in simulator should read those files display data on simulator.

This is the bit that makes no sense: the simulator has no connection to a real phone: it's a way of letting you test your code on your Mac. Nothing more.
 
What you see on the simulator is not what is running on the iphone. If you have no iPhone connected you can still use the simulator to run programs that are compiled for it. The simulator DOES NOT communicate IN ANY WAY with a real iPhone.
 
Thanks Guys for your responses. Is there any other application/DB provided by mac or third party through which I can access the contacts.

I am working on application which needs the data from iphone, It needs to run as emulator or within emulator which contains/accesses the data from iphone.

This would bea workaround for me. so that I can store the data in intermediate repository or application and use the same to get it in my application ? does this make sense ?

Hope this clarifies, my intention.

Thanks a lot guys...
 
Why don't you look at the Address Book Programming Guide for iPhone OS, which is part of Apple's documentation. It should answer your questions regarding accessing contacts.
 
If you don't encrypt your iPhone backups, then all the iPhone app DBs are stored, in a munged and segmented format, on your Mac, after any iTunes sync.

Find and copy the files desired from the mobile backup directory into your simulator sandbox directory, un-munge and convert these files into DBs, and then access them as local databases in your simulated app.

non-trivial...
 
Why don't you look at the Address Book Programming Guide for iPhone OS, which is part of Apple's documentation. It should answer your questions regarding accessing contacts.
if i use that api, i can definitely access the contacts of iphone for that my application should run on iphone.
but i want to access contacts of iphone in the application which runs on simualtor.
 
You could write a network client server iPhone app.

Have the app check to see if it's running on the device, or on the simulator.

If running on the device, act as a server reading from the abperson db and sending to the net.

If running on the simulator, act as a client reading the info from the net and displaying it on the simulator UI.
 
...but i want to access contacts of iphone in the application which runs on simualtor.
I don't think you've yet explained fully enough why you would want an application that is running in the simulator to access the address book of a connected iPhone. What problem are you trying to solve with this proposed solution?
 
The description of this problem is very unclear. Obviously normal users don't have the simulator. Is this for an app to be sold on the app store? Why do you want the app on the Sim to access the contacts on the device? For most users the contacts on their computer and device will be synced so they will be the same. Also, broadcasting information about a user's contacts would be considered an invasion of privacy if they didn't allow it.

To give a direct answer to your question, No, an app running on the Sim doesn't have a simple API that will let it read the contacts on a device, whether the device is connected by USB or not. There's no way to just connect to a device and ask it about its contact list. However, if you were to write an app that runs on the device it could be contacted by another app running on the desktop.

You need to give a clearer explanation of what you want to implement.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.