TimeTracker updated (again!)

This post is more than 2 years old.

Well I'm done. Mostly anyway. I set out when creating this application to get more familiar with SQLite, and I've certainly done that. Today I think the TimeTracker application is finally complete. A lot of folks helped out with it so I definitely can't take all (or most) of the credit.

In this final build I added a few more features, including, the CSV export, which was pretty fun to build. Creating the CSV string was trivial. I even went the extra step and had the string properly handle data with commas and quotes.

To save the file, I used this excellent article by Mike Chambers. It's pretty trivial actually to ask a user to pick a file and then save the data. AIR really does make this simple.

I also added some basic validation to the forms in the application to make it a bit more stable.

I will warn folks though - I wrote this to learn, and I wrote it as I needed a way to track hours. But frankly, I wouldn't trust my code. If you want to really use it, I beg you to use the CSV export feature to make backups. I don't want to be responsible for someone losing all their data.

It was also suggested that I put this application up on RIAForge. As I have an "in" with the manager, I was able to get the project approved pretty quickly. You can download both the AIR file and source here:

http://timetrackerair.riaforge.org/

Now on to my next AIR project.

Raymond Camden's Picture

About Raymond Camden

Raymond is a senior developer evangelist for Adobe. He focuses on document services, JavaScript, and enterprise cat demos. If you like this article, please consider visiting my Amazon Wishlist or donating via PayPal to show your support. You can even buy me a coffee!

Lafayette, LA https://www.raymondcamden.com

Archived Comments

Comment 1 by Raul Riera posted on 3/27/2008 at 6:34 AM

Have you seen the Scheduler Framework for Flex? (http://code.google.com/p/fl... It should be a pretty nice addition to this software, I personally dont use these kind of time trackers applications, but I think it should be useful for you to have a calendar of the hours spent on every project pretty much like this AIR app does (free but not opensource) http://klok.mcgraphix.com/k...

Comment 2 by Raul Riera posted on 3/27/2008 at 6:43 AM

Also, you might want to check out this URL http://www.scalenine.com/ this is pimp my ride for Flex applications hehe. I was fooling aroun with your app, I dont think you should be able to track 0 hours worked on a project :)

Comment 3 by aflex posted on 3/27/2008 at 9:50 AM

ERROR: log.mxml
Problem finding external file: ../as/csv.as
???

Comment 4 by Raymond Camden posted on 3/27/2008 at 5:45 PM

@Raul: Nope, haven't seen it yet.

@AFlex: I just got the code from RIAForge and am not seeing this error. Does anyone else see it?

Comment 5 by rob Rohan posted on 3/27/2008 at 7:50 PM

@ray - yes I see it too

SMacBookPro:src robrohan$ amxmlc TimeTracker.mxml
Loading configuration file /Applications/flex_sdk_3.0.0.477/frameworks/air-config.xml
/Users/robrohan/Projects/TimeTracker/src/views/log.mxml(8): Error: Problem finding external file: ../as/csv.as

<mx:Script source="../as/csv.as" />

/Users/robrohan/Projects/TimeTracker/src/views/stats.mxml(119): Error: Type was not found or was not a compile-time constant: PieChart.

<mx:PieChart id="hourreport" width="100%" height="100%" dataProvider="{hourData}" showDataTips="true">

Comment 6 by shaunw posted on 4/2/2008 at 8:41 AM

still can't delete hour entries?

Comment 7 by Raymond Camden posted on 4/2/2008 at 2:53 PM

What's wrong, can't you be perfect? ;) I know - I need to add it. Not sure when. I may do delete and no edit since hour entries are so simple.

Comment 8 by shaunw posted on 4/2/2008 at 3:27 PM

i agree delete with no edit would be perfect

Comment 9 by Charlie Arehart posted on 4/22/2008 at 7:19 AM

Ray, for those of us who got an earlier version of the app, can you tell us if getting the updated version would keep the previous data, or not?

I have the version from about Mar 24. I'm not finding any means by which to find previously entered hours, which is a bummer. I can't tell if they got added. I even added some more, and still don't see them. I only have hours, clients, and projects tab. Is there something I may be missing?

Or if I do update to the latest version (what you last blogged on 3/26), will I at least not lose whatever I *have* added? Thanks in advance.

Comment 10 by Raymond Camden posted on 4/22/2008 at 5:34 PM

In general I'd recommend re-entering the data. While I was working on this demo, I always assumed starting with a virgin DB.

Going _forward_ now that the project is really released, I'll document how to back up the db, restore it, whatever.

Comment 11 by Neil posted on 4/22/2008 at 8:48 PM

Hi Ray...
I also see these errors. Fresh download from RIAforge

ERROR: log.mxml
Problem finding external file: ../as/csv.as

Unable to locate specified base class 'mx.core.WindowedApplication' for component class 'PDFSample'.

Comment 12 by Raymond Camden posted on 4/22/2008 at 8:55 PM

Get the file here: http://www.coldfusionjedi.c...

Rename to .air

Try to run it again. Tell me if that works for you please.

Comment 13 by Neil posted on 4/22/2008 at 9:14 PM

Yes that one works. The air files were fine. I'm not able to compile from the src folder. That's when I get those 2 errors above.

Comment 14 by Raymond Camden posted on 4/22/2008 at 9:16 PM

What src folder? Oh -I bet when I did the include source thing for RIAForge I forgot that. For this build just now I didn't bother with include source.

I rebuilt, used include source. Please hit the URL again (not RIAForge) and see if that source lets you build.

If so, I'll update RIAForge.

Comment 15 by Neil posted on 4/22/2008 at 9:25 PM

Hey Ray...
That worked! Thanks for the quick help. I'm going to go through it now. Thanks for your time and efforts.

Neil

Comment 16 by Raymond Camden posted on 4/22/2008 at 10:18 PM

RIAForge updated.

For those curious - I have begun my new AIR project. It is pretty interesting, but I haven't got far with it yet.

Comment 17 by Charlie Arehart posted on 4/22/2008 at 10:22 PM

@Ray, but that's the thing. (You said, "I'd recommend re-entering the data.") I don't see how to view what data I have entered. I just assumed there's be some way (which may seem a mistake on my part to start entering data before confirming that, but really, I have to think I'm just missing something.)

So to be clear, I'm not asking for a mechanism to "backup the data". I hear you saying you'll add that in the future. I'm asking how simply to view what I have entered.

Or more simply, if I apply an updated version, will that pickup the previously entered data? Or if you just don't know, where would I find the data? I looked through the files in C:\Program Files\TimeTracker and didn't see anything obvious as a database. Is it elsewhere? Thanks

Comment 18 by Raymond Camden posted on 4/22/2008 at 10:33 PM

Hmm, what I meant was - except for this final version I had released, I had not thought much about getting the old data. You _could_ use a SQLite manager to select * from the tables. This would then let you re-enter stuff in my application.

You ask - if you run this new version, will it pick up the old data.

In theory - yes. I am using the same file name I used from the very beginning. As tables have changed I've told people to kill the old install, but the tables haven't changed for a while, so in theory, you should be able to just reinstall.

BUT PLEASE, PLEASE, PLEASE note I have not tested this - if you have CRITICAL info in the db - and I hope not (I mean not from before I put it on RIAForge), then you want to find the db first.

As for finding the file, look for data.db. I'm not sure where Windows/AIR will lay that down, but when you find the results, you want to look for a folder named TimeTracker.

Comment 19 by Charlie Arehart posted on 4/23/2008 at 12:20 AM

Well, again, my first question was not about extracting data: just about viewing it within the app. I'm sure you meant for us to do that. :-) But I'll let that go. I realize you have so many versions now that you may not be able to help say how to view it in the version I have.

I found the file (thanks for the filename). If it helps others, in my case (on Vista), it's in C:\Users\charlie arehart\AppData\Roaming\TimeTracker.673D3FE53725BD48A19FFA91A34D61B8245C3551.1\Local Store\data.db.)

I'll back that up, apply the update, and if it can't see it, I'll open the file with some other approach to get at the old data. Thanks.

Comment 20 by Raymond Camden posted on 4/23/2008 at 12:26 AM

I must have been confused. If your version doesn't have the Hours Log tab, then it is too old to view data. The newer revs had 'Hours Log' and let you see all, or filter, and export.

Comment 21 by Raymond Camden posted on 4/23/2008 at 8:51 PM

I'm going to hijack the conversation here - which is allowed since it is my blog.

I had a user tell me he got:

"This application requires a version of the Adobe Integrated Runtime (AIR) which is no longer supported. Please contact the application author for an updated version."

When he tried to run the zip from RIAForge. Is anyone else getting that?

Comment 22 by Raymond Camden posted on 4/23/2008 at 10:08 PM

Ignore - the user wrote back and said he had an older version of AIR on his machine.