android-sdcard

Sdcard Content not visible in DDMS File Explorer Android 6.0

删除回忆录丶 提交于 2019-12-10 11:24:26
问题 Android 6.0 has changed its way to manage sdcard-mounting and that doesn't let show right. Until 5.x we could access to the SDCard Contents via DDMS Perspective (Eclipse) under the hierarchy /mnt/shell/... and now according Documentation under /sdcard/ I can't see any content of this directory under DDMS but in the PC or other Apps (like Astro). What should I set in Eclipse(DDMS) in order to be able to see that content? 回答1: Starting Android 6.0, third-party apps have no ability to see SDCard

How can we get frames in Android

偶尔善良 提交于 2019-12-10 11:15:57
问题 Actually i need to get all the frames from videos but I use to get first frame repeatedly then specific time frames while using Mediametadatareteriver,thumbnail,timestamp to get frames. I'd tried a lot for fixing by changing all GetFrameAtTime(options) but remains the same. my Duration of video is 127040(2:07sec) here i Splited as 32 frames and save frames in SDCard can view all 32 but repeatedly same frames for all 32 frames. I should get these without the help of FFMPEG and xuggler. Is

Android Adoptable Storage - get free Space

情到浓时终转凉″ 提交于 2019-12-10 09:31:44
问题 I have a App that uses 3 kinds of storage: The internal storage, a external SD and if Version >= 6.0 a SD which is formatted as internal. I get the external SD path by using getExternalFilesDirs() , the internal Storage by getFilesDir() and the adopted (=internal) SD path by Environment.getExternalStorageDirectory() . Now, if I want to get the free Space, something like this: StatFs statFs = new StatFs(storageDir); long blocks = statFs.getAvailableBlocks(); return Formatter.formatFileSize

Android sharing image doesn't work

感情迁移 提交于 2019-12-10 04:28:49
问题 I am trying to share a screenshot of the application using the following code: View content = findViewById(R.id.layoutHome); content.setDrawingCacheEnabled(true); Bitmap bitmap = content.getDrawingCache(); File sdCardDirectory = Environment.getExternalStorageDirectory(); File image = new File(sdCardDirectory,"temp.png"); // Encode the file as a PNG image. FileOutputStream outStream; try { outStream = new FileOutputStream(image); bitmap.compress(Bitmap.CompressFormat.PNG, 100, outStream);

How to Delete Image From SDCard in Android [duplicate]

南楼画角 提交于 2019-12-09 21:09:57
问题 This question already has answers here : Android file delete leaves empty placeholder in Gallery (8 answers) Closed 5 years ago . File file = new File(imagePath); boolean deleted = file.delete(); using this code image delete on current screen But it not deleted from SDCard. so Please Anyone who know Answer please Post it. 回答1: file.delete(); Its not delete File or Images. 来源: https://stackoverflow.com/questions/4469744/how-to-delete-image-from-sdcard-in-android

Getting only once permission for sdcard window on Lollipop and above version

大城市里の小女人 提交于 2019-12-09 19:57:26
问题 Hello I am deleting some items from SD card. And in lollipop first time i ask for permission and user grant permission, but now i don't want to ask every time for permission. Its very irritating and many of guys they afraid from this behavior. How can i save my permission i.e. next time i don't need to pass that Intent again and again Intent intent = new Intent(Intent.ACTION_OPEN_DOCUMENT_TREE); Thank you 回答1: I give you some code to example. Remember that u need check permission on Android 6

Export sqlite database file into XML and then into Excel spreadsheet

≡放荡痞女 提交于 2019-12-09 13:15:23
问题 I am trying to do this task from the past 12 hour, but still am not able to do this...Now I have an sqlite database file named "testDatabase.db" into the sd card as a backup file..Now I want to open the database into the spreadsheet format so that the end user can access the database and store this spreadsheet database into his system and then further for printout and for other purpose.. I studied some of the tutorials in which It was written that u can firstly convert ur database file into

Get path of song from SD card in android

前提是你 提交于 2019-12-09 07:03:32
问题 In my android application I want to fetch song from SD card but I am not able to get the path of that particular file.I am using android api level 7 which doesn't support following method. Environment.getExternalStoragePublicDirectory (Environment.DIRECTORY_MUSIC); I have also tried following code : path = Environment.getExternalStorageDirectory(); but I don't know how to specify path of music file.Please suggest some solution.Thanx. 回答1: Get path and song Name from SD Card. You can find the

Android: .nomedia is ignored, images still appear on the gallery

风流意气都作罢 提交于 2019-12-08 15:45:33
问题 I'm building an application which download images from the web and store them into my SDCard, in order to make them invisible in the gallery I put this line to generate a .nomedia file: FileWriter f = new FileWriter("/sdcard/Android/data/CopyImage/cache/.nomedia"); the application can successfully download the image and make the .nodata file on the same folder, but the thing is, the image is still appear on the gallery. How could that be? Can anybody provide me a solution? Thank you very much

Unable to see file in Windows Explorer while it is visible in Android file browser

青春壹個敷衍的年華 提交于 2019-12-08 15:00:53
问题 Through my Android program I wrote a file like this: String file = Environment.getExternalStorageDirectory().getAbsolutePath() + "/Files/hello.txt"; BufferedWriter writer = new BufferedWriter(new FileWriter(file)); writer.write(str+"\n"); \\yeah string has a value there writer.close(); Now when I go to Android's "Astro" File browser, I can see the file hello.txt in /mnt/sdcard/Files but when I mount the sdcard in Windows, I can only see 4 other files which were there in that folder but not