Back to project page AndroidPlugin.
The source code is released under:
MIT License
If you think the Android project AndroidPlugin listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.limemobile.app.demo.pluginhost; /*from ww w. j a va 2 s . com*/ import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import android.content.Context; import android.content.res.AssetManager; import com.limemobile.app.demo.pluginhost.MainActivity.PluginItem; import com.limemobile.app.plugin.PluginHostApplication; import com.limemobile.app.plugin.internal.PluginClientManager; public class MyApplication extends PluginHostApplication { @Override public void onCreate() { super.onCreate(); } @Override protected void loadPluginClients() { AssetManager asset = getAssets(); try { for (String s : asset.list("apks")) { File dex = getDir("dex", Context.MODE_PRIVATE); dex.mkdir(); File plugin = new File(dex, s); InputStream fis = getAssets().open("apks/" + s); FileOutputStream fos = new FileOutputStream(plugin); byte[] buffer = new byte[0xFF]; int len; while ((len = fis.read(buffer)) > 0) { fos.write(buffer, 0, len); } fis.close(); fos.close(); PluginClientManager.sharedInstance(this).addPluginClient( plugin.getAbsolutePath()); } } catch (FileNotFoundException e) { } catch (IOException e) { } } }