Phone Gap help wanted


#1

I wasn’t sure how to categorize this because while I collaboration is a bit off the mark, I didn’t want to create a new category just for one post.
What I am looking is not so much collaborate as get assistance. I’m just getting into Phone Gap and I was hoping there might be someone (or someones) who could sit down with me and give me some starting pointers. I have a specific project I’m working on, which I previously made in App Inventor, that I want to redo in Phone Gap. It’s very simple so it seemed like a good starting place for (me) learning something new.

Thanks
• Robb


#2

Hey Robb - there are a handful of us who have used Phone Gap / Cordova recently and could help.

Could you tell us a little more about the project?

Does the interface already exist as a web app somewhere online?

I’m not familiar with app inventor, so I’m not sure how easy it would be to port it. If App Inventor uses HTML/CSS/JS then it will be easy.


#3

Chris et al,
I built the original app in App Inventor which downloads the apk to the phone. While I’ve read you can pry that open I believe all one gets is Java, which won’t be helpful.
That said I mentioned the previous app only because it’s a model to work from. That said it’s dead simple: it just a “clicker” as in two buttons for counting.
What I’m really looking for is someone who can give me a quick tutorial on how to handle events, callbacks, etc. While my Javascript skills are fair I am completely unfamiliar with using them for apps. So help would be greatly appreciated and repaid in beverage of choice.


#4

Here’s a primer to callbacks in JavaScript, using setTimeout(<function>, ms) as a primary example

var callback = function() {
     console.log('Timer done!');
}
setTimeout(callback, 500);

A simple example via StackOverflow.

So setTimeout() is asynchronous and non-blocking which means there’s no way to really know when it’s done executing, that’s where callbacks come into play. When 500ms runs out, setTimeout simply calls the function called callback when it’s done.

Events in JavaScript are usually abstracted to a point where you can run something when an event is triggered. A primary example that comes to mind is the jQuery function .ready()

$(document).ready( function() {
      // run code when document is in ready state
}

Events aren’t just limited to the DOM and certain modules in JS publish their own events; reading the docs will let you know how to hook into when those events are triggered and what events are available for use.