1 package com.intel.realsense.camera;
3 import android.content.Context;
4 import android.os.Handler;
5 import android.util.Log;
8 import java.io.FileOutputStream;
14 private final static Handler
mHandler =
new Handler();
19 mHandler.post(action);
26 return context.getExternalFilesDir(null).getAbsolutePath();
31 File file =
new File(context.getExternalFilesDir(null) + File.separator + fileName);
32 FileOutputStream fos =
new FileOutputStream(file);
34 Log.i(TAG,
"saveFileToExternalDir: file " + fileName +
" saved successfully");
35 }
catch (Exception
e) {
36 Log.e(TAG,
"saveFileToExternalDir: failed to create a file " + fileName, e);
42 File folder =
new File(path);
43 if (!folder.exists()) {
46 final File[]
files = folder.listFiles();
47 if (files.length == 0)
49 }
catch (Exception
e) {
::rosgraph_msgs::Log_< std::allocator< void > > Log
GLsizei const GLchar *const * path
::std_msgs::String_< std::allocator< void > > String
static void saveFileToExternalDir(Context context, final String fileName, byte[] data)
static String getExternalStorageDir(Context context)
static final void runOnUiThread(Runnable action)
static final Handler mHandler
static boolean isPathEmpty(String path)