[AppLauncherPlugin] Error code 3 Activity not found for package name

[AppLauncherPlugin] Error code 3 Activity not found for package name

  
Forge Component
(4)
Published on 2017-11-15 by Eduardo Jauch
4 votes
Published on 2017-11-15 by Eduardo Jauch

Hello,


I was trying out this plugin with the following JSON:
{"packageName":"com.outsystemscloud.franciscofreire.XX://XX/Screen1",
"dataType":"text/plain",
"extras":[]}


In the package name i have my URI, AppId://EspaceName/ScreenName but i am geting error 3, Activity not found for package name,
Am i doing anything wrong?

Best regards,
Francisco Freire.

Hello Francisco,

I'm sorry, I am no expert in Android programming, but I know that the code where this plugin is built up is "sensitive" to the parameters you pass.

For example, to use it to lauch WhatsApp to send a text message, I use this JSon:

"{
  ""packageName"":""com.whatsapp/android.intent.action.SEND"", 
  ""dataType"":""text/plain"", 
  ""extras"":[{
         ""name"":""android.intent.extra.TEXT"",
         ""value"":""this is a test"", 
         ""dataType"":""String""
    }]
}"

Notice that I am using the app identifier/action, in this case, a system action (SEND).

If you want to launch your application using an URI instead of the package name, you have to change your JSON to something like this (I think, never tested):

"{
  ""uri"":""com.outsystemscloud.franciscofreire.XX://XX/Screen1"", 
  ""dataType"":""text/plain"", 
}"

But the code, right now, can't pass extras when using the URI and can receive information back from the other app only when using activity (not URI).

Hello Eduardo,
How can i call an action from my other app?
Would it be" com.outsystemscloud.franciscofreire.XX://XX.action.ActionName"?

Thank you,
Francisco Freire

Hello Francisco,

No.
In order to launch an application using an Activity, you have to use an Activity from System (like 

android.intent.action.SEND

And your other application must provide an intent-filter in the manifest.
If more applications capture this same activity, the choser of the mobile will be launched to the user to chose the app.

You can specify in your other application (manifest) the configuration to listen to a specific activity that only your application listen to, and this will make the system call your app directly.

If your other application is an OutSystems mobile app also, than is more complicated, as you will have to create a "fake" plugin in order to provide in the manifest of the plugin the correct configuration, and I never did or tested this (is in the plans, but no time right now).

(I fixed the previous answer to show an example of a possible action for your other application)

https://developer.android.com/guide/components/intents-filters.html

Cheers

Hello Francisco,

Was you able to use this plugin with success?
Had you any error or problem?

Cheers.

Hello Eduardo,
Since the last message i had no time to create the "fake" intent plugin to do the request directly to the outsystems app.

Best regards,
Francisco Freire.