I'm not sure exactly what you need, but I achieved something similar by creating a phonegap pluggin that writes data to a static class where I store the information. Then, when I need to access it from javascript, the plugin just asks for a static class. Is this what you tried to accomplish?
source share