java - How to get SD card size programmatically in _EMULATOR_ in Android Studio -
this works on real gadget connected via usb cord while in debugging mode:
statfs stat = new statfs(environment.getexternalstoragedirectory().getpath()); long bytestotal = (long) stat.getblocksize() * (long) stat.getblockcount(); long bytesavail = (long) stat.getblocksize() * (long) stat.getavailableblocks();
if, however, try run avd, 0 bytes. tools | android | avd manager | virtual devices | view details gave me this:
- name: nexus_5_api_21_x86
- cpu/abi: google apis intel atom (x86)
- path: c:\users\owner.android\avd\nexus_5_api_21_x86.avd
- target: google apis (api level 21)
- skin: nexus_5
- sd card: 200m
- snapshot: no
- hw.dpad: no
- runtime.network.speed: full
- hw.accelerometer: yes
- hw.device.name: nexus 5
- vm.heapsize: 64
- skin.dynamic: no
- hw.device.manufacturer: google
- hw.gps: yes
- hw.audioinput: yes
- tag.id: google_apis
- hw.camera.back: emulated
- hw.mainkeys: no
- avdid: nexus_5_api_21_x86
- hw.camera.front: emulated
- hw.lcd.density: 480
- runtime.scalefactor: auto
- avd.ini.displayname: nexus 5 api 21 x86
- snapshot.present: no
- hw.device.hash2: md5:2fa0e16c8cceb7d385183284107c0c88
- hw.ramsize: 1536
- hw.trackball: no
- hw.battery: yes
- hw.sdcard: no
- tag.display: google apis
- runtime.network.latency: none
- hw.keyboard: no
- hw.sensors.proximity: yes
- disk.datapartition.size: 200m
- hw.sensors.orientation: yes
- avd.ini.encoding: utf-8
- hw.gpu.enabled: yes
line 6 says i've got 200mb sd card; line 30 looks rather suspicious, though. relate haxm virtualization, chance? , big question: how sd card/external storage size @ run-time? i'd appreciate suggestion 'cause i'm sort of @ loss right now... :\
edit: alright, i'll answering own question. issue resolved after re-building avd scratch. have mbs. funny. must glitch or smth... , no, there's no relation haxm whatsoever. undestood after watching lynda.com video tutorial david gassner (he used haxm, too, , had no problems.)
Comments
Post a Comment