android-sdcard

How to check and request read, write permission for sd card in platform >= 23 of Android

梦想与她 提交于 2019-12-13 23:12:29
问题 I have the following code to request read,write permission for external(shared) storage known as emulated. Now I also want to read and write to SD Card. But i am getting the error "permission denied" in logs. //We are calling this method to check the read permission status public boolean isReadWriteStorageAllowed() { //Getting the permission status int resultRead = ContextCompat.checkSelfPermission(this, Manifest.permission.READ_EXTERNAL_STORAGE); int resultWrite = ContextCompat

why am I getting incorrect phone and SDcard memory information?

孤街醉人 提交于 2019-12-13 19:01:14
问题 I want to see the right information from the phone settings such as in SDCART and phone memory. but see this code card 1800 MB total memory. my card is 16GB. could not figure out. I've tried a lot of code, but did not. How do I solve this problem. public static boolean externalMemoryAvailable() { return android.os.Environment.getExternalStorageState().equals( android.os.Environment.MEDIA_MOUNTED); } public static String getAvailableInternalMemorySize() { File path = Environment

Android 4.2.2 'Not enough space on device', can't install apps [closed]

喜你入骨 提交于 2019-12-13 18:05:58
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I've looked for a few different solutions but all of them involve rooting, or pre-rooted phones. Mine is not rooted (I'll do it if I have too, but I'm lazy.) Basically, every time I try and update or download an app my phone says there's not enough space on the device, despite my 11GB on SD and 140MB internal,

push sqlite database file into phone

时光毁灭记忆、已成空白 提交于 2019-12-13 11:23:39
问题 I need to push sqlite database file to phone app storage location. I tried this for my app package database.But not working.Is there any way? I have tried using below command in device shell, but getting device not found message. shell@android: adb push MY_DB_FILE /data/data/MY_PACKAGE_NAME/databases/ 回答1: Call the write() method shown below whenever you want your database file. It will create a backupname.db file in the root folder of your device.(you can change the name of the .db file in

How to connect RC522 RFID module and SD-Card Adapter to one Arduino board?

狂风中的少年 提交于 2019-12-13 07:48:41
问题 I want to store the log of RFID tag into the Micro SD card, but RFID and SD card having MOSI and MISO. So i want to know how to connect RFID and SD card to one Arduino UNO. 回答1: Pins named MOSI and MISO indicate an SPI bus. There should also be a pin labeled SS, CS or similar (slave select). you can hook up several slaves to one master and select the device you want to talk to using that pins logic level. There should be tons of tutorials and examples online. 回答2: You can connect multiple

How to read from the internal storage (subfolder Download)?

懵懂的女人 提交于 2019-12-13 07:36:50
问题 After intensive search I could not find out how to read a configuration file (xml) from the internal storage (sub-folder download). I tried to access /mnt/sdcard/Download/config.xml but received an Exception. When trying to get the available folders from the two possible suppliers ApplicationContext and Environment , I get these informations: context.getFilesDir().getAbsolutePath(); // /data/data/com.xxx.yyy/files context.getDir("Download", 0).getAbsolutePath(); // /data/data/com.xxx.yyy/app

how to save ViewPager Current image to sd card on button click

北城余情 提交于 2019-12-13 07:14:33
问题 i am working on a image swipe app in which i am swiping images on ViewPager and i want to save current showing image to sd card on button click. my code: SwipeActivity.java package com.td.gridview; import android.app.Activity; import android.content.Context; import android.content.Intent; import android.os.Bundle; import android.support.v4.view.PagerAdapter; import android.support.v4.view.ViewPager; import android.support.v4.view.ViewPager.OnPageChangeListener; import android.view.View;

Android, Not sure if I should store to the internal storage or external storage

强颜欢笑 提交于 2019-12-13 04:29:43
问题 I have an app out there on the market already The app is not a game just an informative app with lots of pictures and stats and I received a comment from someone stating that the size of the app being 20Mb is being stored on the "internal storage which isn't fair and that some of it should be stored on the SD card." Now I am still trying to learn everything about android coding but is this a big deal so that I should move all those images to the external storage like the SD card? Is 20Mb to

writing to storage instead of emulated on nexus 7

醉酒当歌 提交于 2019-12-13 03:35:30
问题 In my code, write stuff to file using this code //the path String fileName = Environment.getExternalStoragePublicDirectory(fileName) + File.separator+"Foo"+File.separator; File dir = new File(fileName); //the file fileName += "bar" File file = new File(fileName); try { file.createNewFile(); } catch (IOException e) { //do nothing, for now } return; This results with the file being written /storage/emulated/0/ and not to /storage/sdcard0 . The problem I have with this is that I dont see

Image From sd card to galleryview

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-12 17:23:38
问题 In my app i want to get the Images from SD card to a specific position and i need to display in gallery, The code i used is attaching private Gallery gallery; private ImageView imgView; int position; private byte[] data = { }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.gridview); try{ String filepath = "/sdcard/data/Crak/"; File imagefile = new File(filepath +"abcd.jpg" ); FileInputStream fis = new FileInputStream