예제 #1
0
 private String __startServer() {
   String errmsg = "";
   try {
     AndroidFile f = new AndroidFile(localPath);
     Context ctx = cordova.getActivity().getApplicationContext();
     if (!fromApplicationData) {
       AssetManager am = ctx.getResources().getAssets();
       f.setAssetManager(am);
       dumpAssets(am);
     }
     server = new WebServer(port, f, cordovaRoot, ctx.getResources().getAssets());
   } catch (IOException e) {
     errmsg = String.format("IO Exception: %s", e.getMessage());
     Log.w(LOGTAG, errmsg);
   }
   return errmsg;
 }