IP Cam Viewer     My Amazon IP Cameras     Cheap Wifi Pan/Tilt/Audio Camera with Good Night Vision    

launching app with task managers and other automation apps

Support for my free Android Applications.

launching app with task managers and other automation apps

Postby N4Spd » Sat Apr 09, 2011 3:28 pm

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.

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 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" );
N4Spd
 
Posts: 1200
Joined: Sun Feb 08, 2009 3:25 pm

Re: launching app with task managers and other automation apps

Postby scoutx » Mon Apr 18, 2011 7:58 am

Thanks Rob - going to see what I can do with Tasker on this and some automation.
User avatar
scoutx
 
Posts: 4
Joined: Sat Feb 05, 2011 7:23 am

Re: launching app with task managers and other automation apps

Postby calistra » Tue Aug 14, 2012 9:30 pm

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 );
-----
calistra
 
Posts: 1
Joined: Tue Aug 14, 2012 9:02 pm

Re: launching app with task managers and other automation apps

Postby stbi » Mon Apr 01, 2013 9:54 am

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?
Attachments
TaskerSendIntent.png
TaskerSendIntent.png (58.07 KiB) Viewed 250 times
stbi
 
Posts: 4
Joined: Sat Mar 17, 2012 10:39 am


Return to Support

Who is online

Users browsing this forum: No registered users and 4 guests