Calling Twitter API v1.1 From PhoneGap (Preview)
I am currently working my next post which is calling the Twitter API v1.1 from PhoneGap/Cordova. I just got the code executing, but I still need to do some clean up. This post is only a preview.
In addition to PhoneGap, I also use the following open source packages: jQuery, Backbone/Underscore, ChocolateChip-UI, and Moment.JS. The end results looks pretty good and performs pretty snappy.
jQuery does all of the ajax calls. Unlike when used in web site code, PhoneGap apps don't have any cross domain problems. Just remember to add any web site you'd wish to call to your apps white list.
Finally there is Moment.js. It is the quintessential time handling library. Ever try to write a method to display time the way Facebook or Twitter does? You know, how long ago something was instead of when something happened? Moment has that and lots more built in. Getting the time to display correctly is a single method call.
It will probably be the weekend until I have enough time to finish the post. Besides cleaning the code up, I also want to create a plugin for it.
I am putting all of my PhoneGap code together into a book on PhoneGap. This book covers version 3+ of PhoneGap and all of things one needs to do to create production quality apps with it. Most of the code in the book has never been published. Beside using Twitter API v1.1, I cover: Audio, Video, Camera, Maps, Location, Icons, Splash pages, Debugging and setting up your build environment. I plan to self-publish on Amazon, April 2014.
Also, if you'd like more PhoneGap posts, please click the +1. I try to write post based on what I think readers like. The +1 eliminates the doubt. Thanks.
(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)