So i stumbled upon something.... File scan Media scanner connection

How would i use the media scanner connection to make files visible to Android file transfer. referring to a question here (https://stackoverflow.com/questions/15007139/android-file-transfer-cannot-see-a-folder-created-by-app) currently im writing an app and just want to make sure the folder is there and if not create it. And ultimately the data in the folder will either need to be take out of the folder or more data added to it. Thanks for the help a little confused with this scanner stuff. File internalMemory = new File("/mnt/sdcard/FMCW File Archive"); if(internalMemory.exists() && internalMemory.isDirectory()) { mFileList = internalMemory.listFiles(); }else{ createDirIfNotExist("/FMCW File Archive"); } Below is the method public static boolean createDirIfNotExist(String path) { boolean ret = true; File file = new File(Environment.getExternalStorageDirectory() + path); if (!file.exists()) { if (!file.mkdirs()) { Log.e("TravellerLog :: ", "Problem creating Image folder"); ret = false; } } return ret; } -Evan

以上就是So i stumbled upon something.... File scan Media scanner connection的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏