See you next Friday for real this time.
Sunday, October 30, 2011
Books I've Read This Week
Whoops forgot to put this down as a schedule post.
The Matrix Has Given Up
I spent about ten minutes chatting up the affable Mr. Hutchins before heading out to get my rental car. All the way to my hotel I was wondering what the odds of such a meeting would be. Since Dever is a city of approximately 2.5 million people I'll have to assume that it was a pretty slim chance.
Anyway, that's unlikely but it isn't really proof that we are all living in a simulation, that is until you factor in the next coincidence. I popped out of the hotel to grab a bite to eat and pick up a book for the plan rides home. Once I got to the counter I recognized the guy working the cash. I immediately said, "I know you!" to which started a bit of back and forth only to discover that he moved to Denver 7 years ago from Ottawa where he worked at the Pinecrest Chapters store. That's the book store of which I'm a life time member of their discount club since I shop their so damn much.
So one unlikely meeting is a co-incidence two means we are all figments of a computers imagination. An imagination which must be taxed as I keep meeting the same programs over and over again.
Friday, October 21, 2011
Books I've Read This Week
See you next Friday.
Tuesday, October 18, 2011
Guest Review of Atomic Robo: The Ghost of Station X over at the Signal Watch
Hey, once again my buddy Ryan has put up another one of my comic reviews at his site The Signal Watch. This time I'm talking about the latest Atomic Robo mini series.
Friday, October 14, 2011
Books I've Read This Week
Well this has been a very manga week as a glut of books showed up from my library pull list.
See you next Friday for a decidedly less manga'ish week.
Wednesday, October 12, 2011
Tuesday, October 11, 2011
Ottawa Android PhoneGap Droidhack
Most of the day I spent helping others setup their environments and getting them going with their first PhoneGap application. I was able to provide some helpful hints to Chris Saunders who works for Shopify and put together an Android Shopify plugin. I was able to spend sometime on working on my DropBox plugin for Android. So far I can login and logout of DropBox but there is still a bunch of stuff to do that I hope to get to in the next few weeks.
All in all it was a pretty good day of hacking and I think a bunch of people learned some new ways to think and got exposed to PhoneGap. Also, huge shout out to Macadamian for providing us with the office space, wifi and food for this event. I know that I and the other Ottawa Android organizers really appreciate it.
Friday, October 7, 2011
Books I've Read This Week
It is a collection of a few shorter stories and features the art of Ryan Sook. I really enjoyed the small taste of B.P.R.D. I got and can't wait to get some of the later trades where the entire volume focuses on one storyline. |
See you next Friday
Monday, October 3, 2011
Changes in PhoneGap Android 1.1.0
As of Friday PhoneGap 1.1.0 was released upon the world. I figured I would use this post to talk about some of the additions/changes to the API in our latest point release.
Chunked Streaming Mode
One of the biggest complaints about the FileTransfer code on Android is that it would throw an Out of Memory exception if the file you were trying to upload was too big. This happened because the HttpURLConnection class likes to buffer all the data to upload in memory before it even sends the first byte. You can see how that would be a problem when you are uploading a 10 mb file.
Now the default is to send the data in chunked streaming mode. Most web servers support chunked mode but if the one you are communicating with doesn't you'll end up getting a FileTransferError.CONNECTION_ERR (Error code 3). To make this error go away you just need to set the right option:
Clean Up the Content Store
Previously when you were using FileEntry.remove() to delete a file, like an image, that had a corresponding entry in the content store the file would be removed from the file system but the database entry remained. This would cause odd behaviour in the Gallery app where you would see a black image. Now when you delete a file we do a query to see if there is a corresponding entry in the content store and remove it.
Double Image Bug
On some phones, Samsung for instance, when you used Camera.getPicture() you would end up getting two pictures in the gallery. One would be the raw image the camera took and the second would be the image with the options you specified like quality, targetWidth and targetHeight. Now we are doing a check to see if two images have been created and we'll remove the raw image and only store the one with the options you've specified.
Use Camera.getPicture() to Retrieve a Video
Typically you can get an image out of the gallery by doing:
but that only lists all the images in the gallery. What if you wanted the user to be able to select a Video? Well you couldn't until now. We've introduced a new mediaType option that will allow you to get an image, a video or both.
This will bring up the video gallery:
This will bring up the gallery for both images and video:
The default will continue to be to get a picture but if you want to explicitly state it do this:
Compass Return Value Has Changed
Previously on Android the getHeading() and watchHeading() methods would call their success call backs with a heading parameter which was express in degrees. In 1.1 to line up with iOS the return value is now a CompassHeading object which has the following properties:
magneticHeading: The heading in degrees from 0 - 359.99 at a single moment in time.
trueHeading: It is supposed to be the heading relative to the geographic North Pole in degrees 0 - 359.99 at a single moment in time. Unfortunately, on Android this will have the same value as magneticHeading.
headingAccuracy: Is supposed to report the degrees difference between the magnetic and true heading but since they are the same on Android this will always be 0.
timestamp: The time at which this heading was determined.
Multi-Page Apps
Now when you are dealing with multiple page apps there is a change to navigator.app.exitApp(). This command now exits the app completely it does not return to the previous page. If you want to go back a page you should use navigator.app.backHistory().
Chunked Streaming Mode
One of the biggest complaints about the FileTransfer code on Android is that it would throw an Out of Memory exception if the file you were trying to upload was too big. This happened because the HttpURLConnection class likes to buffer all the data to upload in memory before it even sends the first byte. You can see how that would be a problem when you are uploading a 10 mb file.
Now the default is to send the data in chunked streaming mode. Most web servers support chunked mode but if the one you are communicating with doesn't you'll end up getting a FileTransferError.CONNECTION_ERR (Error code 3). To make this error go away you just need to set the right option:
var options = new FileUploadOptions(); options.chunkedMode = false;
Clean Up the Content Store
Previously when you were using FileEntry.remove() to delete a file, like an image, that had a corresponding entry in the content store the file would be removed from the file system but the database entry remained. This would cause odd behaviour in the Gallery app where you would see a black image. Now when you delete a file we do a query to see if there is a corresponding entry in the content store and remove it.
Double Image Bug
On some phones, Samsung for instance, when you used Camera.getPicture() you would end up getting two pictures in the gallery. One would be the raw image the camera took and the second would be the image with the options you specified like quality, targetWidth and targetHeight. Now we are doing a check to see if two images have been created and we'll remove the raw image and only store the one with the options you've specified.
Use Camera.getPicture() to Retrieve a Video
Typically you can get an image out of the gallery by doing:
var options = { quality: 100, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY } navigator.camera.getPicture(win, fail, options);
but that only lists all the images in the gallery. What if you wanted the user to be able to select a Video? Well you couldn't until now. We've introduced a new mediaType option that will allow you to get an image, a video or both.
This will bring up the video gallery:
var options = { quality: 100, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, mediaType: navigator.camera.MediaType.VIDEO } navigator.camera.getPicture(win, fail, options);
This will bring up the gallery for both images and video:
var options = { quality: 100, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, mediaType: navigator.camera.MediaType.ALLMEDIA } navigator.camera.getPicture(win, fail, options);
The default will continue to be to get a picture but if you want to explicitly state it do this:
var options = { quality: 100, destinationType: navigator.camera.DestinationType.FILE_URI, sourceType: navigator.camera.PictureSourceType.PHOTOLIBRARY, mediaType: navigator.camera.MediaType.PICTURE } navigator.camera.getPicture(win, fail, options);
Compass Return Value Has Changed
Previously on Android the getHeading() and watchHeading() methods would call their success call backs with a heading parameter which was express in degrees. In 1.1 to line up with iOS the return value is now a CompassHeading object which has the following properties:
magneticHeading: The heading in degrees from 0 - 359.99 at a single moment in time.
trueHeading: It is supposed to be the heading relative to the geographic North Pole in degrees 0 - 359.99 at a single moment in time. Unfortunately, on Android this will have the same value as magneticHeading.
headingAccuracy: Is supposed to report the degrees difference between the magnetic and true heading but since they are the same on Android this will always be 0.
timestamp: The time at which this heading was determined.
Multi-Page Apps
Now when you are dealing with multiple page apps there is a change to navigator.app.exitApp(). This command now exits the app completely it does not return to the previous page. If you want to go back a page you should use navigator.app.backHistory().
Subscribe to:
Posts (Atom)