Thursday, July 26, 2012

Arduino UNO R3 :: It's Geek Project Time!

Look what I got today....

Let the fun begin.   ; -)

In case you are wondering, its an Arduino UNO R3. It just showed up in the mail today...just in time for a "geek project" night that I've got planned for tomorrow.  I'm starting off simple with my Arduino projects. I plan on building a high speed flash trigger that will trigger a strobe based on inputs of sound or breaking a laser beam.  It should be a fun starter project. 






I couldn't resist playing around...just a little bit.



Thursday, July 12, 2012

My Approach :: Notification of Amazon Free Android App of the Day

I recently ditched the iOS ecosystem for an Android device. Not for any political reason like #boycottapple or anything silly crazy agressive hater like that. It wasn't because of cost. It wasn't because of Apple's slowly declining market share (if that really is the case).  The reality is that it was about timing and boredom. I was getting bored with iOS, I needed a new phone, and the next iPhone is still several months out.  I ditched Android for iPhone several years ago...and I guess now the pendulum is swinging the other direction.  But...this post isn't to talk about my switch from iPhone to my smokin hot new Samsung Galaxy S3 on AT&T. ;-) It's to talk about how I chose to get notifications of Amazon's Free Android App of the Day to my device...and how you can as well.

It wasn't long after switching back to Android that I was getting advice about installing Amazon AppStore because each day they offer a paid app for free. (Thanks Kevin!) It seems sometimes it's a lame app that should be free...sometimes its a decent app...and sometimes its a killer app that is a nugget of gold hidden in the dirt. Okay...cool.

"How do you get notified of what each day's free app is?" I asked. "You have to check it every day," I was told.  Okay. I can do that.

Yeah...that lasted about a week (or less).  I couldn't remember to check Amazon each day.  I was fearful that I was going to miss out on a really amazing app because I failed to check it that day.

I began looking into ways to get notified.  I did find several apps on the Google Play Store that claim to do this for you...but I really hate to install an app just for this.  Many seem to come with ads and junk...and well...there had to be a better way.

I started thinking about it...and the way was already available to me on my GS3. I have an app named Tasker for Android. I have been using this app to play with location and state based tasks.  It's REALLY cool, and almost limitless in possibility. Some examples of how I use Tasker:

  • Disable keyguard when I am connected to my home WiFi network
    • Re-enable it when I am away from home
  • Disable WiFi when I am away from home
    • Re-enable it when I am in my neighborhood so that I can re-connect as I arrive home.
  • Disable keyguard when my phone is connected to my car's bluetooth
    • Re-enable it when I turn off my car
  • If I am at work, and I place my phone face down, turn on airplane mode so it doesn't eat battery while in a place where it can't get service.
  • Etc, Etc, Etc
Tasker is great, and really great if you like to tinker and play with a light bit of pseudo-code.  One thing that Tasker can do is to make http requests...so...I decided to use that to help me with my Amazon Free Android App of the Day situation. 

I have a project in Tasker that consists of the following:
  • At 0500 each morning, do the following:
    • Go to the Amazon website where the Free App of the Day is posted
    • Parse that web page for the following:
      • App Name
      • App Description
    • Fire a notification that tells me what the app name is.
      • When I click the notification, open a popup that gives me the description
        • When I click a button on the popup, take me to the Amazon App
It's really that simple.  If the name catches my attention, then I can get the description.  If I am still interested, I can go straight to the Amazon App Store and read the reviews and see the screen shots. 

So now, each morning I am presented with the latest free app.  No extra apps to download (I already had Tasker) and no ads to have to click through, and exactly what I want to see. 

I debated what information I wanted to pull.  Do I care what the original price was?  Eh...not really.  But I may add that later.  Maybe not. 

Anyway...so here is what it looks like:

Here is the notification that displays when the task fires.  (FAAD is short for Free Android App of the Day, and it's the convention that Amazon uses in the webpage source.)  


Word Shaker, btw, was a really cool game that I did take advantage of while it was free.  Still available as I type this... ; -)

When I pull down the notification list, you can see the FAAD Notification.



Now, if I am not interested in Word Shaker, I can just dismiss the app, but if I want to see the description, I can simply touch the notification to get my popup.  I didn't spend any time on the popup to make it look good...I just wanted something functional.



It ought to be obvious by now, but if I select "Go To Amazon," I am taken straight to the Amazon App Store where the Free App of the Day is found at the top of the display. Once here, I can check it out further and download it if I choose to do so. 



That's about it.  It's pretty simple.  Now I just watch my notifications each day for that super-awesome-must-have-free-app!

If you want to use this, or take it and make it better, you are free to do so.  You're ahead of the game if you already have and use Tasker.  If not...there is a bit of a learning curve.  

Since I'm such a nice guy, I'll save you some trouble.  ; - )

Here is my .xml export of the project.  You can just save all of this text as an .xml and import it directly into Tasker. It should work for you.  (You must have the Amazon App Store installed as well as Tasker.)  Of course, all of this is dependent upon Amazon not changing the layout of their website.  There are certainly easier and more efficient ways to this.  This is just the method I chose. Feel free to be more awesome than me and do it better. It's okay. : - )

************** BEGIN XML *********************

<class cl="TaskerData" sr="">
<tv>1.2.1u1m</tv>
<class cl="Profile" sr="prof41">
<cdate>1341781539687</cdate>
<edate>1342132467123</edate>
<id>41</id>
<mid0>59</mid0>
<nme>Get Free App</nme>
<class cl="TimeContext" sr="con0">
<fh>5</fh>
<fm>0</fm>
<th>5</th>
<tm>0</tm>
</class>
</class>
<class cl="Profile" sr="prof9">
<cdate>1341780845630</cdate>
<clp>true</clp>
<edate>1341964891358</edate>
<id>9</id>
<mid0>36</mid0>
<nme>Amazon Free App Notification Click</nme>
<class cl="EventContext" sr="con0" ve="2">
<code>2000</code>
<pri>0</pri>
<class cl="AppArg" sr="arg0">
<appClass>net.dinglisch.android.taskerm.Tasker</appClass>
<appPkg>net.dinglisch.android.taskerm</appPkg>
<label>Tasker</label>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>*Today's FAAD*</val>
</class>
</class>
</class>
<class cl="Project" sr="proj0">
<cdate>1341781461540</cdate>
<name>Amazon Free App</name>
<pids>9,41</pids>
<scenes>Amazon</scenes>
<tids>36,61,62,59</tids>
</class>
<class cl="Scene" sr="sceneAmazon">
<backColour>0</backColour>
<cdate>1340657368855</cdate>
<edate>1342132475622</edate>
<heightLand>-1</heightLand>
<heightPort>716</heightPort>
<nme>Amazon</nme>
<widthLand>-1</widthLand>
<widthPort>658</widthPort>
<class cl="ImageElement" sr="elements0">
<flags>7</flags>
<heightPort>716</heightPort>
<widthPort>658</widthPort>
<xPort>0</xPort>
<yPort>0</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>Background</val>
</class>
<class cl="AppIcon" sr="arg1" ve="2"/> <class cl="IntArg" sr="arg2">
<val>255</val>
</class>
<class cl="RectElement" sr="background">
<flags>4</flags>
<class cl="StringArg" sr="arg0" ve="3">
<val></val>
</class>
<class cl="IntArg" sr="arg1">
<val>0</val>
</class>
<class cl="StringArg" sr="arg2" ve="3">
<val>#F5383882</val>
</class>
<class cl="StringArg" sr="arg3" ve="3">
<val>#F5555599</val>
</class>
<class cl="IntArg" sr="arg4">
<val>2</val>
</class>
<class cl="StringArg" sr="arg5" ve="3">
<val>#2BF4F4F4</val>
</class>
<class cl="IntArg" sr="arg6">
<val>9</val>
</class>
<class cl="IntArg" sr="arg7">
<val>0</val>
</class>
</class>
</class>
<class cl="TextElement" sr="elements1" ve="2">
<ClickTask>-936</ClickTask>
<flags>5</flags>
<heightPort>443</heightPort>
<widthPort>597</widthPort>
<xPort>29</xPort>
<yPort>155</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>App Desc</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>%AppDesc</val>
</class>
<class cl="IntArg" sr="arg2">
<val>16</val>
</class>
<class cl="IntArg" sr="arg3">
<val>100</val>
</class>
<class cl="StringArg" sr="arg4" ve="3">
<val>#FFFFFFFF</val>
</class>
<class cl="IntArg" sr="arg5">
<val>0</val>
</class>
<class cl="IntArg" sr="arg6">
<val>2</val>
</class>
<class cl="IntArg" sr="arg7">
<val>0</val>
</class>
</class>
<class cl="RectElement" sr="elements2">
<flags>4</flags>
<heightLand>17</heightLand>
<heightPort>117</heightPort>
<widthLand>250</widthLand>
<widthPort>595</widthPort>
<xLand>0</xLand>
<xPort>31</xPort>
<yLand>183</yLand>
<yPort>597</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>Footer</val>
</class>
<class cl="IntArg" sr="arg1">
<val>2</val>
</class>
<class cl="StringArg" sr="arg2" ve="3">
<val>#FFDDDDDD</val>
</class>
<class cl="StringArg" sr="arg3" ve="3">
<val>#FF999999</val>
</class>
<class cl="IntArg" sr="arg4">
<val>4</val>
</class>
<class cl="StringArg" sr="arg5" ve="3">
<val>#FF000000</val>
</class>
<class cl="IntArg" sr="arg6">
<val>9</val>
</class>
<class cl="IntArg" sr="arg7">
<val>0</val>
</class>
</class>
<class cl="TextElement" sr="elements3" ve="2">
<flags>4</flags>
<heightPort>155</heightPort>
<widthPort>609</widthPort>
<xPort>17</xPort>
<yPort>0</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>Text3</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>%FreeApp</val>
</class>
<class cl="IntArg" sr="arg2">
<val>20</val>
</class>
<class cl="IntArg" sr="arg3">
<val>100</val>
</class>
<class cl="StringArg" sr="arg4" ve="3">
<val>#FFFFFFFF</val>
</class>
<class cl="IntArg" sr="arg5">
<val>0</val>
</class>
<class cl="IntArg" sr="arg6">
<val>0</val>
</class>
<class cl="IntArg" sr="arg7">
<val>0</val>
</class>
</class>
<class cl="ButtonElement" sr="elements4">
<ClickTask>61</ClickTask>
<flags>4</flags>
<heightPort>95</heightPort>
<widthPort>93</widthPort>
<xPort>511</xPort>
<yPort>620</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>Button1</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val></val>
</class>
<class cl="IntArg" sr="arg2">
<val>16</val>
</class>
<class cl="IntArg" sr="arg3">
<val>100</val>
</class>
<class cl="StringArg" sr="arg4" ve="3">
<val>#F5383882</val>
</class>
<class cl="IntArg" sr="arg5">
<val>0</val>
</class>
<class cl="AppIcon" sr="arg6" ve="2">
<nme>icon_dontsave</nme>
<pkg>net.dinglisch.android.taskerm</pkg>
</class>
</class>
<class cl="ButtonElement" sr="elements5">
<ClickTask>62</ClickTask>
<flags>4</flags>
<heightPort>95</heightPort>
<widthPort>389</widthPort>
<xPort>54</xPort>
<yPort>620</yPort>
<class cl="StringArg" sr="arg0" ve="3">
<val>Button2</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>Go To Amazon</val>
</class>
<class cl="IntArg" sr="arg2">
<val>24</val>
</class>
<class cl="IntArg" sr="arg3">
<val>100</val>
</class>
<class cl="StringArg" sr="arg4" ve="3">
<val>#FF000000</val>
</class>
<class cl="IntArg" sr="arg5">
<val>0</val>
</class>
<class cl="AppIcon" sr="arg6" ve="2"/> </class>
</class>
<class cl="Task" sr="task36">
<cdate>1341780862122</cdate>
<edate>1341884639918</edate>
<id>36</id>
<pri>10</pri>
<class cl="Action" sr="act0" ve="3">
<code>47</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>Amazon</val>
</class>
<class cl="IntArg" sr="arg1">
<val>1</val>
</class>
<class cl="IntArg" sr="arg2">
<val>100</val>
</class>
<class cl="IntArg" sr="arg3">
<val>100</val>
</class>
<class cl="IntArg" sr="arg4">
<val>0</val>
</class>
<class cl="IntArg" sr="arg5">
<val>1</val>
</class>
</class>
</class>
<class cl="Task" sr="task59">
<cdate>1341774238385</cdate>
<edate>1342132499890</edate>
<id>59</id>
<nme>AmazonFreeApp</nme>
<pri>10</pri>
<class cl="Action" sr="act0" ve="3">
<code>118</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>www.amazon.com/mobile-apps/b?ie=UTF8&amp;node=2350149011</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val></val>
</class>
<class cl="StringArg" sr="arg2" ve="3">
<val></val>
</class>
<class cl="IntArg" sr="arg3">
<val>10</val>
</class>
<class cl="StringArg" sr="arg4" ve="3">
<val>text/*</val>
</class>
<class cl="StringArg" sr="arg5" ve="3">
<val></val>
</class>
</class>
<class cl="Action" sr="act1" ve="3">
<code>590</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>mas_faad'&gt;</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act10" ve="3">
<code>549</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD*</val>
</class>
<class cl="IntArg" sr="arg1">
<val>1</val>
</class>
</class>
<class cl="Action" sr="act11" ve="3">
<code>523</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>Today's FAAD: %FreeApp</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>Today's Amazon Free App : %FreeApp</val>
</class>
<class cl="AppIcon" sr="arg2" ve="2"/> <class cl="IntArg" sr="arg3">
<val>0</val>
</class>
<class cl="IntArg" sr="arg4">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act2" ve="3">
<code>590</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD2</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>&lt;/a&gt;</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act3" ve="3">
<code>547</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%FreeApp</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>%HTTPD21</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
<class cl="IntArg" sr="arg3">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act4" ve="3">
<code>549</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD1</val>
</class>
<class cl="IntArg" sr="arg1">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act5" ve="3">
<code>549</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD2</val>
</class>
<class cl="IntArg" sr="arg1">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act6" ve="3">
<code>549</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD21</val>
</class>
<class cl="IntArg" sr="arg1">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act7" ve="3">
<code>590</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>width="473" alt="</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act8" ve="3">
<code>590</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%HTTPD2</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>" class="fad</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act9" ve="3">
<code>547</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>%AppDesc</val>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val>%HTTPD21</val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
<class cl="IntArg" sr="arg3">
<val>0</val>
</class>
</class>
</class>
<class cl="Task" sr="task61">
<cdate>1341882417249</cdate>
<edate>1341882417249</edate>
<id>61</id>
<class cl="Action" sr="act0" ve="3">
<code>48</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>Amazon</val>
</class>
</class>
</class>
<class cl="Task" sr="task62">
<cdate>1341882457967</cdate>
<edate>1341882457967</edate>
<id>62</id>
<class cl="Action" sr="act0" ve="3">
<code>20</code>
<class cl="AppArg" sr="arg0">
<appClass>com.amazon.venezia.Venezia</appClass>
<appPkg>com.amazon.venezia</appPkg>
<label>Appstore</label>
</class>
<class cl="StringArg" sr="arg1" ve="3">
<val></val>
</class>
<class cl="IntArg" sr="arg2">
<val>0</val>
</class>
</class>
<class cl="Action" sr="act1" ve="3">
<code>48</code>
<class cl="StringArg" sr="arg0" ve="3">
<val>Amazon</val>
</class>
</class>
</class>
</class>

************** END XML *********************