2017년 6월 6일 화요일

receive data from another app


Can AI read data sent from another app? I have tried get start value but didn't work.
I'm using Tasker to open my app and send a value as a Data Field, but how do I get my AI app to read it?

--
And Get plain start text Didn't work!

--
see this AI1 example http://puravidaapps.com/snippets1.php#fetchdata how to get data using get plain start text block
the extra key must be APP_INVENTOR_START and in the extra value you can pass your data

--
Unfortunately Tasker doesn't open my app in the same way another AI app would. It will open my app and it will give me the option to send what it calls a data field.
From it's help doc "if data is specified, it is passed to the application when launched. Not all applications examine the data field, however."

--
I've had an other chance to have a poke around Tasker, and found under select action category/Misc there is send intent.
I used the example provided by Taifun to fill in the blanks.

You will have to find the package and class name. You can find how to do that here. http://beta.appinventor.mit.edu/learn/reference/other/activitystarter.html

look for  "Starting Another App Inventor Application from your App Inventor App"

In Tasker
Send Intent


Action
         
Cat
Default

Mine Type

Data

Extra (you put the key and the value separated with a colon)
APP_INVENTOR_START:Helo from tasker
Extra

Package
appinventor.ai_HomerSimpson.HelloPurr

Class
appinventor.ai_HomerSimpson.HelloPurr.Screen1

Target

Activity

If

And in AI
get plain start text will receive the value.


--

댓글 없음:

댓글 쓰기