io.vov.vitamio
Class VitamioInstaller

java.lang.Object
  extended by io.vov.vitamio.VitamioInstaller

public class VitamioInstaller
extends java.lang.Object

It's recommended to use this class to check if Vitamio Plugin is installed in the device before using any other classes and functions.


Nested Class Summary
static class VitamioInstaller.VitamioNotCompatibleException
          This exception will be thrown when Vitamio not compatible with the device.
static class VitamioInstaller.VitamioNotFoundException
          This exception will be thrown when Vitamio not found in the device.
 
Field Summary
static java.lang.String VITAMIO_PACKAGE_ARMV6
           
static java.lang.String VITAMIO_PACKAGE_ARMV6_VFP
           
static java.lang.String VITAMIO_PACKAGE_ARMV7_NEON
           
static java.lang.String VITAMIO_PACKAGE_ARMV7_VFPV3
           
static int VITAMIO_VERSION_CODE
           
static java.lang.String VITAMIO_VERSION_NAME
           
 
Constructor Summary
VitamioInstaller(Context ctx)
           
 
Method Summary
 Dialog buildInstallerDialog(java.lang.String title, java.lang.String msg, java.lang.String button)
          A simple helper dialog to guide the user install a compatible Vitamio package, you may build a more beautiful one by yourself.
 Dialog buildNotCompatibleDialog(java.lang.String title, java.lang.String msg, java.lang.String button)
          A simple helper dialog telling user Vitamio is not compatible with the device, you may build a more beautiful one by yourself.
static java.lang.String checkVitamioInstallation(Context ctx)
          Check if a Vitamio package is installed
 VitamioInstaller clearSources()
           
 VitamioInstaller fillDefaultSources()
           
static java.lang.String getCompatiblePackage()
           
static java.lang.String getLibraryPath(Context ctx)
          Get the absolute path to Vitamio's library
 java.util.Map<java.lang.String,java.lang.String> getSources()
           
 VitamioInstaller putSource(java.lang.String title, java.lang.String url)
           
 void showInstallerDialog(java.lang.String title, java.lang.String msg, java.lang.String button)
          A simple helper dialog to guide the user install a compatible Vitamio package, you may build a more beautiful one by yourself.
 void showNotCompatibleDialog(java.lang.String title, java.lang.String msg, java.lang.String button)
          A simple helper dialog telling user Vitamio is not compatible with the device, you may build a more beautiful one by yourself.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VITAMIO_VERSION_CODE

public static final int VITAMIO_VERSION_CODE
See Also:
Constant Field Values

VITAMIO_VERSION_NAME

public static final java.lang.String VITAMIO_VERSION_NAME
See Also:
Constant Field Values

VITAMIO_PACKAGE_ARMV6

public static final java.lang.String VITAMIO_PACKAGE_ARMV6
See Also:
Constant Field Values

VITAMIO_PACKAGE_ARMV6_VFP

public static final java.lang.String VITAMIO_PACKAGE_ARMV6_VFP
See Also:
Constant Field Values

VITAMIO_PACKAGE_ARMV7_VFPV3

public static final java.lang.String VITAMIO_PACKAGE_ARMV7_VFPV3
See Also:
Constant Field Values

VITAMIO_PACKAGE_ARMV7_NEON

public static final java.lang.String VITAMIO_PACKAGE_ARMV7_NEON
See Also:
Constant Field Values
Constructor Detail

VitamioInstaller

public VitamioInstaller(Context ctx)
Method Detail

fillDefaultSources

public VitamioInstaller fillDefaultSources()

putSource

public VitamioInstaller putSource(java.lang.String title,
                                  java.lang.String url)

getSources

public java.util.Map<java.lang.String,java.lang.String> getSources()

clearSources

public VitamioInstaller clearSources()

showInstallerDialog

public void showInstallerDialog(java.lang.String title,
                                java.lang.String msg,
                                java.lang.String button)
A simple helper dialog to guide the user install a compatible Vitamio package, you may build a more beautiful one by yourself.

Parameters:
title - dialog's title
button - text on the dialog's button

buildInstallerDialog

public Dialog buildInstallerDialog(java.lang.String title,
                                   java.lang.String msg,
                                   java.lang.String button)
A simple helper dialog to guide the user install a compatible Vitamio package, you may build a more beautiful one by yourself.

Parameters:
title - dialog's title
button - text on the dialog's button

showNotCompatibleDialog

public void showNotCompatibleDialog(java.lang.String title,
                                    java.lang.String msg,
                                    java.lang.String button)
A simple helper dialog telling user Vitamio is not compatible with the device, you may build a more beautiful one by yourself.

Parameters:
title - dialog's title
msg - message displayed on dialog
button - text on the dialog's button

buildNotCompatibleDialog

public Dialog buildNotCompatibleDialog(java.lang.String title,
                                       java.lang.String msg,
                                       java.lang.String button)
A simple helper dialog telling user Vitamio is not compatible with the device, you may build a more beautiful one by yourself.

Parameters:
title - dialog's title
msg - message displayed on dialog
button - text on the dialog's button

getCompatiblePackage

public static java.lang.String getCompatiblePackage()
Returns:
the best compatible Vitamio package name

checkVitamioInstallation

public static java.lang.String checkVitamioInstallation(Context ctx)
                                                 throws VitamioInstaller.VitamioNotCompatibleException,
                                                        VitamioInstaller.VitamioNotFoundException
Check if a Vitamio package is installed

Parameters:
ctx - a Context
Returns:
the Vitamio package name installed in this device, it may be the most compatible package, check getCompatiblePackage()
Throws:
VitamioInstaller.VitamioNotCompatibleException
VitamioInstaller.VitamioNotFoundException

getLibraryPath

public static java.lang.String getLibraryPath(Context ctx)
                                       throws VitamioInstaller.VitamioNotCompatibleException,
                                              VitamioInstaller.VitamioNotFoundException
Get the absolute path to Vitamio's library

Parameters:
ctx - a Context
Returns:
the absolute path to the libffmpeg.so
Throws:
VitamioInstaller.VitamioNotCompatibleException
VitamioInstaller.VitamioNotFoundException