About the API(In interface ICatchCameraPlayback)

  1. int getFileCount() throws IchSocketException, IchCameraModeException, IchNoSuchPathException, IchInvalidSessionException;

    Use this API to get the camera’s file count.

  2. List<ICatchFile> listFiles(int fileType, int headIndex, int tailIndex, int timeoutInSecs) throws IchSocketException, IchCameraModeException, IchInvalidArgumentException, IchNoSuchPathException, IchInvalidSessionException;

    Use this API to get file by range, the headIndex specifies the start index, the tailIndex specifies the end index.

Samples to show to to get files by range

  1. try {
  2. ICatchCameraPlayback playback = cameraSession.getPlaybackClient();
  3. int fileCount = playback.getFileCount();
  4. List<ICatchFile> files = playback.listFiles(ICH_FILE_TYPE_IMAGE, 1, 10, 10);
  5. for (ICatchFile file : files) {
  6. Log.i("__main_activity__", "1-10, file: " + file.getFileHandle() + ", name: " + file.getFileName());
  7. }
  8. files = playback.listFiles(ICH_FILE_TYPE_IMAGE, 11, 20, 10);
  9. for (ICatchFile file : files) {
  10. Log.i("__main_activity__", "11-20, file: " + file.getFileHandle() + ", name: " + file.getFileName());
  11. }
  12. Log.i("__main_activity__", "file Count: " + fileCount);
  13. }
  14. catch (Exception ex) {
  15. Log.i("__main_activity__", "capture photo record failed, exception: " + ex.getMessage());
  16. }