2017년 6월 2일 금요일

file trigger


Could someone tell me if there is a function file trigger in app inventor ?
My requirement is to launch a certain action whenever a file is created (for example whenever a picture is taken)

--
you can use the 'when File GotText' trigger in combination with the clock

Set the Timer to an interval 
when Tmer fires try to read the file
if succsessful, the 'when File.GotText' fires (that is your trigger)
if not, you'll get an error message. To avoid this use the 'When ErrorOccured' block (can be empty or filled with action)

--
My requirement is to launch a certain action whenever a file is created (for example whenever a picture is taken)
use the Camera.AfterPicture event to launch your action

--
Great !

Thank you,

-- 
The camera.afterpicture event only works when starting the camera app from within the custom app itself ?
This would not work as a sort of background monitoring app ?

If I want to use the camera app provided by the manufacturer (huawei in this case) I get many options to improve image quality.
Let's say I take a picture directly from that app,
then would my own app kick in and do an afterpicture routine ?

-- 
app
yes

app
Let's say I take a picture directly from that app,
app
unfortunately not, because App Inventor apps can't run in the background
probably later this year we will get the services feature...

-- 
It's possible to take directory listings and compare them to one another,
to see what has changed.

Maybe you can make that work.

-- 
The solution Rudolph proposed seems to be the best one for now.
I'm also looking at automagic or tasker which has those functions build-in (file moved, changed, etc..) and a way to link those with AI2.

-- 

댓글 없음:

댓글 쓰기