android Programming Glossary: cr
Android application with phone book synchronization? http://stackoverflow.com/questions/11643229/android-application-with-phone-book-synchronization application with phone book synchronization I am creating one android test application in which i have one button... nameList ArrayList String phoneNoList ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI.. ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null..
How to post sdcard image into facebook wall using graph api [duplicate] http://stackoverflow.com/questions/13743702/how-to-post-sdcard-image-into-facebook-wall-using-graph-api Posting images I am having only Bitmap of the object so I created file with that Bitmap and I am using that. And I need to.. .notifyChange targetURI null ContentResolver cr getContentResolver try SET THE IMAGE FROM THE CAMERA TO THE.. android.provider.MediaStore.Images.Media.getBitmap cr targetURI SET THE IMAGE FROM THE GALLERY TO THE IMAGEVIEW imgvwSelectedImage.setImageBitmap..
Android read browser history http://stackoverflow.com/questions/2577084/android-read-browser-history has final static Cursor getAllVisitedUrls ContentResolver cr ...method which returns Cursor . May I get help to handle Cursor..
Android camera intent http://stackoverflow.com/questions/2729267/android-camera-intent ImageView findViewById R.id.ImageView ContentResolver cr getContentResolver Bitmap bitmap try bitmap android.provider.MediaStore.Images.Media.. android.provider.MediaStore.Images.Media .getBitmap cr selectedImage imageView.setImageBitmap bitmap Toast.makeText..
Overlay images onto Camera preview SurfaceView http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview on top of the camera preview which can be moved on a screen.. public class TakeRecieptPicture extends Activity implements.. public TouchSurfaceView Context context super context cr new CubeRenderer true this.setEGLConfigChooser 8 8 8 8 16 0.. this.setEGLConfigChooser 8 8 8 8 16 0 this.setRenderer cr this.setRenderMode GLSurfaceView.RENDERMODE_WHEN_DIRTY this.getHolder..
launch facebook app from other app http://stackoverflow.com/questions/4191492/launch-facebook-app-from-other-app
How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder? http://stackoverflow.com/questions/4317665/how-to-get-thumbnail-for-video-in-my-sdcard-android-data-mypackage-files-folder Is it possible Here is part of my code ContentResolver cr getContentResolver String proj BaseColumns._ID Cursor c cr.query.. getContentResolver String proj BaseColumns._ID Cursor c cr.query MediaStore.Video.Media.EXTERNAL_CONTENT_URI proj null.. 0 Bitmap b MediaStore.Video.Thumbnails.getThumbnail cr id MediaStore.Video.Thumbnails.MINI_KIND null Log.d My Thumbnail..
How to add new contacts in android http://stackoverflow.com/questions/4744187/how-to-add-new-contacts-in-android extends Activity Called when the activity is first created. @Override public void onCreate Bundle savedInstanceState.. setContentView R.layout.main try ContentResolver cr this.getContentResolver ContentValues cv new ContentValues.. ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE cr.insert ContactsContract.RawContacts.CONTENT_URI cv Toast.makeText..
How to remove a contact programmatically in android http://stackoverflow.com/questions/527216/how-to-remove-a-contact-programmatically-in-android delete all contacts use the following code ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI.. code ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null.. lookupKey System.out.println The uri is uri.toString cr.delete uri null null catch Exception e System.out.println..
How to set a reminder in Android? http://stackoverflow.com/questions/5976098/how-to-set-a-reminder-in-android Uri.parse getCalendarUriBase this events ContentResolver cr getContentResolver event insert ContentValues values new ContentValues.. 60 60 1000 ends 60 minutes from now values.put description Reminder description values.put visibility 0 values.put.. 60 minutes from now values.put description Reminder description values.put visibility 0 values.put hasAlarm 1 Uri event..
Deleting a gallery image after camera intent photo taken http://stackoverflow.com/questions/6390163/deleting-a-gallery-image-after-camera-intent-photo-taken new Intent com.android.camera.action.CROP intent.putExtra crop true intent.putExtra scale true intent.putExtra return data.. .labelRes If this does not exist we can create it here. if path.exists path.mkdir return new File path.. Finally we can stop the copy. try CurrentFile.createNewFile FileChannel source null FileChannel destination..
Android Camera Intent: how to get full sized photo? http://stackoverflow.com/questions/6448856/android-camera-intent-how-to-get-full-sized-photo try place where to store camera taken picture photo this.createTemporaryFile picture .jpg photo.delete catch Exception e.. .jpg photo.delete catch Exception e Log.v TAG Can't create file to take picture Toast.makeText activity Please check.. this intent MenuShootImage private File createTemporaryFile String part String ext throws Exception File..
How to read and edit Android calendar events using the new Android 4.0 Ice Cream Sandwich API? http://stackoverflow.com/questions/7859005/how-to-read-and-edit-android-calendar-events-using-the-new-android-4-0-ice-cream Ice Cream Sandwich API We are trying to show user the Ice cream Sandwich calendar view when they want to add a new event... endTime.getTimeInMillis Insert Event ContentResolver cr getContentResolver ContentValues values new ContentValues TimeZone.. values.put CalendarContract.Events.CALENDAR_ID 3 Uri uri cr.insert CalendarContract.Events.CONTENT_URI values Retrieve ID..
Stop saving photos using Android native camera http://stackoverflow.com/questions/8078892/stop-saving-photos-using-android-native-camera the full gallery. if bFound the file which is newly created and it has to be deleted from the gallery This is the.. Finally we can stop the copy. try CurrentFile.createNewFile FileChannel source null FileChannel destination.. INFOLOG imagePreORNext2 imagePreORNext ContentResolver cr getContentResolver cr.delete MediaStore.Images.Media.EXTERNAL_CONTENT_URI..
MediaCodec and Camera: colorspaces don't match http://stackoverflow.com/questions/13703596/mediacodec-and-camera-colorspaces-dont-match colorspace looks the most promising but it looks like red Cr and blue Cb are inverted. The NV21 looks interlaced I guess..
Getting frames from Video Image in Android http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android Y U and V values on the YUV 420 buffer described as YCbCr_422_SP by Android David Manpearl 081201 public void decodeYUV.. buffer fg size fg.length minimum sz 3 2 int i j int Y Cr 0 Cb 0 for j 0 j height j int pixPtr j width final int jDiv2.. width i 1 2 Cb fg cOff if Cb 0 Cb 127 else Cb 128 Cr fg cOff 1 if Cr 0 Cr 127 else Cr 128 int R Y Cr Cr 2 Cr..
Android application with phone book synchronization? http://stackoverflow.com/questions/11643229/android-application-with-phone-book-synchronization application with phone book synchronization I am creating one android test application in which i have one button. On button click i want to synchronize phonebook records with.. list using following method. ShowContact ArrayList String nameList ArrayList String phoneNoList ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null if cur.getCount 0 while.. ShowContact ArrayList String nameList ArrayList String phoneNoList ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null if cur.getCount 0 while cur.moveToNext String id cur.getString..
How to post sdcard image into facebook wall using graph api [duplicate] http://stackoverflow.com/questions/13743702/how-to-post-sdcard-image-into-facebook-wall-using-graph-api as a response. Is it possible to give SD Card path for Posting images I am having only Bitmap of the object so I created file with that Bitmap and I am using that. And I need to post on multiple friends wall so I am preferring to use Graph.. 2 In this onActivityResult targetURI initialURI getContentResolver .notifyChange targetURI null ContentResolver cr getContentResolver try SET THE IMAGE FROM THE CAMERA TO THE IMAGEVIEW bmpImageCamera android.provider.MediaStore.Images.Media.getBitmap.. try SET THE IMAGE FROM THE CAMERA TO THE IMAGEVIEW bmpImageCamera android.provider.MediaStore.Images.Media.getBitmap cr targetURI SET THE IMAGE FROM THE GALLERY TO THE IMAGEVIEW imgvwSelectedImage.setImageBitmap bmpImageCamera catch Exception..
Android read browser history http://stackoverflow.com/questions/2577084/android-read-browser-history read browser history by android.provider.Browser class. It has final static Cursor getAllVisitedUrls ContentResolver cr ...method which returns Cursor . May I get help to handle Cursor or any example code to get browser history android browser..
Android camera intent http://stackoverflow.com/questions/2729267/android-camera-intent .notifyChange selectedImage null ImageView imageView ImageView findViewById R.id.ImageView ContentResolver cr getContentResolver Bitmap bitmap try bitmap android.provider.MediaStore.Images.Media .getBitmap cr selectedImage imageView.setImageBitmap.. ContentResolver cr getContentResolver Bitmap bitmap try bitmap android.provider.MediaStore.Images.Media .getBitmap cr selectedImage imageView.setImageBitmap bitmap Toast.makeText this selectedImage.toString Toast.LENGTH_LONG .show catch..
Overlay images onto Camera preview SurfaceView http://stackoverflow.com/questions/3548666/overlay-images-onto-camera-preview-surfaceview a demonstration purpose anyway and ofcourse the cubes overlaid on top of the camera preview which can be moved on a screen.. public class TakeRecieptPicture extends Activity implements Callback private Camera camera private SurfaceView mSurfaceView.. is defined below class TouchSurfaceView extends GLSurfaceView public TouchSurfaceView Context context super context cr new CubeRenderer true this.setEGLConfigChooser 8 8 8 8 16 0 this.setRenderer cr this.setRenderMode GLSurfaceView.RENDERMODE_WHEN_DIRTY.. Context context super context cr new CubeRenderer true this.setEGLConfigChooser 8 8 8 8 16 0 this.setRenderer cr this.setRenderMode GLSurfaceView.RENDERMODE_WHEN_DIRTY this.getHolder .setFormat PixelFormat.TRANSPARENT public boolean..
launch facebook app from other app http://stackoverflow.com/questions/4191492/launch-facebook-app-from-other-app
How to get thumbnail for video in my /sdcard/Android/data/mypackage/files folder? http://stackoverflow.com/questions/4317665/how-to-get-thumbnail-for-video-in-my-sdcard-android-data-mypackage-files-folder for video in my sdcard Android data mypackage files folder. Is it possible Here is part of my code ContentResolver cr getContentResolver String proj BaseColumns._ID Cursor c cr.query MediaStore.Video.Media.EXTERNAL_CONTENT_URI proj null.. Is it possible Here is part of my code ContentResolver cr getContentResolver String proj BaseColumns._ID Cursor c cr.query MediaStore.Video.Media.EXTERNAL_CONTENT_URI proj null null null if c.moveToFirst do int id c.getInt 0 Bitmap b MediaStore.Video.Thumbnails.getThumbnail.. proj null null null if c.moveToFirst do int id c.getInt 0 Bitmap b MediaStore.Video.Thumbnails.getThumbnail cr id MediaStore.Video.Thumbnails.MINI_KIND null Log.d My Thumbnail onCreate bitmap b ImageView iv ImageView findViewById R.id.img_thumbnail..
How to add new contacts in android http://stackoverflow.com/questions/4744187/how-to-add-new-contacts-in-android import android.widget.Toast public class AddContacts extends Activity Called when the activity is first created. @Override public void onCreate Bundle savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main.. onCreate Bundle savedInstanceState super.onCreate savedInstanceState setContentView R.layout.main try ContentResolver cr this.getContentResolver ContentValues cv new ContentValues cv.put ContactsContract.CommonDataKinds.Phone.DISPLAY_NAME.. 1234567890 cv.put ContactsContract.CommonDataKinds.Phone.TYPE ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE cr.insert ContactsContract.RawContacts.CONTENT_URI cv Toast.makeText this Contact added Toast.LENGTH_LONG .show catch Exception..
How to remove a contact programmatically in android http://stackoverflow.com/questions/527216/how-to-remove-a-contact-programmatically-in-android Thank you. android share improve this question To delete all contacts use the following code ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null while cur.moveToNext try.. improve this question To delete all contacts use the following code ContentResolver cr getContentResolver Cursor cur cr.query ContactsContract.Contacts.CONTENT_URI null null null null while cur.moveToNext try String lookupKey cur.getString.. ContactsContract.Contacts.CONTENT_LOOKUP_URI lookupKey System.out.println The uri is uri.toString cr.delete uri null null catch Exception e System.out.println e.getStackTrace To delete any specific contact modify the query..
How to set a reminder in Android? http://stackoverflow.com/questions/5976098/how-to-set-a-reminder-in-android get calendar Calendar cal Calendar.getInstance Uri EVENTS_URI Uri.parse getCalendarUriBase this events ContentResolver cr getContentResolver event insert ContentValues values new ContentValues values.put calendar_id 1 values.put title Reminder.. starts at 11 minutes from now values.put dtend cal.getTimeInMillis 60 60 1000 ends 60 minutes from now values.put description Reminder description values.put visibility 0 values.put hasAlarm 1 Uri event cr.insert EVENTS_URI values reminder.. from now values.put dtend cal.getTimeInMillis 60 60 1000 ends 60 minutes from now values.put description Reminder description values.put visibility 0 values.put hasAlarm 1 Uri event cr.insert EVENTS_URI values reminder insert Uri REMINDERS_URI..
Deleting a gallery image after camera intent photo taken http://stackoverflow.com/questions/6390163/deleting-a-gallery-image-after-camera-intent-photo-taken if requestCode CAMERA_PIC_REQUEST resultCode 1 Intent intent new Intent com.android.camera.action.CROP intent.putExtra crop true intent.putExtra scale true intent.putExtra return data false intent.setDataAndType outputFileUri image intent.putExtra.. new File Environment.getExternalStorageDirectory getString getApplicationInfo .labelRes If this does not exist we can create it here. if path.exists path.mkdir return new File path String.valueOf System.currentTimeMillis .jpg .getPath I have.. if f.exists CurrentFile.length c.getLong 0 CurrentFile.delete Finally we can stop the copy. try CurrentFile.createNewFile FileChannel source null FileChannel destination null try source new FileInputStream f .getChannel destination..
Android Camera Intent: how to get full sized photo? http://stackoverflow.com/questions/6448856/android-camera-intent-how-to-get-full-sized-photo new Intent android.media.action.IMAGE_CAPTURE File photo try place where to store camera taken picture photo this.createTemporaryFile picture .jpg photo.delete catch Exception e Log.v TAG Can't create file to take picture Toast.makeText.. store camera taken picture photo this.createTemporaryFile picture .jpg photo.delete catch Exception e Log.v TAG Can't create file to take picture Toast.makeText activity Please check SD card Image shot is impossible 10000 return false mImageUri.. mImageUri start camera intent activity.startActivityForResult this intent MenuShootImage private File createTemporaryFile String part String ext throws Exception File tempDir Environment.getExternalStorageDirectory tempDir new..
How to read and edit Android calendar events using the new Android 4.0 Ice Cream Sandwich API? http://stackoverflow.com/questions/7859005/how-to-read-and-edit-android-calendar-events-using-the-new-android-4-0-ice-cream and edit Android calendar events using the new Android 4.0 Ice Cream Sandwich API We are trying to show user the Ice cream Sandwich calendar view when they want to add a new event. We can only test this in emulator. The other problem is that.. endTime Calendar.getInstance endTime.set 2012 9 14 8 45 endMillis endTime.getTimeInMillis Insert Event ContentResolver cr getContentResolver ContentValues values new ContentValues TimeZone timeZone TimeZone.getDefault values.put CalendarContract.Events.DTSTART.. My dog is bored so we're going on a really long walk values.put CalendarContract.Events.CALENDAR_ID 3 Uri uri cr.insert CalendarContract.Events.CONTENT_URI values Retrieve ID for new event String eventID uri.getLastPathSegment You'll..
Stop saving photos using Android native camera http://stackoverflow.com/questions/8078892/stop-saving-photos-using-android-native-camera c.getString 1 c.getString 1 break To here we looped the full gallery. if bFound the file which is newly created and it has to be deleted from the gallery This is the NEW image. If the size is bigger copy it. Then delete it.. f.exists CurrentFile.length c.getLong 0 CurrentFile.delete Finally we can stop the copy. try CurrentFile.createNewFile FileChannel source null FileChannel destination null try source new FileInputStream f .getChannel.. handler new Handler handler.postDelayed runnable 300 Log.i INFOLOG imagePreORNext2 imagePreORNext ContentResolver cr getContentResolver cr.delete MediaStore.Images.Media.EXTERNAL_CONTENT_URI BaseColumns._ID c.getString 3 null break ..
MediaCodec and Camera: colorspaces don't match http://stackoverflow.com/questions/13703596/mediacodec-and-camera-colorspaces-dont-match As can be seen none of these are satisfying. The YV2 colorspace looks the most promising but it looks like red Cr and blue Cb are inverted. The NV21 looks interlaced I guess however I'm no expert in this field . Since the purpose is to..
Getting frames from Video Image in Android http://stackoverflow.com/questions/1893072/getting-frames-from-video-image-in-android camSize.width camSize.height Config.ARGB_8888 ... decode Y U and V values on the YUV 420 buffer described as YCbCr_422_SP by Android David Manpearl 081201 public void decodeYUV int out byte fg int width int height throws NullPointerException.. 'fg' is null if fg.length sz throw new IllegalArgumentException buffer fg size fg.length minimum sz 3 2 int i j int Y Cr 0 Cb 0 for j 0 j height j int pixPtr j width final int jDiv2 j 1 for i 0 i width i Y fg pixPtr if Y 0 Y 255 if i 0x1 1.. Y fg pixPtr if Y 0 Y 255 if i 0x1 1 final int cOff sz jDiv2 width i 1 2 Cb fg cOff if Cb 0 Cb 127 else Cb 128 Cr fg cOff 1 if Cr 0 Cr 127 else Cr 128 int R Y Cr Cr 2 Cr 3 Cr 5 if R 0 R 0 else if R 255 R 255 int G Y Cb 2 Cb 4 Cb..
|