[Article] Article: tasker, snap a picture after entering wrong unlock code

6gsdZlp.png

This spawned from a conversation in the last Tasker thread I made. Before we start, yes there are apps that will do this. However, Tasker does it too and much, much more. Personally, I would rather have a single app running doing many different things for me than twenty apps running each doing one thing. And since some of these apps aren't free, Tasker may end up being cheaper.

Quick side note: The Tasker UI is seriously dated. It was written back for the very first Android phone, the G1. Since then things have changed leaps and bounds. Most notably was Google updating the entire Android UI with what they termed the Holo theme. Pent, the writer of Tasker, has been taking the last couple months to update Tasker using new, more efficient APIs and also adding the Holo theme. He has been releasing the betas here. If you've tried Tasker before but found it too daunting, its probably worth your while to check out the beta. It's what I've been using for months and is extremely stable.

You will need the following items for this project:
  • A rooted phone (not free)
  • Tasker (not free)
  • Secure settings (free)
  • Dropbox (free)
  • Dropsync (free)

The process here is that after the wrong unlock code is entered twice, a picture will be taken with the front facing cam, the coarse GPS location will be recorded, and both will be uploaded to your Dropbox account. This one is pretty simple to setup, let's get started.

Profile: Remember from the previous tutorials, a profile means, "When this happens..." So we want to check for the unlock code being enter wrong twice. The Secure Settings plugin will do just that. Create a new profile called 'FaceCapture'. With it we will detect a State of Failed Login Attempts, setting it to 2.

Task: Back to the previous tutorials, a task means, "Do this." So when the profile is activated by the wrong lock code, we're going to do three things. Create a new task called 'FaceCapture' and set it to do the following:
  • Media > Take Photo > Camera: Front, Filename: %DATE, Naming Sequence: Series
  • File > Write File > File: DCIM/Tasker/%DATE.%TIME.txt, Append: Off
  • Note: Text of file should be: %LOC %LOCACC %LOCN %LOCNACC (This is what gives you coarse location information.)
  • Plugin > Dropsync > Sync now

Tasker automatically puts the picture in the DCIM/Tasker folder. Then you add the location info to the same folder. Finally, setup Dropsync to sync that folder to your Dropbox and then delete the local copy.

That's it. It took me much longer to write than it will actually take you to do it. However, I've attached the Tasker XML files for you to import yourself if you're really lazy.
 
I would have to have it set on 3 tries or I'd end up with a lot of pics of myself with weird faces.

You should make it send the pic to the MMS thread
 
Im messing around with tasker to see if i can set an alarm remotely somehow.

Like when im at work and i learn i have a 9am meetings, id like to be able to message my phone somehow from a pc or sms (google voice via the pc) and have it set an alarm for earlier than i would normally wake up.
 
Im messing around with tasker to see if i can set an alarm remotely somehow.

Like when im at work and i learn i have a 9am meetings, id like to be able to message my phone somehow from a pc or sms (google voice via the pc) and have it set an alarm for earlier than i would normally wake up.

Why remotely? I just tell my phone: Turn alarm on in (insert # of mins/hrs, etc): or Turn alarm on at: (insert time)
 
Building off the alarm thing, ive been working on streamlining my alarm process.

My alarm is at a different time every morning. I hit a button before i go to bed (or more accurately, 6 buttons right now, i would like to hit a single button), that calculates my ideal sleep time and wakes me up at the end of a 90 minute sleep cycle.

It sounds like BS, but i wake up so much more refreshed if my alarm isnt going off in the middle of a sleep cycle, it really works.
 
Im messing around with tasker to see if i can set an alarm remotely somehow.

Like when im at work and i learn i have a 9am meetings, id like to be able to message my phone somehow from a pc or sms (google voice via the pc) and have it set an alarm for earlier than i would normally wake up.

That seems interesting. Let's see...
 
I don't think it can interface with the actual Android alarm. So you'd probably have to build the 'alarm' inside Tasker which is easy enough to do.

You would probably need two profiles.

1. Read the SMS, parse out the text into variables, pass the time to profile 2 and enable it.
2. When xx:xx time rolls around, play music, then disable the profile

Seems an interesting idea tho. Gonna flesh this out and see what I can come up with.
 
I don't think it can interface with the actual Android alarm. So you'd probably have to build the 'alarm' inside Tasker which is easy enough to do.

You would probably need two profiles.

1. Read the SMS, parse out the text into variables, pass the time to profile 2 and enable it.
2. When xx:xx time rolls around, play music, then disable the profile

Seems an interesting idea tho. Gonna flesh this out and see what I can come up with.

Thats what im seeing too, android alarms are surprisingly hard to work with.

I may end up just coding a new alarm app. Itll be ugly, but functional.
 
Thats what im seeing too, android alarms are surprisingly hard to work with.

I may end up just coding a new alarm app. Itll be ugly, but functional.

You don't need the whole app. You just need Tasker to play music or noise at a certain time. That's easy.
 
Profile 1: Triggered when %SMSALARM set
Task 1a: Play music, if %SMSALARM = %TIME
Task 1b: Disable Profile 1, if %SMSALARM = %TIME
Task 1c: Wait 1 minute
Task 1d: Goto 1a.

Now all you have to do is create another profile to parse out the SMS, which is stupid easy. Have it look for a trigger word and a time, separated by a comma.
 
Building off the alarm thing, ive been working on streamlining my alarm process.

My alarm is at a different time every morning. I hit a button before i go to bed (or more accurately, 6 buttons right now, i would like to hit a single button), that calculates my ideal sleep time and wakes me up at the end of a 90 minute sleep cycle.

It sounds like BS, but i wake up so much more refreshed if my alarm isnt going off in the middle of a sleep cycle, it really works.

I think there are already apps for that. How do you do that now? I mean, do you just do the math from the time you go to bed?
 
I think there are already apps for that. How do you do that now? I mean, do you just do the math from the time you go to bed?

There is two apps for that. 90night and sleepyti.me

I dont like either. But i use 90night currently.

Both operate external from the alarm clock though, so its a lot of steps. I would like it to be more seamless.

Current process

Open 90night
select "go to bed now"
select appropriate 90 minute cycle wakeup time
hit "make alarm"
alarm app opens
turn on alarm that was set
set alarm options (alarm sound, gradual increase, snooze options)
Set alarm

Delete yesterdays alarm the next night, before making new one.

sleep.

Thats a lot of steps.
 
Last edited: