Custom Software Development...

Your Dream, Your Software…

RDM Infinity has the skills to build that system tweak, software modification, or complete system that you have always wanted. Whether it is a complete set of technical specifications or a doodle that you drew on a napkin, we can get it done. RDM Infinity has the staff, engineers, and dreamers ready to go to get your new software up and running.

RDM Infinity offers several prebuilt software packages ranging from project management to online photo management. Contact us today to discuss these solutions to see if they are right for you.

Custom Software Development News

Phonegap ChildBroswer

We love mobile projects here. They are what we live and breathe here almost everyday. When you are trying to create something that has never been done before you are bound to run into some technical hurdles along the way. 

We are in the process of creating an application for a customer that utlizes the wicked cool Phonegap toolset. While we have used this tool on many projects in the past we have never had the oppertuinity to integrate that with the Google Apps suite (another amazing set of tools). We need to authenticate the application using the provided Google OAuth protocol. Should be easy enough we thought. We added the ChildBrowser plugin to open the needed windows, added a little javascript, and there was the authentication code we needed. Nice and easy everyone take the rest of the day off with pay…..

That is what we thought. We then realized that even though we had the code on the screen how do we grab the authentication code that is being displayed? In reading through the Google OAuth docs we found that the success code is being returned in the title of the window as well. Much to our suprise we had no way to access the title of the page that was being opened in the ChildBrowser plugin. After a few hours of Google searches we found that many other people have had the same problem.

After some investigation into the code we found that the ChildBrowser plugin is using the onPageStarted event to pass the location url back to calling function. The problem is that the webview title is not set until the page is finished loading. So here is what we did.

We added a onPageFinished event to the ChildBrowser.java code and added a new event type:


private static int LOCATION_FINISHEDLOAD_EVENT = 2;
....
@Override
         public void onPageFinished(WebView view, String url) {
            super.onPageFinished(view,url);
           try
          {
              JSONObject obj = new JSONOject();
              obj.put("type",LOCATION_FINISHEDLOAD_EVENT);
              obj.put("title",view.getTitle());
              obj.put("location",url);
              sendUpdate(obj,true);
           }catch (JSONException e) {
                Log.d("ChildBrowser", "This should never happen");
           }
      }

Once we added this to the ChildBroswer.java we had to tweak the childBrowser.js to use the new event that we are passing in and what to do with the event when we call it. We added the event decleration and edited the _onEvent method of childBrowser.js:

ChildBrowser.LOCATION_FINISHEDLOAD_EVENT = 1;
....
if (data.type == ChildBrowser.LOCATION_FINISHEDLOAD_EVENT && typeof window.plugins.childBrowser.onLocationFinished === "function") {
        window.plugins.childBrowser.onLocationFinished(data.title,data.location);
}

Just like that we had access to the page title once the page was finished loading!

We posted the entire thing on Github so you can use it also. Get the code here: https://github.com/rdminfinity/phonegap-plugins

I hope this helps someone else out in the future.

Happy coding!

Variable Mapping

This last month, I’ve had the opportunity to work on a mapping project that was full of a lot of firsts for myself. It was a lot of fun (sometimes stressful and frustrating. but mostly fun…) working through the steps the customers were looking for and then planning out the steps utilizing tools like jQuery and the Google Apps API. The customer was looking for their product locations to be mapped on their new mobile application and marked according to proximity to the user’s current location.

Google Maps has a very complete API for javascript even though it can be a bit confusing at times. Utilizing Geocoding to find the user’s location, I compared the various product locations using the Distance Matrix to rate the proximity for the user. Each location was marked with Overlays that contain the product information for the individualized locations.

This project will be a very powerful tool for our client and their customer base. It also proved to be an exciting and challenging project for myself. Being a programmer and self-declared Geek I’m always excited about the new challenges each day brings and being bored just doesn’t happen!

© 2011 RDM Infinity, LLC. All rights reserved.