Back to project page popcorn-android.
The source code is released under:
GNU General Public License
If you think the Android project popcorn-android 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 io.popcorntime.android; //from w w w . ja v a 2 s .c om import org.apache.cordova.Config; import org.apache.cordova.CordovaActivity; import org.nodejs.core.NodeJSService; import org.nodejs.core.NodeJSService.LocalBinder; import android.content.ComponentName; import android.content.Intent; import android.content.ServiceConnection; import android.os.Bundle; import android.os.IBinder; import android.util.Log; import android.widget.Toast; public class PopcornTime extends CordovaActivity { boolean mBound; NodeJSService mServer; ServiceConnection mConnection = new ServiceConnection() { public void onServiceConnected(ComponentName name, IBinder service) { Toast.makeText(PopcornTime.this, "Service is connected", Toast.LENGTH_LONG).show(); mBound = true; mServer = ((LocalBinder) service).getActivity(); } public void onServiceDisconnected(ComponentName name) { Toast.makeText(PopcornTime.this, "Service is disconnected", Toast.LENGTH_LONG).show(); mBound = false; mServer = null; } }; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); super.init(); startService(new Intent(this, NodeJSService.class)); Log.d("PopcornTime", "App created!"); super.loadUrl(Config.getStartUrl()); } }