{"id":454,"date":"2014-07-06T19:18:59","date_gmt":"2014-07-06T17:18:59","guid":{"rendered":"http:\/\/s3lf.de\/blog\/?p=454"},"modified":"2014-08-03T18:38:26","modified_gmt":"2014-08-03T16:38:26","slug":"save-to-sd-card-android-internals","status":"publish","type":"post","link":"https:\/\/s3lf.de\/blog\/2014\/save-to-sd-card-android-internals\/","title":{"rendered":"Save Google Camera Pictures to SD Card and Android Internals"},"content":{"rendered":"<h2>Google Camera does not allow choosing the save location<\/h2>\n<p>On my Android phone I use <a href=\"http:\/\/www.cyanogenmod.org\/\" target=\"_blank\">Cyanogen Mod<\/a> 11. Unfortunately the integrated picture taking app does not support Google&#8217;s\u00a0Photo Sphere function which I like\u00a0a lot.<\/p>\n<p>That is why I installed <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.google.android.GoogleCamera&amp;hl=de\" target=\"_blank\">Google Camera from Google Play.<\/a> This comes with one disadvantage: The Google Camera does not allow choosing the storage path which I would like to set to the SD card which has more space.<\/p>\n<h2>Proof of concept:\u00a0Symlinks and Mounts<\/h2>\n<p>I tried and learned a lot: First I was trying creating a symlink using the Terminal Emulator.\u00a0Setting a symlink using the command\u00a0<code>ln -s \/storage\/sdcard1\/DCIM\/ \/storage\/emulated\/legacy\/DCIM<\/code>\u00a0 is not working an gives me a &#8222;link failed Function not implemented&#8220; error.<\/p>\n<p>Finally I figured\u00a0<code>mount -o bind \/storage\/sdcard1\/DCIM\/ \/storage\/emulated\/legacy\/DCIM <\/code>has the desired effect but how can I make this on every boot?<\/p>\n<h2>ADB &#8211; Android Debug Tool<\/h2>\n<p>I thought of editing the fstab but now the Terminal Emulator was a bit hard to use so I Googled for SSHing to my phone and discovered the Android Debug tool. First I activated USB debugging by clicking seven times on the build number on the about screen to activate the developer mode which reveals the USB debugging option. We have to specify root permissions for ADB. On my Ubuntu computer I install using\u00a0<code>aptitude install android-tools-adb<\/code>\u00a0and after connecting my phone via USB I can execute <code>adb shell<\/code> to open a shell.<\/p>\n<h2>How can we make this persistent?<\/h2>\n<p>Back to the original problem, there is no <code>\/etc\/fstab<\/code> but a <code>\/etc\/fstab.qcom<\/code>. Unfortunately this file can not be edited. We can make it read-writeable using\u00a0<code>mount -o remount,rw \/<\/code>\u00a0but now I figured that the changes are not persisted during a reboot.<\/p>\n<p>Next I learned about the file\u00a0<code>\/data\/local\/userinit.sh<\/code>\u00a0which is executed on each boot if it exists. I put<\/p>\n<p><code>#!\/system\/bin\/sh<\/code><br \/>\n<code>mount -o bind \/storage\/sdcard1\/DCIM\/ \/storage\/emulated\/legacy\/DCIM<\/code><\/p>\n<p>in it, but it did not work and using the <code>logcat<\/code>\u00a0command I found that the mounting takes place to early:<\/p>\n<p><code>I\/sh ( 178): mount: No such file or directory<\/code><\/p>\n<h2>It&#8217;s simple:\u00a0Folder Mount App<\/h2>\n<p>To make a long story short I finally found the <a href=\"https:\/\/play.google.com\/store\/apps\/details?id=com.devasque.fmount&amp;hl=de\" target=\"_blank\">folder mount app<\/a>\u00a0(needs root of course) which gives an easy GUI to move the folder and mount it on the next boot. Now my pictures are stored on the SD card.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Google Camera does not allow choosing the save location On my Android phone I use Cyanogen Mod 11. Unfortunately the integrated picture taking app does not support Google&#8217;s\u00a0Photo Sphere function which I like\u00a0a lot. That is why I installed Google Camera from Google Play. This comes with one disadvantage: The Google Camera does not allow [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[51],"tags":[],"class_list":["post-454","post","type-post","status-publish","format-standard","hentry","category-android-2"],"_links":{"self":[{"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/posts\/454","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/comments?post=454"}],"version-history":[{"count":6,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/posts\/454\/revisions"}],"predecessor-version":[{"id":478,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/posts\/454\/revisions\/478"}],"wp:attachment":[{"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/media?parent=454"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/categories?post=454"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/s3lf.de\/blog\/wp-json\/wp\/v2\/tags?post=454"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}