当前位置: 首页>>代码示例>>Java>>正文


Java ContextUtils类代码示例

本文整理汇总了Java中io.vov.vitamio.utils.ContextUtils的典型用法代码示例。如果您正苦于以下问题:Java ContextUtils类的具体用法?Java ContextUtils怎么用?Java ContextUtils使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ContextUtils类属于io.vov.vitamio.utils包,在下文中一共展示了ContextUtils类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: extractLibs

import io.vov.vitamio.utils.ContextUtils; //导入依赖的package包/类
private static boolean extractLibs(Context ctx, int rawID) {
  long begin = System.currentTimeMillis();
  final int version = ContextUtils.getVersionCode(ctx);
  Log.d("loadLibs start " + version);
  File lock = new File(getLibraryPath() + LIBS_LOCK);
  if (lock.exists())
    lock.delete();
  String libPath = copyCompressedLib(ctx, rawID, "libarm.so");
  Log.d("copyCompressedLib time: " + (System.currentTimeMillis() - begin) / 1000.0);
  boolean inited = native_initializeLibs(libPath, getLibraryPath(), String.valueOf(Vitamio.getVitamioType()));
  new File(libPath).delete();
  FileWriter fw = null;
  try {
    lock.createNewFile();
    fw = new FileWriter(lock);
    fw.write(String.valueOf(version));
    return true;
  } catch (IOException e) {
    Log.e("Error creating lock file", e);
  } finally {
    Log.d("initializeNativeLibs: " + inited);
    Log.d("loadLibs time: " + (System.currentTimeMillis() - begin) / 1000.0);
    IOUtils.closeSilently(fw);
  }
  return false;
}
 
开发者ID:shegang,项目名称:meishiDemo,代码行数:27,代码来源:Vitamio.java

示例2: isInitialized

import io.vov.vitamio.utils.ContextUtils; //导入依赖的package包/类
/**
   * Check if Vitamio is initialized at this device
   *
   * @param ctx Android Context
   * @return true if the Vitamio has been initialized.
   */
  @SuppressLint("NewApi")
public static boolean isInitialized(Context ctx) {
    vitamioPackage = ctx.getPackageName();
    
  if(VERSION.SDK_INT > 23) {
    vitamioLibraryPath = ctx.getApplicationInfo().nativeLibraryDir + "/";
    }else{
	vitamioLibraryPath = ContextUtils.getDataDir(ctx) + "lib/";
	}
    return true;
  }
 
开发者ID:Leavessilent,项目名称:QuanMinTV,代码行数:18,代码来源:Vitamio.java

示例3: isInitialized

import io.vov.vitamio.utils.ContextUtils; //导入依赖的package包/类
/**
 * Check if Vitamio is initialized at this device
 *
 * @param ctx Android Context
 * @return true if the Vitamio has been initialized.
 */
@SuppressLint("NewApi")
public static boolean isInitialized(Context ctx) {
    vitamioPackage = ctx.getPackageName();

    vitamioLibraryPath = ctx.getApplicationInfo().nativeLibraryDir + "/";
    vitamioDataPath = ContextUtils.getDataDir(ctx) + "lib/";
    browserlibraryPath = ctx.getApplicationContext().getDir("libs", Context.MODE_PRIVATE).getPath();

    return true;
}
 
开发者ID:WangZhiYao,项目名称:VideoDemo,代码行数:17,代码来源:Vitamio.java

示例4: isInitialized

import io.vov.vitamio.utils.ContextUtils; //导入依赖的package包/类
/**
 * Check if Vitamio is initialized at this device
 *
 * @param ctx Android Context
 * @return true if the Vitamio has been initialized.
 */
public static boolean isInitialized(Context ctx) {
  vitamioPackage = ctx.getPackageName();
  vitamioLibraryPath = ContextUtils.getDataDir(ctx) + "lib/";
  return true;
}
 
开发者ID:coding-dream,项目名称:TPlayer,代码行数:12,代码来源:Vitamio.java


注:本文中的io.vov.vitamio.utils.ContextUtils类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。