Page 1 of 2

launching app with task managers and other automation apps

PostPosted: Sat Apr 09, 2011 3:28 pm
by N4Spd
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 );
       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 );
       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 );
       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 );
       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" );

Re: launching app with task managers and other automation apps

PostPosted: Mon Apr 18, 2011 7:58 am
by scoutx
Thanks Rob - going to see what I can do with Tasker on this and some automation.

Re: launching app with task managers and other automation apps

PostPosted: Tue Aug 14, 2012 9:30 pm
by calistra
When I execute this code I get an
ActivityNotFoundException
Unable to find explicit activity class {com.rcreations.ipcamviewerFree/com.rcreations.ipcamviewer.WebCamViewerActivity}
have you declared this activity in your Android Manifest?

which suggests that the intent should be put into the manifest.

can you suggest the relevant lines that I need to put in the manifest?

---- code ----
Code: Select all
   int camera_handler = CAM_FREE_APP;
   Intent intent;         
   ComponentName cn;
   if (camera_handler ==CAM_FREE_APP) {
      cn = new ComponentName( "com.rcreations.ipcamviewerFree", "com.rcreations.ipcamviewer.WebCamViewerActivity" );
      camera_handler = CAM_PAID_GALLERY; // just force it to one of the paid options...
   } else {
      cn = new ComponentName( "com.rcreations.WebCamViewerPaid", "com.rcreations.WebCamViewerPaid.IpCamViewerActivity" );
   }

------ this is inside a switch - rest omitted

Code: Select all
   // launch gallery mode of paid / free version
        intent = new Intent( Intent.ACTION_MAIN );
   intent.addCategory( Intent.CATEGORY_LAUNCHER );
   intent.setFlags( Intent.FLAG_ACTIVITY_NEW_TASK );
   intent.setComponent( cn );
   intent.putExtra( "selectView", "GALLERY_VIEW" );
   startActivity( intent );
-----

Re: launching app with task managers and other automation apps

PostPosted: Mon Apr 01, 2013 9:54 am
by stbi
Was anyone able to configure this in Tasker?

I hadn't been successful in my attempts so far. The app is opened, but the camera is not selected.

What I did is shown in the attached screenshots.

Any ideas?

Re: launching app with task managers and other automation apps

PostPosted: Sat Jan 18, 2014 12:51 pm
by Javier
Has anyone figured out a way to do this in tasker or is there a way to create camera shortcuts(which can be opened by tasker)?
Thanks,
Javier

Re: launching app with task managers and other automation apps

PostPosted: Tue Jan 21, 2014 3:24 pm
by N4Spd

Re: launching app with task managers and other automation apps

PostPosted: Wed Jan 29, 2014 6:00 pm
by iostream212
Change ACTION to:
Code: Select all
android.intent.action.MAIN

CAT is correct as 'launcher'
Mime: Empty
Data: Empty
Extra: specify here for gallery or matrix view either
Code: Select all
selectView:GALLERY_VIEW
or
Code: Select all
selectView:MATRIX_VIEW

Extra: specify camera for gallery view:
Code: Select all
selectCameraName:EnterCameraName

Package is correct
Leave CLASS Empty.

Re: launching app with task managers and other automation apps

PostPosted: Mon Feb 10, 2014 9:37 pm
by fraschizzato
Is it possible with tasker (or other app) to enter direclty in record mode on?

Re: launching app with task managers and other automation apps

PostPosted: Tue Mar 04, 2014 7:17 am
by Javier
iostream212 wrote:Change ACTION to:
Code: Select all
android.intent.action.MAIN

CAT is correct as 'launcher'
Mime: Empty
Data: Empty
Extra: specify here for gallery or matrix view either
Code: Select all
selectView:GALLERY_VIEW
or
Code: Select all
selectView:MATRIX_VIEW

Extra: specify camera for gallery view:
Code: Select all
selectCameraName:EnterCameraName

Package is correct
Leave CLASS Empty.


Thank You iostream212!

Just in case anyone else is using this you also have to add the Group Name to the "Extra" after Matrix_View for it to work (If not setup I think it is "All")
Code: Select all
selectGroupName:Group_Name

Re: launching app with task managers and other automation apps

PostPosted: Mon Apr 21, 2014 12:21 pm
by spoteat
Has anyone gotten this to work? I have been unsuccessful in my attempts.