Thursday, February 28, 2013

What's New in PhoneGap Android 2.5.0

Well PhoneGap Android 2.5.0 is out! There isn't much to get excited about on Android in this release as it is mostly bug fixes. Check out the full list of commits in the CHANGELOG. Fixes include:

  • Fixing a null pointer exception when the user clicks the back button while the app is starting.
  • Enabling the application cache.
  • New configuration parameter "disallowOverscroll" to remove that blue glow when you try to scroll past the top/bottom of the screen.
  • Enabled geolocation in the InAppBrowser.

However, something I can get excited about is that in the past month we've seen 8 new committers to the Android project. Yup, 8 new coders contributed their time to cordova-android which I think is a great sign of the health of the project.

19 comments:

  1. Hi Simon,
    Again grate work, and great with more contributes..

    I seam to recall that 2.5 should add that ability to associate files to a PhoneGap app.. Like the way a Audio player is associated to a .mp3 file..

    Am I not remembering right or am I just bad at looking at the doc's ?.

    Can you help?

    Thanks in advance
    Kim

    ReplyDelete
  2. Simon have you noticed an increase in the overhead for Cordova 2.3+? I upgraded to 2.3 from 1.8.1 and gained 1 MB+ with no changes to the project.

    ReplyDelete
  3. @Michael SBCERA

    Ah no, not that I'm aware of. The jar and js files have remained pretty close to the same size for 2.x release. If there is extra stuff in the project it could be coming from the create command making a new project and including high res resources.

    ReplyDelete
  4. @Kim Rasmussen

    I hadn't heard that. If you want to associate a mime type with a program read this answer from Mark Murphy.

    http://stackoverflow.com/questions/7806807/associate-file-type-with-android-app-fails

    ReplyDelete
  5. Thanks,
    I will try it out..

    Thanks, with regards to the size of the .JS has there been any consideration to release a Minimized .JS like e.g. jQuery and jqMobi does ?

    I have it on my large task list to test out, Coogle Chrome Optimizer has that as one of the top recommendations.

    Again minor things compared to the good stuff you guys provide
    Thanks
    Kim

    ReplyDelete
  6. @Kim Rasmussen

    We used to release a minimized JS but we dropped it as most folks will just to the concatenation and minification of all the files before releasing an app. We were using YUI Compressor and we didn't want to have another dependency license to have to clear when doing the code scan.

    I can tell you YUI Compressor does a good job of minifying the JS.

    ReplyDelete
  7. Does minifying really matter, when loading from the local storage anyway?

    ReplyDelete
  8. Yes, just not as much as when the file is remote. However smaller files have smaller parse times and whatever you can do to get to the load event faster is best for your app. There is a good comparison of techniques in the book High Performance JavaScript.

    ReplyDelete
  9. How come contacts still doesn't populate categories with the names of the address book groups?

    Your comment on stackoverflow that there is no attribute that maps to groups in the W3C spec is not really correct - this is what categories is for.

    ReplyDelete
  10. @Todd Blanchard

    Raise a bug on JIRA and assign it to me.

    https://issues.apache.org/jira/browse/CB

    ReplyDelete
  11. Hey Simon – longtime PhoneGap user. Thank you for everything you do. I’m struggling trying to get the resolution of an image (through the camera or gallery) on Phonegap. I can do it through my hackish method listed here: http://stackoverflow.com/questions/15126671/getting-an-image-width-and-height-from-phonegap-before-upload but I’m running into memory issues which causes the app to crash on occasion. Is there a safe way to grab the image size (pixel width & height) in Javascript? Any help would be awesome.

    ReplyDelete
  12. @Turbo

    Yeah, I just posted an answer using the MediaFile instead of having to read the file via the FileWriter.

    ReplyDelete
  13. Hi Simon,

    I think it is a little bit off topic, my question is, is there a plan to address the following problem:

    Error-Message:
    /ipad/native/CordovaLib/Classes/JSON/JSONKit.m:681:12: Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()

    in cordova 2.0.2:
    array->isa = _CDVJKArrayClass;
    in cordova 2.3.0:
    object_setClass(array, _CDVJKArrayClass); // Array case for => XCode 4.6

    in cordova 2.0.2:
    dictionary->isa = _CDVJKDictionaryClass;
    in cordova 2.3.0:
    object_setClass(dictionary, _CDVJKDictionaryClass); // Dictionary case for => XCode 4.6

    thx

    ReplyDelete
  14. @Abulafia

    You should ask this question on the Google Group or raise a JIRA issue.

    ReplyDelete
  15. @Greg Silverman

    Ha, well I guess imitation is the sincerest form of flattery.

    ReplyDelete
  16. Hi Simon,

    I would like to have your suggesion on my task.

    I want to call one method in particular interval of time in phonegap application. I need to set this method as common for all pages. Suppose i started the timer in first page to call my method. When i navigate to second page, the first page timer gets destroyed. The user won't stay in the same page until the timer method getting call after particular time.. I want to add that method as separate process.

     Our requirement is : Need to get latest data (it may be 10 to 20 records) from server and need to store it into local sqlite for further use (we are maintaing one sqlite DB from phonegap not from native code through Sqlite plugin ). This process has to be done by particular time interval.

      How can i do this in phonegap application. I found background plugin in android. I like to do this process as platform independent. Let me know this is possible to do in phonegap.

    Thanks,

    ReplyDelete
  17. @niranjana devi

    You are better off architecting your application as a single page instead of multiple pages. You start off with a really basic html page and load in the other views as you need them. There are a number of JS libraries which make this much easier such as Ember, Backbone, Knockout, Angular. That way your timers will not get clobbered when a user goes to a second page.

    ReplyDelete
  18. Thanks Simon,

    In my application i am using 20 to 25 pages and so many js files. So its difficult to handle all the pages in single html.

    can we use another instance of the webview in the foreground without displaying it to the user?

    Currently the native code load the page into webview in phonegap. Can i create one more instance for webview to load another one page ( this page going to act as background)?

    For example: There are tow pages like main.html and download.html. The main page going to display in webview. I used this code to display the main page super.loadUrl("file:///android_asset/www/main.html");

    Now i want to create new instance of webview to activate the download.html page. this page going to do some process in timer. this page souldn't affect the main page view. It should act as background.

    can we do this in phonegap?

    Thanks,

    ReplyDelete
  19. @niranjana devi

    I probably didn't make myself very clear. I didn't mean you should put all 25 pages into one single html page rather you should be looking at a single page architecture where the additional pages are loaded dynamically:

    https://en.wikipedia.org/wiki/Single-page_application

    Look into some of those frameworks I mentioned.

    No, the second WebView is a bad idea. We had done that in PhoneGap previously and it cause more problems than it solved.

    ReplyDelete