github201407 / contactlistimporter

Automatically exported from code.google.com/p/contactlistimporter
1 stars 0 forks source link

Phone #37

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
has provided support for the phone numbers?

best regards.
--
Davide Consonni <dconsonni@gmail.com>

Original issue reported on code.google.com by dconso...@gmail.com on 3 Jul 2009 at 8:49

GoogleCodeExporter commented 8 years ago
here some useful code:

at line 122 of GmailImporter:
(note i use System.out beacuse bean contact doesn't support telephone yet :) ) 

                        if (jsonObj.has("Phones")) {
                                JSONArray phones = jsonObj.getJSONArray("Phones");
                                for (int j = 0; j < phones.length(); j++) {
                                        JSONObject phonesJsonObj =
phones.getJSONObject(j);
                                        String number =
phonesJsonObj.getString("Number");
                                        String type =
phonesJsonObj.getJSONObject("Type").getString("Id");
                                        System.out.println("------------------" +
type + "---------------------------------------------" + number);
                                }
                        }

Original comment by dconso...@gmail.com on 3 Jul 2009 at 9:32