Just for additional clarification I want to able to take photos and store them on the sd card and not pollute the users camera folder with these images.
On Oct 26, 1:53 pm, Aaron <[email protected]> wrote: > Hi All, > > Thanks for all your help on my past questions. I have another one for > you: > > How to take a picture using the Camera App and have it NOT appear in > the Gallery? > > Here is what I have so far: > > Time time = new Time(); > time.setToNow(); > File dir = new > File(Environment.getExternalStorageDirectory().toString() + > BusinessRules.IMAGE_PATH); > if (!dir.exists()) { > dir.mkdirs(); > } > String fileName = time.format("%Y%m%d%H%M%S") > + ".jpg"; > File file = new File(dir, fileName); > try { > file.createNewFile(); > ContentValues values = new > ContentValues(); > values.put(Media.TITLE, fileName); > values.put(Media.MIME_TYPE, > "image/jpeg"); > values.put(Media.DATA, > file.getAbsolutePath()); > values.put(Media.IS_PRIVATE, 1); > Uri uri = > getContentResolver().insert(Media.EXTERNAL_CONTENT_URI, > values); > startActivityForResult(new > Intent(MediaStore.ACTION_IMAGE_CAPTURE).putExtra(MediaStore.EXTRA_OUTPUT, > uri), 0); > } catch (IOException e) { > e.printStackTrace(); > } > > I have tried specifying the Media.IS_PRIVATE flag but to no avail. > > Any help is most appreciated!! -- You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/android-developers?hl=en

