Can i access existing phonebook ?

17 views
Skip to first unread message

wahib

unread,
Jun 29, 2011, 3:55:47 PM6/29/11
to The-M-Project
Hi !

I intend to access existing contacts in the phonebook of the device.
Firstly, can i do this in M-Project ? If yes then how ? I read about
Local Storage in the wiki and even tried the demo application but it
didnt work out like expected. I guess Local Storage is what user
manipulates on run-time.

So kindly share code by how i can access the existing contact details
stored in the device.

Thanks in advance.

Regards,

wahib

Dominik Laubach

unread,
Jun 30, 2011, 9:35:47 AM6/30/11
to The-M-Project
Hi Wahib,

Local Storage has got nothing to do with the contacts of your device!
Local Storage is a technology for storing data of you application in
the browser. It extends the old-fashioned cookies. For further
information check e.g. Wikipedia (http://en.wikipedia.org/wiki/
Web_Storage).

Unfortunately accessing a device's contacts with HTML/JavaScript is
impossible so far. There is a specification called "Contacts
API" (http://www.w3.org/TR/contacts-api/), but it has not yet been
implemented in any browser. So for accessing a device's contacts, you
will need a native bridge. For example you could launch your The-M-
Project application in a Phonegap container (http://
www.phonegap.com/). This will provide you with additional
functionalities, like being able to access the contacts of a device
(http://docs.phonegap.com/
phonegap_contacts_contacts.md.html#Contacts).

But note, that in the end this will result in a native application! If
you want your app to run on different platforms, you will have to
create multiple Phonegap projects - one for each targeted device - and
deploy them separately. That's no problem with The-M-Project, but you
have to consider that you will lose the advantage of a pure web app.

Best regards,
Dominik
Reply all
Reply to author
Forward
0 new messages