Android / Internal Phone Storage / File Access -
how file in android's internal storage. here's screenshot of file manager of android:
i want folder named "csentry".
to figure out path csentry, examined entire filesystem structure using code (i'm running code directly on device, have device connected laptop through usb, developer debug mode on, device running android 4.1.1):
protected void onhandleintent(intent workintent) { file rootdirectory = environment.getrootdirectory(); log.d("filez", "-----------------"); traverse(0, rootdirectory); log.d("filez", "-----------------"); } private void traverse(int level, file f) { if (f != null && f.isdirectory()) { stringbuilder sb = new stringbuilder(); (int = 0; < level; i++) { sb.append("."); } sb.append(f.getname()); log.d("traverse", sb.tostring()); file[] f2s = f.listfiles(); if (f2s != null) { (file f2 : f2s) { traverse(level+1, f2); } } } }
but these (i don't see csentry, nor android, nor lost.dir):
thanks in advance help!
d/filez﹕ ----------------- d/traverse﹕ system d/traverse﹕ .app d/traverse﹕ .bin d/traverse﹕ .etc d/traverse﹕ ...tp d/traverse﹕ ..bluetooth d/traverse﹕ ..dhcpcd d/traverse﹕ ...dhcpcd-hooks d/traverse﹕ ..firmware d/traverse﹕ ..mddb d/traverse﹕ ..permissions d/traverse﹕ ..ppp d/traverse﹕ ..radvd d/traverse﹕ ..security d/traverse﹕ ...cacerts d/traverse﹕ ..theme d/traverse﹕ ..updatecmds d/traverse﹕ ..wifi d/traverse﹕ .fonts d/traverse﹕ .framework d/traverse﹕ .lib d/traverse﹕ ..drm d/traverse﹕ ..egl d/traverse﹕ ..hw d/traverse﹕ ..modules d/traverse﹕ ..soundfx d/traverse﹕ ..ssl d/traverse﹕ ...engines d/traverse﹕ .media d/traverse﹕ ..audio d/traverse﹕ ...alarms d/traverse﹕ ...notifications d/traverse﹕ ...ringtones d/traverse﹕ ...ui d/traverse﹕ ..images d/traverse﹕ ..video d/traverse﹕ .mobile_toolkit d/traverse﹕ .res d/traverse﹕ ..images d/traverse﹕ ..sound d/traverse﹕ .tts d/traverse﹕ ..lang_pico d/traverse﹕ .usr d/traverse﹕ ..icu d/traverse﹕ ..idc d/traverse﹕ ..keychars d/traverse﹕ ..keylayout d/traverse﹕ ..share d/traverse﹕ ...bmd d/traverse﹕ ...zoneinfo d/traverse﹕ ..srec d/traverse﹕ ...en-us d/traverse﹕ .vendor d/traverse﹕ ..bin d/traverse﹕ ..lib d/traverse﹕ ...drm d/traverse﹕ ...egl d/traverse﹕ ...hw d/traverse﹕ ..pittpatt d/traverse﹕ ...models d/traverse﹕ ....detection d/traverse﹕ .....multi_pose_face_landmark_detectors.7 d/traverse﹕ ......left_eye-y0-yi45-p0-pi45-r0-ri20.lg_32 d/traverse﹕ ......nose_base-y0-yi45-p0-pi45-r0-ri20.lg_32 d/traverse﹕ ......right_eye-y0-yi45-p0-pi45-r0-ri20.lg_32-2 d/traverse﹕ .....yaw_roll_face_detectors.6 d/traverse﹕ ......head-y0-yi45-p0-pi45-r0-ri30.4a-v24 d/traverse﹕ ......head-y0-yi45-p0-pi45-rn30-ri30.5-v24 d/traverse﹕ ......head-y0-yi45-p0-pi45-rp30-ri30.5-v24 d/traverse﹕ ....recognition d/traverse﹕ .....face.face.y0-y0-22-b-n d/traverse﹕ .xbin d/traverse﹕ .secro d/traverse﹕ .lost+found d/filez﹕ -----------------
do this.
check if directory exists
file file = new file(directory); if(file.exists() && file.isdirectory()) // have found directory
that should it.. hope helped..
i suggest read this , this. these documentations on file. u in near future.
Comments
Post a Comment