Friday, November 25, 2011

Books I've Read This Week


Ganymede by Cherie Priest is not my favourite book of her Clockwork Century series as it is just okay. It seems to be a bit of a rearranging the deck chairs type of novel more of a setup for future novels than anything else. I'm still interested in reading more of this series but don't let this be the first of Cherie Priest's book you pick up. I really have to recommend the Boneshaker audio book with Wil Wheaton and Kate Reading alternating the narration of the book from the two main characters point of view.

Fables Vol. 15: Rose Red along with Vol. 14: Witches it really feels like this series is starting to get moving again recovering from the disastrous Great Fables Crossover which took up all of volume 13. Really happy to see Rose Red finally getting out of bed for the first time in what seems like 4 volumes of this story. We are starting to get characters moving forwards again and certain hidden bits of information being uncovered that will cause problems in future stories.

Anything You Want by Derek Sivers was one of those nice short, quick to read books that the Domino Project is cranking out. There is some really great advice for entrepreneurs from someone who's done it themselves. Mr. Sivers grew CD Baby from his own home coded website to an 85 person company he sold from 22 million once it stopped being fun for him.

See you next Friday.

Monday, November 21, 2011

Video Player Plugin for PhoneGap Android

One of the more annoying problems when using an Android WebView is that the <video/> tag is not well supported. In fact it is pretty much broken. To that end I spent some time writing a VideoPlayer plugin to help work around the issue. As of the weekend I put in a fix making playing YouTube videos easier so I figured I'd share it with all of you.

Installation of the plugin is pretty simple:

1. To install the plugin, move www/video.js to your project's www folder and include a reference to it in your html file after phonegap.{ver}.js.

<script type="text/javascript" charset="utf-8" src="phonegap.js"></script>

<script type="text/javascript" charset="utf-8" src="video.js"></script>

2. Create a directory within your project called "src/com/phonegap/plugins/video" and copy "src/com/phonegap/plugins/video/VideoPlayer.java" into it.

3. In your res/xml/plugins.xml file add the following line:
<plugin name="VideoPlayer" value="com.phonegap.plugins.video.VideoPlayer"/>

Once installed you will be able to play a video by calling:
window.plugins.videoPlayer.play(url);
The url parameter can be one of three types:

1. The file:// protocol to play something native to the device such as:
window.plugins.videoPlayer.play("file:///sdcard/MyMovie.mp4");
2. The http:// protocol to play something on the internet such as:
window.plugins.videoPlayer.play("http://path.to.my/file.mp4");
3. The http:// protocol pointing to a video on YouTube such as:
window.plugins.videoPlayer.play("http://www.youtube.com/watch?v=E0UV5i5jY50");
As long as your url has "youtube.com" and contains the video ID (i.e. the v parameter) the VideoPlayer should be able to start the YouTube app on your phone to play the video without any additional user interaction. However, if the phone does not have the YouTube app you are out of luck. In the future I may add a check for this that will ask the user to install the YouTube app first.

Sadly at this point in time the VideoPlayer does not support playing videos from your android asset directory. That is an enhancement for a later date.

So, there you go a pretty simple and easy to use plugin which can get you unstuck if you really need to play a video in your Android PhoneGap application. Lemme know you feedback.

Friday, November 18, 2011

Books I've Read This Week

After two weeks of travel and attending conferences I came down with a case of con crud and I've been sick for a week. Consequently most of my reading time went to sleeping instead. Although I did get in some quick comic book hits.

American Vampire Vol. 2 I know that vampires are hot right now but these aren't your sparkly Twilight types. They are brutal, violent creatures who manipulate the human race from behind the scenes and treat us as food. In short it's awesome. You really should pick up the first two trades of this great series from Scott Synder and Rafael Albuquerque.

Casanova - Volume 2: Gula I loved, loved, loved Casanova Volume 1 but I found this one a bit hard to follow. I'm going to hold off making any rating until I do a second read through.


See you next Friday.

Friday, November 11, 2011

Books I've Read This Week


All Clear by Connie Willis is the second part of this time travelling World War II drama that started in Blackout. I really, really enjoyed this two book series by Willis. The time travel from 2060 is interwoven into the narrative extremely well. The crux of the tension comes down to "can the historians observing WWII actually change history?"

The books have some really engaging characters and if you don't fall in love with the kids Alph and Vinnie then apparently you don't like smart mouth artful dodger types.

Monstrous Regiment by Terry Pratchett is one of the few books I missed by Pratchett when it originally came out much to my detriment. Again Pratchett is at this satirical best. Obstinately he is taking on the subject of women in the military but also the ridiculousness of many wars.  As always Pratchett makes you laugh and laugh a lot but it also makes you think.

High Performance JavaScript by Nicholas Zakas was a good book for me. I learned a number of tips and tricks in reading this book that can be implemented in my code. This is one that I can say I recommend to others. Mind you don't blindly implement all the changes before you profile your code as you may find a performance fix actually turns out to be a detriment. So remember to measure your code before and after any change.

See you next Friday.

Friday, November 4, 2011

Books I've Read This Week


Responsive Web Design by Ethan Marcotte is a great book and you can have it for only $9 in an eBook format which is a steal of a deal. I was just in Denver and Boulder and ran into a bunch of people who were asking how to support multiple screen sizes in PhoneGap for things like phones and tablets. Well the techniques you learn in this book are really the way you should be doing it. Hint: use CSS media queries.

Cognitive Surplus by Clay Shirky asks the question what are we going to do with all of the free time we have? You are probably thinking I don't have any free time but compared to your forefathers who got up and worked all day in the fields you really do. We blog, if that isn't a cognitive surplus I don't know what is. The challenge is using collaborative tools to find other people who share the same interests as you to create something amazing.

B.P.R.D. Volume 5: The Black Flame the War on Frogs is heating up and what happened to Roger? Ah man, I love Roger.


See you next Friday.