android Programming Glossary: ctx.getcontentresolver
Turning on and off GPS programmatically in android 4.0 and above? [duplicate] http://stackoverflow.com/questions/15426144/turning-on-and-off-gps-programmatically-in-android-4-0-and-above intent String provider Settings.Secure.getString ctx.getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains.. void turnGPSOff String provider Settings.Secure.getString ctx.getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains..
Read all contact's phone numbers in android http://stackoverflow.com/questions/2356084/read-all-contacts-phone-numbers-in-android projection new String People.NAME People.NUMBER Cursor c ctx.getContentResolver .query People.CONTENT_URI projection null null People.NAME ASC..
How to get contacts in order of their upcoming birthdays? http://stackoverflow.com/questions/2482631/how-to-get-contacts-in-order-of-their-upcoming-birthdays ContactsContract.Contacts.CONTENT_URI id c ctx.getContentResolver .query uri null null null null if c null if c.moveToFirst DatabaseUtils.cursorRowToContentValues.. c data c.close read birthday c ctx.getContentResolver .query Data.CONTENT_URI new String Event.DATA Data.CONTACT_ID.. Make the query. ContentResolver cr ctx.getContentResolver Form an array specifying which columns to return. String projection..
How to add new field(s) to the contact? http://stackoverflow.com/questions/2733589/how-to-add-new-fields-to-the-contact values.put Data.DATA1 this.getFormality 1 0 int mod ctx.getContentResolver .update Data.CONTENT_URI values Data.CONTACT_ID this.getId.. values.put Data.MIMETYPE clsContacts.FORMALITY_MIMETYPE ctx.getContentResolver .insert Data.CONTENT_URI values catch Exception e Log.v TAG..
Contact Custom Fields http://stackoverflow.com/questions/3009839/contact-custom-fields values.put Data.DATA1 this.getFormality 1 0 int mod ctx.getContentResolver .update Data.CONTENT_URI values Data.CONTACT_ID this.getId.. values.put Data.MIMETYPE clsContacts.FORMALITY_MIMETYPE ctx.getContentResolver .insert Data.CONTENT_URI values catch Exception e Log.v TAG.. String mimetype String contactid return ctx.getContentResolver .query Data.CONTENT_URI new String Data.DATA1 Data.RAW_CONTACT_ID..
Android Api - get mobile number from contacts http://stackoverflow.com/questions/3695566/android-api-get-mobile-number-from-contacts has can have multiple. Uri uri data.getData Cursor cursor ctx.getContentResolver .query uri null null null null while cursor.moveToNext String..
Getting events from calendar http://stackoverflow.com/questions/5883938/getting-events-from-calendar public CalendarContentResolver Context ctx contentResolver ctx.getContentResolver public Set String getCalendars Fetch a list of all calendars..
Turning on and off GPS programmatically in android 4.0 and above? [duplicate] http://stackoverflow.com/questions/15426144/turning-on-and-off-gps-programmatically-in-android-4-0-and-above intent.putExtra enabled true this.ctx.sendBroadcast intent String provider Settings.Secure.getString ctx.getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps is disabled final Intent poke new Intent poke.setClassName.. poke automatic turn off the gps public void turnGPSOff String provider Settings.Secure.getString ctx.getContentResolver Settings.Secure.LOCATION_PROVIDERS_ALLOWED if provider.contains gps if gps is enabled final Intent poke new Intent poke.setClassName..
Read all contact's phone numbers in android http://stackoverflow.com/questions/2356084/read-all-contacts-phone-numbers-in-android code to retrieve all contact names and phone numbers String projection new String People.NAME People.NUMBER Cursor c ctx.getContentResolver .query People.CONTENT_URI projection null null People.NAME ASC c.moveToFirst int nameCol c.getColumnIndex People.NAME int..
How to get contacts in order of their upcoming birthdays? http://stackoverflow.com/questions/2482631/how-to-get-contacts-in-order-of-their-upcoming-birthdays and birthday like this Cursor c null try Uri uri ContentUris.withAppendedId ContactsContract.Contacts.CONTENT_URI id c ctx.getContentResolver .query uri null null null null if c null if c.moveToFirst DatabaseUtils.cursorRowToContentValues c data c.close read birthday.. null null null null if c null if c.moveToFirst DatabaseUtils.cursorRowToContentValues c data c.close read birthday c ctx.getContentResolver .query Data.CONTENT_URI new String Event.DATA Data.CONTACT_ID id AND Data.MIMETYPE ' Event.CONTENT_ITEM_TYPE ' AND Event.TYPE.. the Contacts content provider. Uri contacts ContactsContract.Contacts.CONTENT_URI Make the query. ContentResolver cr ctx.getContentResolver Form an array specifying which columns to return. String projection new String ContactsContract.Contacts._ID ContactsContract.Contacts.DISPLAY_NAME..
How to add new field(s) to the contact? http://stackoverflow.com/questions/2733589/how-to-add-new-fields-to-the-contact void saveFormality try ContentValues values new ContentValues values.put Data.DATA1 this.getFormality 1 0 int mod ctx.getContentResolver .update Data.CONTENT_URI values Data.CONTACT_ID this.getId AND Data.MIMETYPE ' clsContacts.FORMALITY_MIMETYPE ' null..
Contact Custom Fields http://stackoverflow.com/questions/3009839/contact-custom-fields saveFormality try ContentValues values new ContentValues values.put Data.DATA1 this.getFormality 1 0 int mod ctx.getContentResolver .update Data.CONTENT_URI values Data.CONTACT_ID this.getId AND Data.MIMETYPE ' clsContacts.FORMALITY_MIMETYPE ' null.. ' null if mod 0 values.put Data.CONTACT_ID this.getId values.put Data.MIMETYPE clsContacts.FORMALITY_MIMETYPE ctx.getContentResolver .insert Data.CONTENT_URI values catch Exception e Log.v TAG saveFormality failed return this public boolean getFormality.. representation of the contact id @return private Cursor readDataWithMimeType String mimetype String contactid return ctx.getContentResolver .query Data.CONTENT_URI new String Data.DATA1 Data.RAW_CONTACT_ID contactid AND Data.MIMETYPE ' mimetype ' null null..
Android Api - get mobile number from contacts http://stackoverflow.com/questions/3695566/android-api-get-mobile-number-from-contacts data and will loop through the phone numbers the contact has can have multiple. Uri uri data.getData Cursor cursor ctx.getContentResolver .query uri null null null null while cursor.moveToNext String contactId cursor.getString cursor.getColumnIndex ContactsContract.Contacts._ID..
Getting events from calendar http://stackoverflow.com/questions/5883938/getting-events-from-calendar contentResolver Set String calendars new HashSet String public CalendarContentResolver Context ctx contentResolver ctx.getContentResolver public Set String getCalendars Fetch a list of all calendars sync'd with the device and their display names Cursor cursor..
|