PhoneGap - Remote error logging (incl. uncaught script errors)

Catching and logging runtime errors, like script errors, in PhoneGap can be a challenge. There are several possibilities to write logs and to handle errors with different advantages and disadvantages.

First, local error logging means to create a functionality to send data to a place where someone cares about. Also this will spam the device with a text file or database, occupies memory and the question "when to send where?" has to be solved.

PhoneGap 2.5 - FileTransfer options filename issue

One short missing documentation hint concerning the filename. If using Camera.PictureSourceType.SAVEDPHOTOALBUM you have, at least on Android, to distinguish for FileUploadOptions. If using CAMERA as source type with Camera.DestinationType.FILE_URI the options.filename is not needed for transferring correctly. Check following code snippet:

PhoneGap build, hydration & require.js

Newer versions of PhoneGap support lazy loading of javascript, > 2.4 iOs is working as well. To load injected js files (like phonegap.js and plugins) from the build service with requirejs and hydration enabled, you'll have to include the /data/data/XXX/hydra_app/ directory in paths config (replace XXX with your widget id in config.xml) The starting slash will bypass the baseUrl parameter:

jQuery Mobile - Panel height with big content

To have a nice menu in my PhoneGap application, I decided to use jQuery Mobile 1.3 panels. Because of loading content dynamically, I had some problems with scrolling.

If my dynamically loaded content was higher than the menu, the panel scroll didn't fit. The scroll behavior is dependent on the page scroll (nicely described in jQuery Mobile's issue tracker: "Make panel and page content scroll independently"). But I have found a solution based on the panel events and css overflow & height properties, testet only on Android > 4 so far.

Phonegap - Real persistent storage module (incl jQuery deferred example)

There are several possibilities to store persistent data for a mobile app in Phonegap. But because you cannot be not sure that native HTML capabilities, e.g. localStorage is really stored permanently (see discussion on GoogleGroups), I decided to share my little RequireJS module prototype. It uses JSON and the mobile filesystem which enables also the possibility to use the data even after the app was completely deleted and reinstalled.

Howto: PhoneGap & Youtube (API)

Just a quick win... if your target is to show Youtube videos,  full screen, inside a PhoneGap mobile app... just use Youtube's HTML5 embedding possibilities in combination with PhoneGap's InAppBrowser:

PhoneGap Build - Facebook Connect (Part 2)

After several inquiries, in addition of the links provided in Part 1 here is some sample code for Facebook SSO in a PhoneGap environment (using build.phonegap.com and jQuery Mobile 1.3 for user interface). The connect worked for me currently only on Android devices, but no longer on iOs (using PG version 2.3.0). One obstacle is certainly that I have no Apple device for development, local builds or debugging, only Android.

Cygwin - VisualVM

I tried to use VisualVm for profiling purposes in my current development setup (running Win7 and Cygwin). But the tool did not find my running Java server nor the client, only Eclipse IDE was listed as local application. After some research on the web I figured out that VisualVM searches for the PID file of running java processes in the system's temporary folder. Because of starting the server and client on commandline via Cygwin the PID files were stored in Cygwin's /tmp folder (which is by default not the same than the system' temp).