Tabnine Logo
io.vov.vitamio.utils
Code IndexAdd Tabnine to your IDE (free)

How to use io.vov.vitamio.utils

Best Java code snippets using io.vov.vitamio.utils (Showing top 20 results out of 315)

origin: curtis2/SuperVideoPlayer

/**
 * Base64-encode the given data and return a newly allocated
 * byte[] with the result.
 *
 * @param input  the data to encode
 * @param flags  controls certain features of the encoded output.
 *               Passing {@code DEFAULT} results in output that
 *               adheres to RFC 2045.
 */
public static byte[] encode(byte[] input, int flags) {
  return encode(input, 0, input.length, flags);
}
origin: curtis2/SuperVideoPlayer

/**
 * Gets the resolution,
 * @return a pair to return the width and height
 * */
public static Pair<Integer,Integer> getResolution(Context ctx){
 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR1) {
  return getRealResolution(ctx);
 }
 else {
  return getRealResolutionOnOldDevice(ctx);
 }
}
origin: curtis2/SuperVideoPlayer

public static String getFeatureString() {
  getFeature();
  return cachedFeatureString;
}
origin: curtis2/SuperVideoPlayer

public static String getDeviceFeatures(Context ctx) {
 return getIdentifiers(ctx) + getSystemFeatures() + getScreenFeatures(ctx);
}

origin: curtis2/SuperVideoPlayer

public Crypto(String key) {
  try {
    SecretKeySpec skey = new SecretKeySpec(generateKey(key), "AES");
    setupCrypto(skey);
  } catch (Exception e) {
    Log.e("Crypto", e);
  }
}
origin: curtis2/SuperVideoPlayer

public String rsaEncrypt(InputStream keyStream, byte[] data) {
  try {
    PublicKey pubKey = readKeyFromStream(keyStream);
    Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding");
    cipher.init(Cipher.ENCRYPT_MODE, pubKey);
    byte[] cipherData = cipher.doFinal(data);
    return Base64.encodeToString(cipherData, Base64.NO_WRAP);
  } catch (Exception e) {
    Log.e("rsaEncrypt", e);
    return "";
  }
}
origin: curtis2/SuperVideoPlayer

public static String getSystemFeatures() {
 StringBuilder sb = new StringBuilder();
 sb.append(getPair("android_release", Build.VERSION.RELEASE));
 sb.append(getPair("android_sdk_int", "" + Build.VERSION.SDK_INT));
 sb.append(getPair("device_cpu_abi", Build.CPU_ABI));
 sb.append(getPair("device_model", Build.MODEL));
 sb.append(getPair("device_manufacturer", Build.MANUFACTURER));
 sb.append(getPair("device_board", Build.BOARD));
 sb.append(getPair("device_fingerprint", Build.FINGERPRINT));
 sb.append(getPair("device_cpu_feature", CPU.getFeatureString()));
 return sb.toString();
}
origin: curtis2/SuperVideoPlayer

public String encrypt(String plaintext) {
  if (ecipher == null)
    return "";
  try {
    byte[] ciphertext = ecipher.doFinal(plaintext.getBytes("UTF-8"));
    return Base64.encodeToString(ciphertext, Base64.NO_WRAP);
  } catch (Exception e) {
    Log.e("encryp", e);
    return "";
  }
}
origin: curtis2/SuperVideoPlayer

@Override
public void onTimedTextUpdate(byte[] pixels, int width, int height) {
 Log.i("onSubtitleUpdate: bitmap subtitle, %dx%d", width, height);
 if (mOnTimedTextListener != null)
  mOnTimedTextListener.onTimedTextUpdate(pixels, width, height);
}
origin: curtis2/SuperVideoPlayer

 @Override
 public void onSeekComplete(MediaPlayer mp) {
  Log.d("onSeekComplete");
  if (mOnSeekCompleteListener != null)
   mOnSeekCompleteListener.onSeekComplete(mp);
 }
};
origin: curtis2/SuperVideoPlayer

/**
 * Decode the Base64-encoded data in input and return the data in
 * a new byte array.
 *
 * <p>The padding '=' characters at the end are considered optional, but
 * if any are present, there must be the correct number of them.
 *
 * @param input the input array to decode
 * @param flags  controls certain features of the decoded output.
 *               Pass {@code DEFAULT} to decode standard Base64.
 *
 * @throws IllegalArgumentException if the input contains
 * incorrect padding
 */
public static byte[] decode(byte[] input, int flags) {
  return decode(input, 0, input.length, flags);
}
origin: curtis2/SuperVideoPlayer

public static String getDataDir(Context ctx) {
  ApplicationInfo ai = ctx.getApplicationInfo();
  if (ai.dataDir != null)
    return fixLastSlash(ai.dataDir);
  else
    return "/data/data/" + ai.packageName + "/";
}
origin: curtis2/SuperVideoPlayer

/**
 * 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;
}
origin: curtis2/SuperVideoPlayer

public String rsaEncrypt(InputStream keyStream, String data) {
  try {
    return rsaEncrypt(keyStream, data.getBytes("UTF-8"));
  } catch (UnsupportedEncodingException e) {
    return "";
  }
}
origin: curtis2/SuperVideoPlayer

public static String getName(String uri) {
  String path = getPath(uri);
  if (path != null)
    return new File(path).getName();
  return null;
}
origin: curtis2/SuperVideoPlayer

  public static void deleteDir(File f) {
    if (f.exists() && f.isDirectory()) {
      for (File file : f.listFiles()) {
        if (file.isDirectory())
          deleteDir(file);
        file.delete();
      }
      f.delete();
    }
  }
}
origin: curtis2/SuperVideoPlayer

private void closeFD() {
 if (mFD != null) {
  try {
   mFD.close();
  } catch (IOException e) {
   Log.e("closeFD", e);
  }
  mFD = null;
 }
}

origin: curtis2/SuperVideoPlayer

public void setMimeType(String mimeType) {
 Log.i("setMimeType: %s", mimeType);
 mMimeType = mimeType;
 mFileType = MediaFile.getFileTypeForMimeType(mimeType);
}
origin: curtis2/SuperVideoPlayer

public void suspend() {
 if (isInPlaybackState()) {
  release(false);
  mCurrentState = STATE_SUSPEND_UNSUPPORTED;
  Log.d("Unable to suspend video. Release MediaPlayer.");
 }
}
origin: curtis2/SuperVideoPlayer

 @Override
 public void onTimedText(String text) {
  Log.i("onSubtitleUpdate: %s", text);
  if (mOnTimedTextListener != null)
   mOnTimedTextListener.onTimedText(text);
 }
};
io.vov.vitamio.utils

Most used classes

  • StringUtils
  • ScreenResolution
    Class to get the real screen resolution includes the system status bar. We can get the value by call
  • Base64$Decoder
  • Base64$Encoder
  • Base64
    Utilities for encoding and decoding the Base64 representation of binary data. See RFCs 2045 [http://
  • ContextUtils,
  • Crypto,
  • Device,
  • FileUtils,
  • Log
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now