Get external SD card paths for different models

Source: Internet
Author: User

/** * Run Mount command. Returns the mounted address. The address is then resolved */private void Getextsdcardpath () {try {Runtime runtime = Runtime.getruntime (); Process proc = runtime.exec ("mount"); InputStream is = Proc.getinputstream (); InputStreamReader ISR = new InputStreamReader (IS); String Line; string mount = new string (); BufferedReader br = new BufferedReader (ISR), while (line = Br.readline ())! = null) {System.out.println (line); if ( Line.contains ("secure")) Continue;if (Line.contains ("ASEC")) Continue;if (Line.contains ("fat")) {String columns[] = Line.split (""); if (columns! = null && columns.length > 1) {mount = Mount.concat ("*" + columns[1] + "\ n");}} else if (line.contains ("fuse")) {String columns[] = Line.split (""); if (columns! = null && columns.length > 1) {m Ount = Mount.concat (columns[1] + "\ n");}}} System.out.printf (mount);} catch (FileNotFoundException e) {e.printstacktrace ();} catch (IOException e) {e.printstacktrace ()}}


Results of the method execution (test machine-Samsung Galaxy Noteii):

08-01 12:42:50.790:i/system.out (19890): None/acct cgroup rw,relatime,cpuacct 0 0
08-01 12:42:50.790:i/system.out (19890): tmpfs/mnt/asec tmpfs rw,relatime,mode=755,gid=1000 0 0
08-01 12:42:50.790:i/system.out (19890): Tmpfs/mnt/obb tmpfs rw,relatime,mode=755,gid=1000 0 0
08-01 12:42:50.790:i/system.out (19890): None/dev/cpuctl cgroup rw,relatime,cpu 0 0
08-01 12:42:50.790:i/system.out (19890):/dev/block/mmcblk0p13/system ext4 ro,relatime,barrier=1,data=ordered 0 0
08-01 12:42:50.795:i/system.out (19890):/dev/block/mmcblk0p3/efs ext4 Rw,nosuid,nodev,noatime,barrier=1,journal_ async_commit,data=ordered 0 0
08-01 12:42:50.795:i/system.out (19890):/dev/block/mmcblk0p12/cache ext4 rw,nosuid,nodev,noatime,barrier=1,journal _async_commit,data=ordered 0 0
08-01 12:42:50.795:i/system.out (19890):/dev/block/mmcblk0p16/data ext4 Rw,nosuid,nodev,noatime,barrier=1,journal_ Async_commit,data=ordered,noauto_da_alloc,discard 0 0
08-01 12:42:50.795:i/system.out (19890):/sys/kernel/debug/sys/kernel/debug debugfs rw,relatime 0 0
08-01 12:42:50.795:i/system.out (19890):/dev/fuse/storage/sdcard0 fuse rw,nosuid,nodev,noexec,relatime,user_id= 1023,group_id=1023,default_permissions,allow_other 0 0
08-01 12:42:50.795:i/system.out (19890):/dev/block/vold/179:17/storage/extsdcard vfat Rw,dirsync,nosuid,nodev, noexec,noatime,nodiratime,uid=1000,gid=1023,fmask=0002,dmask=0002,allow_utime=0020,codepage=cp437,iocharset= Iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0


08-01 12:42:50.795:i/system.out (19890):/storage/sdcard0
08-01 12:42:50.795:i/system.out (19890): */storage/extsdcard

Get external SD card paths for different models

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.