Pages

Labels

Sample (14) Intent (5) Media (5) Location (4) Funny (3) HTTP (3) Sleep as Android (3) WiFi (3) Alarm (2) Recording (2) Regexp (2) Array (1) Basic (1) Battery (1) Browser (1) Calculator (1) Contacts (1) Content Provider (1) Cron (1) Dialog (1) Dictionary (1) Export (1) Function (1) GUI (1) Game (1) Loop (1) Random (1) SD Card (1) Social (1) Temperature (1) Text to Speech (1) Weather (1)

Search Scripts

2012-02-19

Sleep as Android: Cook Coffee when Alarm Starts


// Make a HTTP request after alarm starts, for example control your coffee machine

while (true) {
  waitForIntent("com.urbandroid.sleep.alarmclock.ALARM_ALERT_START");
  waitForConnectivity();
  // Hook your coffee machine to this request :)
  httpGet("http://mylocalserver/startcoffee");
}

1 comment:

  1. I really like the dear information you offer in your articles. I'm able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone else!
    colbyecho.com

    ReplyDelete