Wednesday, May 4, 2011

PhoneGap API -- Working on my HotRod

So I've cloned PhoneGap repositories. I have hello world stuff, regular introductory start one, and kitchen-sink. Kitchen sink is by far the best example. I guess if I were to use the PhoneGap framework, I'd pretty much be using the already made API and just piecing it together for myself.

Let's say agile development wise, I want to create a program that does the basic functions I'm looking for. So that means, I want a program that can simply display some sort of message, and then pop up with a notification, beep and vibration. Let's say stretch goal is that we then write a short file.

Future functionality is saving a time stamp of acknowledgment, sending a message to a server (say visiting a website) thereby noting that a notification was acknowledged, and perhaps eventually sending sms messages...but that one is a real stretch. Time stamp will require accessing time, then writing a file, and saving a file. The file may be xml based or something good for data management, but we can start with something simple like a txt file. Sending a message to a server is actually another stretch. We can start it out by adding a button that sends the database document to a server. Eventually, we would want to have the program access the internet automatically once network is established. This would require the app to run in the background. Sending messages would require a server-client socket exchange. Alternatively, we could complete bypass the file saving and server-client building if we simply had the browser access a secure website immediately on network achievement. The sms message is beyond me for now.

File saving is actually part of the phonegap api, but time stamps, timers, timed notification reminders, server-client socketing, running an app in the background and accessing a website immediately on network establishment are not part of the api. That means we would want to do some native OS programming to get these features working....

Here's what I propose: as Richard had suggested, simply cut out the server-client socketing and try to simply access a website. I'll ask him for the websites and the algorithm/means of getting these websites, and I'll make a button that simply access this website. Shouldn't be so bad right? Eventually, I'll want to make it so that the app does it automatically...that sounds like the native stuff, and that sounds quite a bit harder.

I sort of want to do an agile assessment right now...
Let's see...
I only have two features on the block then. 1) write a simple program that notifies the user. 2) add to that program something that access the internet, loading onto a secure website. 
1) Simple program.
I'm simply going to re-use code from the phonegap example. I'll take the JQuery framework and add an index that either has a notification button or a link to a notification page. The notification will simply pop up, vibrate and beep. Due to the level of reuse and the simplicity of this story, I'm placing this at a small.

2) Access the internet.
I'm going to add a button to the front page that opens up a blank page. The page accesses a website, but doesn't need to load. I won't need to ask Richard for a link to the website, but it wouldn't hurt. The page will be blank, except for a title, and it will also use the JQuery framework. The page will have a back button to get back to index.html . Due to the level of reuse, I think this is a small/medium. I'll place it as a medium just in case.

So, that's one small and one medium for the first iteration. I'm also hoping to do some research in the first iteration. Things that I really need to do more research for are 1) time stamping, 2) timers for the reminder, 3) timer for when the notification is not acknowledged, 4) running the app in the background and accessing the site as soon as a network is connected. This really depends on how much time I'm willing to spend. If I want to, I can simply just research how to do it and complete it. Not sure if it's the first iteration though.

1 comment: