When is onBind or onCreate called in an android service browser plugin?

Posted by anselm on Stack Overflow See other posts from Stack Overflow or by anselm
Published on 2010-06-16T09:59:11Z Indexed on 2010/06/16 10:02 UTC
Read the original article Hit count: 336

Filed under:
|
|
|

I have adapted the example plugin of the android source and the browser recognises the plugin without any problem. Here is an extract of AndroidManifest.xml:

<application android:icon="@drawable/icon" android:label="@string/app_name" android:debuggable="true">
   <service android:name="com.domain.plugin.PluginService">
        <intent-filter>
              <action android:name="android.webkit.PLUGIN" />
        </intent-filter>
    </service>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.webkit.permission.PLUGIN"></uses-permission>

The actual Service class looks like so:

public class PluginService extends Service {

@Override
public IBinder onBind(Intent arg0) {
    Log.d("PluginService", "onBind");
    return null;
}

@Override
public void onCreate() {
    Log.d("PluginService", "onCreate");
    // TODO Auto-generated method stub
    super.onCreate();
             AssetInstaller.getInstance(this).installAssets("/data/data/com.domain.plugin");
}

}

The AssetInstaller code is supposed to extract some files required by the actual plugin into the /data/data/com.domain.plugin directory, however wether onBind nor onCreate are called. But I get lot's of debug trace of the actual libnpplugin.so file I'm using.

So the puzzle is when and under what circumstance is the Service bound or created in case of a browser plugin. As things look the service seems to be a dummy service.

Having said that, is there another intent that can be executed at installation time probably?

The only solution I see right now is installing the needed files from the native plugin code instead.

Any ideas? I know this is quite a tricky question ;)

© Stack Overflow or respective owner

Related posts about android

Related posts about service