android - App not working on AVD, only actual devices -
i'm trying test app, having no luck emulators. i've tried few different avd's , bluestacks. due way mount virtual sdcard, app not finding cache directory expected. however, when run same app on 2 different android phones, seems work properly. facing problem made me think there must better way of referencing folder i'm looking for.
i'm using in oncreate:
// check if application exists (int = 0; < list.size(); i++) { if (list.get(i).packagename.equals("com.someapphere")) { v.settext("application found"); break; } else { v.settext("application not found"); } } if (v.gettext() == "application found") { // check cache usage final file datastore = environment.getexternalstoragedirectory(); try { file tcache = new file(datastore.getabsolutepath() + "/android/data/com.someapphere/cache"); long tcachesize = foldersize(tcache); if (tcachesize == 0) { v2.settext(" nothing do"); } else { // start async task - delete files ... } } catch(exception e) { v2.settext(" cache not found"); } }
i took out of other irrelevant stuff i'm doing here, rest should replicate issue. if it's not obvious, i'm still quite new programming.
text can't compared '=='.
you should try this:
v.gettext().tostring().equalsignorecase("application found");
and not working in emulator may because don't have sd card support in emulator.
in eclipse go in menu window – android sdk , avg manager select virtual devices select avd name need install sd card click on edit button in open dialog go sd card – size: , write 500 press button edit avd run avd emulator
hope helps!!
Comments
Post a Comment