Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagejava
linenumberstrue
collapsetrue
public class LoaderSample implements LoaderCallback
{
	Context _c; 
	public LoaderSample(Context c)
	{
		this._c = c;
	} 
	
	@Override
	public void onLoaded() 
	{
		//loading the JCE has finished 
		//get provider
		Provider p = Security.getProvider("CERTGATE"); 
		//do something with the provider
		...
	} 
	
	public void startLoading() throws ProviderLoadingFailedException, ProviderSignatureInvalidException, ProviderNotFoundException
	{
		if (ProviderLoader.isProviderInstalled(this._c))
		{
			if (!ProviderLoader.isProviderAvailable())
			{
				ProviderLoader.load(this._c, this);
			}
			else
			{
				//already loaded!
			}
		}
		else
		{
			//not installed!
		}
	}
}

Automated loading via JCEInitTask

...