Use the following sample code to launch my app in different ways.
It can also help you figure out how to launch my app using task/app automation tools/apps.
ps. see this post for more integration options via built-in web server.
- Code: Select all
// launch matrix mode of paid version
Intent intent = new Intent( Intent.ACTION_MAIN );
intent.addCategory( Intent.CATEGORY_LAUNCHER );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
ComponentName cn = new ComponentName( "com.rcreations.WebCamViewerPaid", "com.rcreations.WebCamViewerPaid.IpCamViewerActivity" );
intent.setComponent( cn );
intent.putExtra( "selectView", "MATRIX_VIEW" );
startActivity( intent );
// launch matrix mode of paid version for specific group name (v5.2.5 or newer)
Intent intent = new Intent( Intent.ACTION_MAIN );
intent.addCategory( Intent.CATEGORY_LAUNCHER );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
ComponentName cn = new ComponentName( "com.rcreations.WebCamViewerPaid", "com.rcreations.WebCamViewerPaid.IpCamViewerActivity" );
intent.setComponent( cn );
intent.putExtra( "selectView", "MATRIX_VIEW" );
intent.putExtra( "selectGroupName", "group name" );
startActivity( intent );
// launch gallery mode of paid version
Intent intent = new Intent( Intent.ACTION_MAIN );
intent.addCategory( Intent.CATEGORY_LAUNCHER );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
ComponentName cn = new ComponentName( "com.rcreations.WebCamViewerPaid", "com.rcreations.WebCamViewerPaid.IpCamViewerActivity" );
intent.setComponent( cn );
intent.putExtra( "selectView", "GALLERY_VIEW" );
startActivity( intent );
// launch gallery mode of paid version for specific camera
Intent intent = new Intent( Intent.ACTION_MAIN );
intent.addCategory( Intent.CATEGORY_LAUNCHER );
intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
intent.setFlags( Intent.FLAG_ACTIVITY_CLEAR_TOP );
ComponentName cn = new ComponentName( "com.rcreations.WebCamViewerPaid", "com.rcreations.WebCamViewerPaid.IpCamViewerActivity" );
intent.setComponent( cn );
intent.putExtra( "selectView", "GALLERY_VIEW" );
intent.putExtra( "selectCameraName", "my cam name" );
startActivity( intent );
// for the Lite version of the app, use the following ComponentName:
ComponentName cn = new ComponentName( "com.rcreations.ipcamviewer", "com.rcreations.ipcamviewer.WebCamViewerActivity" );
// for the Basic version of the app, use the following ComponentName:
ComponentName cn = new ComponentName( "com.rcreations.ipcamviewerBasic", "com.rcreations.ipcamviewerBasic.WebCamViewerActivity" );