android Programming Glossary: cursor.getlong
Write sent sms to content://sms/sent table http://stackoverflow.com/questions/12243870/write-sent-sms-to-content-sms-sent-table null if cursor null try if cursor.moveToFirst threadId cursor.getLong 0 finally cursor.close Now use threadId to insert your SMSs...
Android SQLite performance in complex queries http://stackoverflow.com/questions/13401642/android-sqlite-performance-in-complex-queries TeamStats stat new TeamStats stat.setTeamId cursor.getLong 0 stat.setTeamName cursor.getString 1 stat.setGamesPlayed cursor.getInt..
How to display content from sqlite using ViewFlipper in android http://stackoverflow.com/questions/14133943/how-to-display-content-from-sqlite-using-viewflipper-in-android while cursor.moveToNext MyData myData new MyData myData.id cursor.getLong 0 myData.desc cursor.getString 1 myData.name cursor.getString..
Picasa access in android: PicasaUploadActivity http://stackoverflow.com/questions/2193700/picasa-access-in-android-picasauploadactivity content.type intent.getType content.length cursor.getLong cursor.getColumnIndexOrThrow Images.Media.SIZE HttpRequest request..
How do I load a contact Photo? http://stackoverflow.com/questions/2383580/how-do-i-load-a-contact-photo null null try if cursor.moveToFirst contactInfo.setId cursor.getLong 0 contactInfo.setDisplayName cursor.getString 1 contactInfo.setPhoneNumber..
setSelection on Spinner based on rowId http://stackoverflow.com/questions/2559611/setselection-on-spinner-based-on-rowid Cursor cursor Cursor spinner.getSelectedItem long rowid cursor.getLong cursor.getColumnIndex _id There might be a quicker way to do..
Given an Android music playlist name, how can one find the songs in the playlist? http://stackoverflow.com/questions/2694909/given-an-android-music-playlist-name-how-can-one-find-the-songs-in-the-playlist playlist_id cursor.getString 0 playlist_id2 cursor.getLong 0 if playlist_id2 0 String projection MediaStore.Audio.Playlists.Members.AUDIO_ID..
Android: Set contact photo in a ListView with name and number http://stackoverflow.com/questions/4995379/android-set-contact-photo-in-a-listview-with-name-and-number Uri uri ContentUris.withAppendedId Phones.CONTENT_URI cursor.getLong id String uriPhoto uri.toString String uriPeople uriPhoto.replace..
Get data from sent SMS http://stackoverflow.com/questions/5451354/get-data-from-sent-sms cursor.getColumnIndexOrThrow address singleSms.timestamp cursor.getLong cursor.getColumnIndexOrThrow date 1000 ### the sent time singleSms.type..
Delete calendar entries http://stackoverflow.com/questions/5806174/delete-calendar-entries calendarId null null while cursor.moveToNext long eventId cursor.getLong cursor.getColumnIndex _id resolver.delete ContentUris.withAppendedId..
How can I read SMS messages from the inbox programmatically in Android? http://stackoverflow.com/questions/848728/how-can-i-read-sms-messages-from-the-inbox-programmatically-in-android i columns i cursor.getString i long messageId cursor.getLong 0 long threadId cursor.getLong 1 String address cursor.getString.. i long messageId cursor.getLong 0 long threadId cursor.getLong 1 String address cursor.getString 2 long contactId cursor.getLong.. 1 String address cursor.getString 2 long contactId cursor.getLong 3 String contactId_string String.valueOf contactId long..
Group By in ContentResolver in Ice Cream Sandwich http://stackoverflow.com/questions/8654904/group-by-in-contentresolver-in-ice-cream-sandwich seen new HashSet Long while cursor.moveToNext long raw cursor.getLong 1 if seen.contains raw seen.add raw result.addRow new Object.. if seen.contains raw seen.add raw result.addRow new Object cursor.getLong 0 raw android group by android contentprovider android contacts..
Write sent sms to content://sms/sent table http://stackoverflow.com/questions/12243870/write-sent-sms-to-content-sms-sent-table cursor getContentResolver .query uri new String _id null null null if cursor null try if cursor.moveToFirst threadId cursor.getLong 0 finally cursor.close Now use threadId to insert your SMSs. A few things to note. Do not use this threadId to insert..
Android SQLite performance in complex queries http://stackoverflow.com/questions/13401642/android-sqlite-performance-in-complex-queries database.rawQuery sql args cursor.moveToFirst while cursor.isAfterLast TeamStats stat new TeamStats stat.setTeamId cursor.getLong 0 stat.setTeamName cursor.getString 1 stat.setGamesPlayed cursor.getInt 2 stat.setWins cursor.getInt 3 stat.setTies cursor.getInt..
How to display content from sqlite using ViewFlipper in android http://stackoverflow.com/questions/14133943/how-to-display-content-from-sqlite-using-viewflipper-in-android using current view flipper position. private void fetchData while cursor.moveToNext MyData myData new MyData myData.id cursor.getLong 0 myData.desc cursor.getString 1 myData.name cursor.getString 5 list.add myData myData null share improve this answer..
Picasa access in android: PicasaUploadActivity http://stackoverflow.com/questions/2193700/picasa-access-in-android-picasauploadactivity cursor contentResolver.query uri null null null null cursor.moveToFirst content.type intent.getType content.length cursor.getLong cursor.getColumnIndexOrThrow Images.Media.SIZE HttpRequest request requestFactory.buildPostRequest new GenericUrl https..
How do I load a contact Photo? http://stackoverflow.com/questions/2383580/how-do-i-load-a-contact-photo Contacts.DISPLAY_NAME Phone.NUMBER Contacts.PHOTO_ID null null null try if cursor.moveToFirst contactInfo.setId cursor.getLong 0 contactInfo.setDisplayName cursor.getString 1 contactInfo.setPhoneNumber cursor.getString 2 finally cursor.close return..
setSelection on Spinner based on rowId http://stackoverflow.com/questions/2559611/setselection-on-spinner-based-on-rowid get the rowid of a selected item you can do something similar Cursor cursor Cursor spinner.getSelectedItem long rowid cursor.getLong cursor.getColumnIndex _id There might be a quicker way to do it but that's always worked for me. share improve this answer..
Given an Android music playlist name, how can one find the songs in the playlist? http://stackoverflow.com/questions/2694909/given-an-android-music-playlist-name-how-can-one-find-the-songs-in-the-playlist playlistId null null startManagingCursor cursor cursor.moveToFirst playlist_id cursor.getString 0 playlist_id2 cursor.getLong 0 if playlist_id2 0 String projection MediaStore.Audio.Playlists.Members.AUDIO_ID MediaStore.Audio.Playlists.Members.ARTIST..
Android: Set contact photo in a ListView with name and number http://stackoverflow.com/questions/4995379/android-set-contact-photo-in-a-listview-with-name-and-number R.id.Foto int id cursor.getColumnIndex Phones.PERSON_ID Uri uri ContentUris.withAppendedId Phones.CONTENT_URI cursor.getLong id String uriPhoto uri.toString String uriPeople uriPhoto.replace phones people Uri uriFinal Uri.parse uriPeople Bitmap..
Get data from sent SMS http://stackoverflow.com/questions/5451354/get-data-from-sent-sms _id singleSms.address cursor.getString cursor.getColumnIndexOrThrow address singleSms.timestamp cursor.getLong cursor.getColumnIndexOrThrow date 1000 ### the sent time singleSms.type cursor.getInt cursor.getColumnIndexOrThrow type..
Delete calendar entries http://stackoverflow.com/questions/5806174/delete-calendar-entries cursor resolver.query eventsUri new String _id calendar_id calendarId null null while cursor.moveToNext long eventId cursor.getLong cursor.getColumnIndex _id resolver.delete ContentUris.withAppendedId eventsUri eventId null null cursor.close I call it..
How can I read SMS messages from the inbox programmatically in Android? http://stackoverflow.com/questions/848728/how-can-i-read-sms-messages-from-the-inbox-programmatically-in-android for int i 0 i columns.length i Log.v columns i columns i cursor.getString i long messageId cursor.getLong 0 long threadId cursor.getLong 1 String address cursor.getString 2 long contactId cursor.getLong 3 String contactId_string.. i Log.v columns i columns i cursor.getString i long messageId cursor.getLong 0 long threadId cursor.getLong 1 String address cursor.getString 2 long contactId cursor.getLong 3 String contactId_string String.valueOf contactId.. long messageId cursor.getLong 0 long threadId cursor.getLong 1 String address cursor.getString 2 long contactId cursor.getLong 3 String contactId_string String.valueOf contactId long timestamp cursor.getLong 4 String body cursor.getString 5..
Group By in ContentResolver in Ice Cream Sandwich http://stackoverflow.com/questions/8654904/group-by-in-contentresolver-in-ice-cream-sandwich MatrixCursor new String Data._ID Data.RAW_CONTACT_ID Set Long seen new HashSet Long while cursor.moveToNext long raw cursor.getLong 1 if seen.contains raw seen.add raw result.addRow new Object cursor.getLong 0 raw android group by android contentprovider.. Long while cursor.moveToNext long raw cursor.getLong 1 if seen.contains raw seen.add raw result.addRow new Object cursor.getLong 0 raw android group by android contentprovider android contacts share improve this question You could create a custom..
|