public static boolean isInitialized(Context ctx){
  vitamioPackage=ctx.getPackageName();
  vitamioLibraryPath=ContextUtils.getDataDir(ctx) + "libs/";
  File dir=new File(getLibraryPath());
  if (dir.exists() && dir.isDirectory()) {
    String[] libs=dir.list();
    if (libs != null) {
      Arrays.sort(libs);
      for (      String L : getRequiredLibs()) {
        if (Arrays.binarySearch(libs,L) < 0) {
          Log.e("Native libs %s not exists!",L);
          return false;
        }
      }
      File lock=new File(getLibraryPath() + LIBS_LOCK);
      BufferedReader buffer=null;
      try {
        buffer=new BufferedReader(new FileReader(lock));
        int appVersion=ContextUtils.getVersionCode(ctx);
        int libVersion=Integer.valueOf(buffer.readLine());
        Log.i("isNativeLibsInited, APP VERSION: %d, Vitamio Library version: %d",appVersion,libVersion);
        if (libVersion == appVersion)         return true;
      }
 catch (      IOException e) {
        Log.e("isNativeLibsInited",e);
      }
catch (      NumberFormatException e) {
        Log.e("isNativeLibsInited",e);
      }
 finally {
        IOUtils.closeSilently(buffer);
      }
    }
  }
  return false;
}

public static boolean isInitialized ( Context ctx ) { vitamioPackage = ctx . getPackageName ( ) ; vitamioLibraryPath = ContextUtils . getDataDir ( ctx ) + "libs/" ; File dir = new File ( getLibraryPath ( ) ) ; if ( dir . exists ( ) && dir . isDirectory ( ) ) { String [ ] libs = dir . list ( ) ; if ( libs != null ) { Arrays . sort ( libs ) ; for ( String L : getRequiredLibs ( ) ) { if ( Arrays . binarySearch ( libs , L ) < 0 ) { Log . e ( "Native libs %s not exists!" , L ) ; return false ; } } File lock = new File ( getLibraryPath ( ) + LIBS_LOCK ) ; BufferedReader buffer = null ; try { buffer = new BufferedReader ( new FileReader ( lock ) ) ; int appVersion = ContextUtils . getVersionCode ( ctx ) ; int libVersion = Integer . valueOf ( buffer . readLine ( ) ) ; Log . i ( "isNativeLibsInited, APP VERSION: %d, Vitamio Library version: %d" , appVersion , libVersion ) ; if ( libVersion == appVersion ) return true ; } catch ( IOException e ) { Log . e ( "isNativeLibsInited" , e ) ; } catch ( NumberFormatException e ) { Log . e ( "isNativeLibsInited" , e ) ; } finally { IOUtils . closeSilently ( buffer ) ; } } } return false ; }
check if vitamio is initialized at this device
