android-sdcard

image attachment to a mail.. how in android?

a 夏天 提交于 2020-01-27 03:06:07
问题 i can pick a image and its path using intent. with the use of that path of an image. i have to set that image as attachment of the mail's body content. how its possible in android??? 回答1: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT,getResources().getString(R.string.emlSendToFriendSubject)); emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL,new String[]{emailto}); emailIntent.setType("text/plain");

Create package directory in ../Android/data denied on SD-Cards on Android >4.4

我与影子孤独终老i 提交于 2020-01-25 10:30:11
问题 I have trouble creating the "com.foo.Example" folder of my app in "/storage/extSdCard/Android/data" from inside the app. If created manually with a file manager there is no trouble, just creating the first one with a simple mkdir returns false. I used the package name declared in the manifest and used throughout and I do have the appropriate WRITE_EXTERNAL_STORAGE-permission in there aswell. Where is this folder suposed to come from, if the app is unable to create it? 回答1: I'm assuming you're

Create package directory in ../Android/data denied on SD-Cards on Android >4.4

对着背影说爱祢 提交于 2020-01-25 10:30:06
问题 I have trouble creating the "com.foo.Example" folder of my app in "/storage/extSdCard/Android/data" from inside the app. If created manually with a file manager there is no trouble, just creating the first one with a simple mkdir returns false. I used the package name declared in the manifest and used throughout and I do have the appropriate WRITE_EXTERNAL_STORAGE-permission in there aswell. Where is this folder suposed to come from, if the app is unable to create it? 回答1: I'm assuming you're

Android:mount unmount and format sdcard

时光毁灭记忆、已成空白 提交于 2020-01-17 00:38:44
问题 Is there any possibility given in Android Icecream-sandwich to programatically format,mount and unmount sdcard ? 回答1: Related API's are in com.androidserver.MountService (it's not new), but this class is hidden and not available for SDK applications. In theory, you can get the MOUNT_FORMAT_FILESYSTEMS permission (it is not a system permission), but you cannot use it since the API's are not public. 来源: https://stackoverflow.com/questions/8630976/androidmount-unmount-and-format-sdcard

Android:mount unmount and format sdcard

帅比萌擦擦* 提交于 2020-01-17 00:38:08
问题 Is there any possibility given in Android Icecream-sandwich to programatically format,mount and unmount sdcard ? 回答1: Related API's are in com.androidserver.MountService (it's not new), but this class is hidden and not available for SDK applications. In theory, you can get the MOUNT_FORMAT_FILESYSTEMS permission (it is not a system permission), but you cannot use it since the API's are not public. 来源: https://stackoverflow.com/questions/8630976/androidmount-unmount-and-format-sdcard

What is the maximum number of items in gridview

假装没事ソ 提交于 2020-01-16 18:18:12
问题 I want to display 15,000 items(images) in grid view, can I load all images at once in grid view From SD card. Please help me on this. 回答1: You could write code to load all 15,000 of them at once, if that's what you're asking. However, I can guarantee you that you'll run into an OutOfMemoryException before you load too many. To get around this, you should lazy load the images, as this will only load the ones you need. 回答2: You can implement the lazy loading concept to load the images in

Deleting External Cache Directory Periodically

我与影子孤独终老i 提交于 2020-01-16 00:45:25
问题 For my app I store map images in a cache on the external storage as to reduce calls to the API that I am using. Since this data is map data, it is subject to change over time. As a result these images should be updated every-so-often. How can I programmatically delete the cache directory periodically? Say for example, every week. Some extra thoughts: Perhaps deleting the entire directory is not the best way to go about it. Perhaps I can check the "freshness" of each image, and delete the old

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS

爷,独闯天下 提交于 2020-01-12 18:51:39
问题 I am using Eclipse DDMS to push a file over onto my Android Emulator sdcard. I select the file and press Open, a dialog pops up and starts pushing the file. In the view "File Explorer" in the DDMS perspective I can see the sdcard directory and can see my file created in it. Then in the popup the progress meter gets halfway then I get this error in the Console window: [2011-09-22 15:15:56] Failed to push the item(s). [2011-09-22 15:15:56] (null) Then the File Explorer completely refreshes and

Problem Pushing Large File to Emulator/SDcard with Eclipse DDMS

不羁的心 提交于 2020-01-12 18:51:29
问题 I am using Eclipse DDMS to push a file over onto my Android Emulator sdcard. I select the file and press Open, a dialog pops up and starts pushing the file. In the view "File Explorer" in the DDMS perspective I can see the sdcard directory and can see my file created in it. Then in the popup the progress meter gets halfway then I get this error in the Console window: [2011-09-22 15:15:56] Failed to push the item(s). [2011-09-22 15:15:56] (null) Then the File Explorer completely refreshes and

Force access to external removable microSD card

假如想象 提交于 2020-01-12 03:27:30
问题 I'm using a Samsung A3, Android 5.0.2. I'm using this setup to compile apps, i.e. Android 4.1 Jelly Bean (API 16) target. I precisely know the path of the external removable microSD card, it is /mnt/extSdCard/ (see also Note #7 below). Problem: I notice that File myDir = new File("/mnt/extSdCard/test"); myDir.mkdirs(); doesn't work: no directory is created. Also: File file = new File("/mnt/extSdCard/books/test.txt"); // the folder "books" already exists on the external microSD card, has been