Guest User

com.android.camera

a guest
Feb 27th, 2011
157
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1) Edit our path
  2. com.android.camera.ImageManager.java:130
  3.  
  4. public static final String CAMERA_IMAGE_BUCKET_NAME =
  5.     Environment.getExternalStorageDirectory().toString()
  6.     + "/DCIM/100ANDRO";
  7.  
  8.  
  9. 2) Naming function for increasing names for photos
  10. com.android.camera.Camera.java:873
  11.  
  12. private String createName(long dateTaken) {
  13.     int n = 1, max = 0;
  14.     for(File file:  // go through all jpg's
  15.         new File(ImageManager.CAMERA_IMAGE_BUCKET_NAME).listFiles(new FilenameFilter() {
  16.             @Override public boolean accept(File dir, String filename) {
  17.                 return filename.toLowerCase().endsWith(".jpg");
  18.             }
  19.         })
  20.     ){
  21.         try{    // try to search maximum
  22.             n = Integer.parseInt(file.getName().substring(4, 8));
  23.             if(n>max) max = n;
  24.         }catch (Exception ignored) {
  25.         }
  26.     }
  27.     return String.format("IMAG%04d", max+1);
  28. }
  29.  
  30.  
  31. 3) Naming function for increasing names for videos
  32. com.android.camera.VideoCamera.java:246
  33.  
  34. private String createName(long dateTaken) {
  35.     int n = 1, max = 0;
  36.     for(File file:  // go through all 3gp's
  37.         new File(ImageManager.CAMERA_IMAGE_BUCKET_NAME).listFiles(new FilenameFilter() {
  38.             @Override public boolean accept(File dir, String filename) {
  39.                 return filename.toLowerCase().endsWith(".3gp");
  40.             }
  41.         })
  42.     ){
  43.         try{    // try to search maximum
  44.             n = Integer.parseInt(file.getName().substring(5, 9));
  45.             if(n>max) max = n;
  46.         }catch (Exception ignored) {
  47.         }
  48.     }
  49.     return String.format("VIDEO%04d", max+1);
  50. }
RAW Paste Data