Android 4.4 Virtual Device Internal Storage Will Not Resize

Now that the emulator file system is ext4 I was able to re-size the userdata.img using standard Linux tools. # Navigate to AVD cd ~/.android/avd/Nexus5 # Delete old image rm userdata-qemu.* # Re-size the image resize2fs userdata.img 512M # Start the emulator and enjoy emulator @Nexus5 Edit I was also able to re-size userdata-qemu.img directly … Read more

Android: how to write a file to internal storage

Use the below code to write a file to internal storage: public void writeFileOnInternalStorage(Context mcoContext, String sFileName, String sBody){ File dir = new File(mcoContext.getFilesDir(), “mydir”); if(!dir.exists()){ dir.mkdir(); } try { File gpxfile = new File(dir, sFileName); FileWriter writer = new FileWriter(gpxfile); writer.append(sBody); writer.flush(); writer.close(); } catch (Exception e){ e.printStackTrace(); } } Starting in API 19, … Read more

Retrieve database or any other file from the Internal Storage using run-as

By design user build of Android (that’s what you have on your phone until you unlock the bootloader and flash the phone with userdebug or eng software) restricts access to the Internal Storage – every app can only access its own files. Fortunately for software developers not willing to root their phones Google provides a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)