Ejemplo n.º 1
0
 public void getOpenerInfo(String[] parm) {
   EBrowserWindow curWind = mBrwView.getBrowserWindow();
   if (null == curWind) {
     return;
   }
   jsCallback(function_getOpenerInfo, 0, EUExCallback.F_C_TEXT, curWind.getOpener());
 }
Ejemplo n.º 2
0
 public void installApp(String[] parm) {
   if (parm.length < 1) {
     return;
   }
   EBrowserWindow curWind = mBrwView.getBrowserWindow();
   if (null == curWind) {
     return;
   }
   String inAppPath = parm[0];
   if (null == inAppPath || 0 == inAppPath.trim().length()) {
     return;
   }
   inAppPath =
       BUtility.makeRealPath(
           inAppPath, mBrwView.getCurrentWidget().m_widgetPath, curWind.getWidgetType());
   if (inAppPath.contains("wgtRes")) {
     InputStream is;
     try {
       // String tPath = m_eContext.getCacheDir().getAbsolutePath() +
       // "/temp.apk";
       String tPath = Environment.getExternalStorageDirectory().getPath() + "/temp.apk";
       is = mContext.getAssets().open(inAppPath);
       File file = new File(tPath);
       file.createNewFile();
       FileOutputStream fos = new FileOutputStream(file);
       byte[] temp = new byte[8 * 1024];
       int i = 0;
       while ((i = is.read(temp)) > 0) {
         fos.write(temp, 0, i);
       }
       fos.close();
       is.close();
       inAppPath = tPath;
       // modify permission
       // String command = "chmod777" + " " + inAppPath;
       // Runtime.getRuntime().exec(command);
     } catch (IOException e) {
       Toast.makeText(
               mContext,
               ResoureFinder.getInstance().getString(mContext, "error_sdcard_is_not_available"),
               Toast.LENGTH_SHORT)
           .show();
       return;
     }
   }
   // install apk.
   Intent intent = new Intent(Intent.ACTION_VIEW);
   intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
   MimeTypeMap type = MimeTypeMap.getSingleton();
   String mime = type.getMimeTypeFromExtension("apk");
   intent.setDataAndType(Uri.parse("file://" + inAppPath), mime);
   mContext.startActivity(intent);
 }
Ejemplo n.º 3
0
 public void setMySpaceInfo(String[] parm) {
   if (parm.length < 3) {
     return;
   }
   EBrowserWindow curWind = mBrwView.getBrowserWindow();
   if (null == curWind) {
     return;
   }
   String inForResult = parm[0];
   String inAnimiId = parm[1];
   String inInfo = parm[2];
   curWind.getBrowser().setMySpaceInfo(inForResult, inAnimiId, inInfo);
 }