See you next Friday.
Friday, December 23, 2011
Books I've Read This Week
I still haven't finished The Children of the Sky but here are some awfully short reviews to tie you over.
Twelve Days of PhoneGapping!
Starting on Christmas Day, December 25th, I'll be posting one PhoneGap tip per day for 12 days in what I'm grandiosely calling The Twelve Days of PhoneGap. Some of these tips you'll already know and some you won't but hopefully we'll all learn something.
For most of those days I'll actually be on vacation so it may take a bit for me to respond to any comments left on the post. Here's hoping everyone has a great holiday season!
For most of those days I'll actually be on vacation so it may take a bit for me to respond to any comments left on the post. Here's hoping everyone has a great holiday season!
Friday, December 16, 2011
Books I've Read This Week
I know I hinted at a review for The Children of the Sky but I haven't finished with it yet so you'll have to be happy with:
Also, the series artist Joe Eisma is absolutely killing it and you should check this recent breakdown of his art on the series. |
See you next Friday.
Friday, December 9, 2011
Books I've Read This Week
Nothing to report this week. My daughter was sick for about five days with a fever/flu which cut into my reading time. I'm just cracking open The Children of the Sky by Vernor Vinge which promisses to be a great read.
See you next Friday.
Friday, December 2, 2011
Installing the Barcode Plugin for PhoneGap Android
Some folks are having problems getting the Barcode Scanner plugin up and running for PhoneGap Android so I figured I'd write a more detailed explanation on how to get it up and running.
First you'll want to go download the Library Project part from GitHub. You'll want to use the code from github as I've modified it slightly so that it is responds to the correct intent.
Once downloaded you'll want to create a new Android project from existing source in Eclipse. The project name shows up as CaptureActivity but I'm going to change it to BarcodeLibrary which is more descriptive.
but don't click on Finish yet. Click the Next button...
and select the highest level of Android SDK you have installed before clicking Finish.
Now that you've created the library project which contains the barcode scanning code you'll want to right mouse click on the BarcodeLibrary project and select Properties. In the Properties dialog, select the Android tab and ensure the Is Library checkbox is click. The benefit of doing things this way is you can link this library into multiple Android projects without needing to copy a bunch of source around.
Now that we've got our library setup let's add it to our project. Right click on your PhoneGap project, in my case it is called BarTest, and select Properties.
In the Android tab under the library section click the Add button.
In the Project Selection dialog select BarcodeLibrary.
Now our application can use the BarcodeLibrary project so we can click OK.
Let's now add in the BarcodeScanning plugin code. Under the assets/www directory copy in the barcodescanner.js file from github. Under src, right click and create a new package com.phonegap.plugins.barcodescanner then copy in the BarcodeScanner.java file from github.
So were all set now right? Well know we forgot one thing. We need to add a line for our plugin under the res/xml/plugins.xml file so let's open that up now and add this line after the last <plugin/> tag but before the </plugins> line.
<plugin name="BarcodeScanner" value="com.phonegap.plugins.barcodescanner.BarcodeScanner"/>
Okay, so were good now. Well no, there is one more bit to take care of. Open up your AndroidManifest.xml file so we can add some new activities that will take care of the scanning and encoding. You'll need to paste these activity lines inside the <application/> tag.
<uses-permission android:name="android.permission.CAMERA" />
Alright, finally we are all setup. But how does one call the BarcodeScanner? Well we provide two main piece of functionality.
Scan
Encode
I've put together a small example html (and css) page which will be listed below that you can use to test the BarcodeScanner.
If you have problems with the Barcode Scanner the best place to ask questions is over on the PhoneGap Google Group where I check multiple times per day for questions I can answer.
First you'll want to go download the Library Project part from GitHub. You'll want to use the code from github as I've modified it slightly so that it is responds to the correct intent.
Once downloaded you'll want to create a new Android project from existing source in Eclipse. The project name shows up as CaptureActivity but I'm going to change it to BarcodeLibrary which is more descriptive.
but don't click on Finish yet. Click the Next button...
and select the highest level of Android SDK you have installed before clicking Finish.
Now that you've created the library project which contains the barcode scanning code you'll want to right mouse click on the BarcodeLibrary project and select Properties. In the Properties dialog, select the Android tab and ensure the Is Library checkbox is click. The benefit of doing things this way is you can link this library into multiple Android projects without needing to copy a bunch of source around.
Now that we've got our library setup let's add it to our project. Right click on your PhoneGap project, in my case it is called BarTest, and select Properties.
In the Android tab under the library section click the Add button.
In the Project Selection dialog select BarcodeLibrary.
Now our application can use the BarcodeLibrary project so we can click OK.
Let's now add in the BarcodeScanning plugin code. Under the assets/www directory copy in the barcodescanner.js file from github. Under src, right click and create a new package com.phonegap.plugins.barcodescanner then copy in the BarcodeScanner.java file from github.
So were all set now right? Well know we forgot one thing. We need to add a line for our plugin under the res/xml/plugins.xml file so let's open that up now and add this line after the last <plugin/> tag but before the </plugins> line.
<plugin name="BarcodeScanner" value="com.phonegap.plugins.barcodescanner.BarcodeScanner"/>
Okay, so were good now. Well no, there is one more bit to take care of. Open up your AndroidManifest.xml file so we can add some new activities that will take care of the scanning and encoding. You'll need to paste these activity lines inside the <application/> tag.
Update: With later versions of PhoneGap the CAMERA permission was removed as it was not required. However, for the barcode scanner it is. So add the following permissions line:<activity android:name="com.google.zxing.client.android.CaptureActivity"android:screenOrientation="landscape"android:configChanges="orientation|keyboardHidden"android:theme="@android:style/Theme.NoTitleBar.Fullscreen"android:windowSoftInputMode="stateAlwaysHidden"><intent-filter><action android:name="com.phonegap.plugins.barcodescanner.SCAN"/><category android:name="android.intent.category.DEFAULT"/></intent-filter></activity><activity android:name="com.google.zxing.client.android.encode.EncodeActivity"android:label="@string/share_name"><intent-filter><action android:name="com.phonegap.plugins.barcodescanner.ENCODE"/><category android:name="android.intent.category.DEFAULT"/></intent-filter></activity>
<uses-permission android:name="android.permission.CAMERA" />
Alright, finally we are all setup. But how does one call the BarcodeScanner? Well we provide two main piece of functionality.
Scan
window.plugins.barcodeScanner.scan( function(result) {
alert("We got a barcode\n" +
"Result: " + result.text + "\n" +
"Format: " + result.format + "\n" +
"Cancelled: " + result.cancelled);
}, function(error) {
alert("Scanning failed: " + error);
}
);
Encode
window.plugins.barcodeScanner.encode(BarcodeScanner.Encode.TEXT_TYPE, "http://www.nytimes.com", function(success) {
alert("encode success: " + success);
}, function(fail) {
alert("encoding failed: " + fail);
}
);
I've put together a small example html (and css) page which will be listed below that you can use to test the BarcodeScanner.
If you have problems with the Barcode Scanner the best place to ask questions is over on the PhoneGap Google Group where I check multiple times per day for questions I can answer.
Books I've Read This Week
Snuff is the 39th novel set in Discworld and it features my favourite character in the series, Commander Sam Vimes of the City Watch. This is a novel about the slavery and racism that Sam Vimes runs into while on vacation. No other author that I know of can tackle such a serious issue with as much humour as Terry Prachett can while at the same time making the reader really think. Can't recommend Snuff and Prachett's earlier works highly enough. |
The real joy of this book is Charlie's extrapolation on how the internet will affect our near future society and policing in general. It was a pretty fun and interesting book to read. |
See you next Friday.
Thursday, December 1, 2011
Living with Android
I just wanted to give a brief update on how things have been going living with Android full time. Back in September I decided not to re-up my three year contract with Rogers on my iPhone 3G and give Android a month to woo me. The experiment was not without it's tribulations as attempting to upgrade my OS from 2.1 to 2.3 using the Samsung Kies software bricked my phone. Luckily, I was able to resolve that problem by flashing my firmware with ODIN.
Honestly, since that time life with Android has been pretty great. That is until my trip to AnDevCon in San Francisco. While on that trip I noticed my phone was extremely hot which was unusual. Once I took it out of my pocket I saw that it was rebooting to which I assumed I was out of battery but that was not the case. The phone was constantly rebooting loading the Samsung welcome screen and then rebooting again. In order to make it stop I needed to pull the battery out of the back.
Initially I wasn't concerned as I figured it either needed a full charge or worse case scenario I could flash the firmware again using ODIN. Sadly, upon return home to Ottawa nothing I tried to fix the phone would work. The phone would flash to Android 2.3.5 but still it was stuck in the rebooting cycle.
I called Bell Canada from whom we purchased the phone. Since the phone died 1 week after it's 1 year warranty Bell wanted $50 to look at the phone and anywhere between $50 to $200 in order to fix the phone. This really didn't make a lot of sense to me as at that point I might as well buy a new phone.
Thanks to a suggestion by my bosses boss I called Samsung Canada. After about 10-15 minutes on the phone with first and second line support Samsung emailed me a UPS shipping label for me to send the phone into them where they would fix it for free. Oh happy day! Finally, a company that still stands behind their product and provides good customer support.
So I got the phone back after about 2 weeks and it is working good. I've already flashed it to the latest Gingerbread release 2.3.5 and I've never been happier with my Android phone.
However, after using my iPhone for almost a month as just a music player and browser I gotta say it is pretty sweet. I'm going to try to hold off a bit longer but I'm pretty sure there will be an iPhone 5 in my future once that magical new device is releases.
Honestly, since that time life with Android has been pretty great. That is until my trip to AnDevCon in San Francisco. While on that trip I noticed my phone was extremely hot which was unusual. Once I took it out of my pocket I saw that it was rebooting to which I assumed I was out of battery but that was not the case. The phone was constantly rebooting loading the Samsung welcome screen and then rebooting again. In order to make it stop I needed to pull the battery out of the back.
Initially I wasn't concerned as I figured it either needed a full charge or worse case scenario I could flash the firmware again using ODIN. Sadly, upon return home to Ottawa nothing I tried to fix the phone would work. The phone would flash to Android 2.3.5 but still it was stuck in the rebooting cycle.
I called Bell Canada from whom we purchased the phone. Since the phone died 1 week after it's 1 year warranty Bell wanted $50 to look at the phone and anywhere between $50 to $200 in order to fix the phone. This really didn't make a lot of sense to me as at that point I might as well buy a new phone.
Thanks to a suggestion by my bosses boss I called Samsung Canada. After about 10-15 minutes on the phone with first and second line support Samsung emailed me a UPS shipping label for me to send the phone into them where they would fix it for free. Oh happy day! Finally, a company that still stands behind their product and provides good customer support.
So I got the phone back after about 2 weeks and it is working good. I've already flashed it to the latest Gingerbread release 2.3.5 and I've never been happier with my Android phone.
However, after using my iPhone for almost a month as just a music player and browser I gotta say it is pretty sweet. I'm going to try to hold off a bit longer but I'm pretty sure there will be an iPhone 5 in my future once that magical new device is releases.
Subscribe to:
Posts (Atom)






