/android/export-contacts

To get this branch, use:
bzr branch http://bzr.ed.am/android/export-contacts

« back to all changes in this revision

Viewing changes to src/am/ed/exportcontacts/ContactsContactAccessor.java

  • Committer: edam
  • Date: 2012-04-24 11:29:44 UTC
  • Revision ID: tim@ed.am-20120424112944-6fic236bul6r9cqi
changed all the URLs to ed.am, including copyrights, package names and project
site

Show diffs side-by-side

added added

removed removed

1
1
/*
2
 
 * ContactsContactReader.java
 
2
 * ContactsContactAccessor.java
3
3
 *
4
 
 * Copyright (C) 2010 Tim Marston <edam@waxworlds.org>
 
4
 * Copyright (C) 2011 Tim Marston <tim@ed.am>
5
5
 *
6
6
 * This file is part of the Export Contacts program (hereafter referred
7
7
 * to as "this program"). For more information, see
8
 
 * http://www.waxworlds.org/edam/software/android/export-contacts
 
8
 * http://ed.am/dev/android/export-contacts
9
9
 *
10
10
 * This program is free software: you can redistribute it and/or modify
11
11
 * it under the terms of the GNU General Public License as published by
21
21
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
22
22
 */
23
23
 
24
 
package org.waxworlds.edam.exportcontacts;
 
24
package am.ed.exportcontacts;
25
25
 
26
26
import android.app.Activity;
27
27
import android.database.Cursor;
28
28
import android.provider.Contacts;
29
29
 
30
 
public class ContactsContactReader implements ContactReader
 
30
public class ContactsContactAccessor implements ContactAccessor
31
31
{
32
32
        Activity _activity = null;
33
33
        Exporter _exporter = null;
34
34
        Cursor _cur = null;
35
35
 
36
 
        public ContactsContactReader( Activity activity, Exporter exporter )
 
36
        public ContactsContactAccessor( Activity activity, Exporter exporter )
37
37
        {
38
38
                _activity = activity;
39
39
                _exporter = exporter;
92
92
                                        Contacts.Organizations.COMPANY ) ),
93
93
                                cur.getString( cur.getColumnIndex(
94
94
                                        Contacts.Organizations.TITLE ) ) ) );
 
95
                cur.close();
95
96
 
96
97
                // get the phone numbers
97
98
                cur = _activity.managedQuery( Contacts.Phones.CONTENT_URI,
108
109
                                        Contacts.Phones.TYPE ) ),
109
110
                                cur.getString( cur.getColumnIndex(
110
111
                                        Contacts.Phones.NUMBER ) ) ) );
 
112
                cur.close();
111
113
 
112
114
                // get the email and postal addresses
113
115
                cur = _activity.managedQuery( Contacts.ContactMethods.CONTENT_URI,
141
143
                                        cur.getString( cur.getColumnIndex(
142
144
                                                Contacts.ContactMethods.DATA ) ) ) );
143
145
                }
 
146
                cur.close();
144
147
 
145
148
                return true;
146
149
        }