android - APK expansion file expPath does not exists -


I am trying to change my app to use the APK extension file and for any reason given below The path can not be detected in the code passed. My APK Expansion Files ...

  static String [] getAPKExpansionFiles (Context ctx, int mainVersion, integer patchVersion) {Log.v (TAG, "Utils.getAPKExpansionFiles [27] mainVersion the" + Main version + "patch warsen =" + patch warsen); String packagename = ctx.getPackageName (); Logs. V (TAG, "Utils.getAPKExpensionFiles [27] package name [+ + + packagename +"] ");  New vector of vector & lt; string & gt; (); if (. Environment.getExternalStorageState () equals (Environment.MEDIA_MOUNTED)) {Log.v (TAG, "Utils.getAPKExpansionFiles [32] MEDIA_MOUNTED"); // app to create the full path to expansion files file root = environmental .getExternalStorageDirectory (); log . V (tAG, "Utils.getAPKExensionFiles [35] root =" + root); Akspepath file = new file (Rutkstosting () + EXP_PATH + packageName); log. V (tag, "utils. Aapiapiaksapensfails [37] Akspepath "+ One Suppath) // Check that expansion file path exists if (exppath.exists ()) {...} else {Log.v (TAG, "Utils.getAPKExpensionFiles [60] expapath is not present");}} and {log. V (tag, "Utils .getAPKExpensionFiles [57] not MEDIA_MOUNTED");} string [] retArray = new string [ret.size ()]; ret.toArray (retArray); return rate Arere;}   

... logcat shows this ...

  03-20 21: 04: 24.206: V / GospelofMatthewAudiobook (10965): Utils.getAPKExpansionFiles [37 ] expPath /mnt/sdcard/Android/obb/com.redcricket.GospelofMatthewAudiobook 03-20 21: 04: 24.214: V / GospelofMatthewAudiobook (10965): Utils.getAPKExpansionFiles [60] expPath does not exist   

... The only path exists and the file is still displayed in this screen shot:

Image Details Here Enter I'm pretty sure I have no typo and the path is present. So why the exppath.exists () return will be false.

Thanks for the reply Ted ... but I still get into the logc ....

  03-20 21: 59: 48.198: V / GospelofMatthewAudiobook ( 11988): Utils.getAPKExpansionFiles [37] expPath /mnt/sdcard/Android/obb/com.redcricket.GospelofMatthewAudiobook/main.1.com.redcricket .GospelofMatthewAudiobook.obb 03-20 21: 59: 48.198: V / GospelofMatthewAudiobook (11988 ): Utils.getAPKExpansionFiles [60] expPath does not exist   

... this is that I could have created the directory with Windows and not avd < Code> ADB command to create a DIR and how to file the life of the APK extension on your phone. Need to push?

You need to give the file its own name instead:

  File exppath = new file (root.toString () + EXP_PATH + packageName);   

Use this:

  file exppathdir = new file (root.toString () + EXP_PATH + packageName); File Exception = New File (Exceptions, String.format ("Main.% D.% S.obb", Main Version, Package Name));   

This will work for a main expansion pack. You have a patch that should have the same method to use format String.format ("Patch.% D.% S.obb", Patch Varsian, PackageName)

The path to the complete file should be

  /mnt/sdcard/Android/obb/com.redcricket.GospelofMatthewAudiobook/main.123./mnt/sdcard/Android/obb/com.redcricket . Gospel Matthew AUDIobook.obb    

Comments

Popular posts from this blog

excel vba - How to delete Solver(SOLVER.XLAM) code -

github - Teamcity & Git - PR merge builds - anyway to get HEAD commit hash? -

ios - Replace text in UITextView run slowly -