Code example for DexClassLoader

Methods: loadClass

1
    private EffectsInterface SelectImplementation() { 
    	EffectsInterface efi = null;
    	 
    	String defaultLibPath =  mActivity.getAssets() + "/Plugins/effectjava.jar";
    	File dexOutputDir = mActivity.getDir("dex", Context.MODE_PRIVATE);
    	DexClassLoader dcl = new DexClassLoader(defaultLibPath,
                dexOutputDir.getAbsolutePath(),
                null, 
                ClassLoader.getSystemClassLoader());
    	try { 
			Class<?> clazz = dcl.loadClass("EffectJavaImpl");
			efi = (EffectsInterface) clazz.newInstance();
		} catch (ClassNotFoundException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (InstantiationException e) {
			// TODO Auto-generated catch block 
			e.printStackTrace();
		} catch (IllegalAccessException e) {
			// TODO Auto-generated catch block 
Connect your IDE to all the code out there  Get Codota for Java