Thursday, April 14, 2011

Barcode check-in app - Beta Testing


Woohoo! *pumps fist*

Yes, thank you, I will use my barcode app. Oh wait, that means it actually has to be done and (mostly) functional. Better get on that!

What need to function for this app to be useful?
  • Scan barcodes and write them to a file - done
  • View barcodes (for verification) - done
  • Email barcodes to Todd - done
I took some time to re-work the menus on this app to use xml files and a MenuInflator instead of building each MenuItem programmatically. I also finally figured out how to use intents to move between Activities within my project (Intent intent = new Intent(this, ViewScans.class);). I still have a problem with going back to a previous Activity if I just came from there, but that's just an annoyance, because it puts another instance of that Activity on the top of the stack. I'm sure there's a better way to deal with this, even if it just means that I re-work the menu options.

After getting everything working, I started thinking about other functionality that I could include in this app - yes, the dreaded "feature creep"! Here's what I came up with:
  • Better way to store settings - email address to send to, default subject line, default storage folder
  • View list of barcode files in a folder
  • Edit barcodes within a file
  • Add a nice icon
Here are some "pie in the sky" features that would be cool, but probably won't happen:
  • Pull the name of the rider associated with a barcode from the GVCC database
  • Option to validate that there are no duplicate barcodes within a file
  • Automatically name files by creation date
Beta testing will commence tonight!

Wednesday, April 6, 2011

Nice and Smooth - Sending email

After having a horrible time with permissions last night, I moved on to figuring out how to send an email with an attachment. It turns out that this is the easiest thing that I've done on Android so far! I just had to create an Intent to ACTION_SEND, add some parameters that are pretty standard, and start her up.

Here's the code:
     Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND);
emailIntent.setType("plain/text");
emailIntent.putExtra(android.content.Intent.EXTRA_EMAIL, new String[]{ "youremail@gmail.com"});
emailIntent.putExtra(android.content.Intent.EXTRA_SUBJECT, "Checkins today");
emailIntent.putExtra(android.content.Intent.EXTRA_TEXT, "Here you go.");
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+Environment.getExternalStorageDirectory()+"/barcodes/checkins.txt"));
emailIntent.setType("text/csv");
startActivity(Intent.createChooser(emailIntent, "Send mail..."));
It's looking more and more like this thing will be ready for prime-time before the B5s race next week. Todd might be pleasantly surprised if he gets the check-ins before the race starts.

Tuesday, April 5, 2011

App Idea - Interval Coach

How many people listen to music while riding the bike trainer inside? I also know that there's a large population of cyclists who listen while riding outside, which I don't recommend, but I know you're out there. How about an app that downloads an interval workout that your coach or yourself sets up online, and provides audio/visual/haptic cues for when to start or stop each interval?

The user would be able to select a set of intervals on the application on their phone (ex: 20min @ 100% LT, 10 min rest, etc), and then click the "start" button. They could have music playing in the background for entertainment. Whenever an interval starts or stops, an audio cue would play, the phone would vibrate, and maybe display a description in large text of what the next command is. An example would be audio plays "Upcoming Interval...20 seconds at max effort...(waits a few seconds)...*beep*beep*beeeeeeeep" and you start the interval. The phone vibrates during the beeps to give some haptic feedback, and if the proximity sensor isn't covered, it displays a description of the interval along with a countdown and some encouraging phrases.

Another feature would allow a coach to set up the athlete's intervals online, and when the athlete was ready to start, the app would download the set of intervals to the phone and start them. Apparently this is a similar feature to what Training Peaks software is already offering, but I think this takes it to a different level by actually participating in the intervals.

Feel free to add any comments or suggestions about any of my app ideas here, or contact me on twitter @mac5mark

Pulling my hair out - Permissions

Don't you hate it when you burn through an hour of work with something that you know should have taken 5 minutes?

I got the barcode intent switches working without any problems the other night, but for some reason I couldn't write a file to the SD card. I only played with it for 5 minutes, and had the correct code written, but it just wasn't working so I moved onto other things (the menus). I decided to sit down and get the file storage working correctly tonight.

First, I did add a line to the AndroidManifest.xml to add permissions for android.permission.WRITE_EXTERNAL_STORAGE. What I didn't realize is that there are multiple places in the Eclipse Manifest tool to specify permissions. There's a drop down under the "Application" tab, and then there's the "Permissions" tab (the obvious place to look). My initial thought was to go to the "Permissions" tab, and add a "Permission" element. Makes sense, right?

Nope, you need to add a "uses-permission" element. Unfortunately, I apparently can't read detail-oriented documentation anymore, so this small difference was lost on me. The worst part about it is that because I wasn't really paying attention to "permission" vs "uses-permission" while I was reading through the websites I looked at, I don't even know what "permission" is used for! All I know is that if you actually want to let your application use some of the phone's resources, you need a "uses-permission" element.

The good news: progress is being made on the app, and I just need to work out some stuff with the menu and some basic cleanup/error handling in the file creation code before it's ready for prime-time. Oh yeah, and the email part too, but as long as I can collect all of the barcodes into a file, that's all I need for now.

Sunday, April 3, 2011

Progress: Barcode check-in app

I made some progress on my barcode scanner app for GVCC last night. After screwing around for 2 hours trying to compile zxing in Eclipse, I gave up and used the "cheap" way and just used the barcode scanner through Intents. What a difference! Used/modified the example code snippet that zxing posted on their website, and within 10 minutes I was scanning barcodes and displaying the results on the screen.

Now I just have to finish up by writing those scanned codes into a file and allowing the user to email the file to a configured email address once all of the scans are completed. I tried messing with the file system, but I don't think I have the permissions set right, or maybe I'm just not saving the file to the correct location. Shouldn't be too hard to figure out, but I just need to get in there and figure out why it's not working.

Saturday, April 2, 2011

App idea: Simple gvcc check-in

This is probably the app that I will start with. Should just be a simple app that uses the camera to scan barcodes and saves them to a file. After everyone has checked in, just press a button to email the file to Todd.

I like this idea for a first attempt at Android development, since it utilizes an external component, helps me be come familiar with using intents to switch between activities, and has most of the basic components of an app (permissions, menus, etc).

Friday, April 1, 2011

App idea: NFL Mock Draft Creator / Analyzer

Social media is powerful. Not from an 'inspiration' standpoint, but from a data and statistics standpoint. Think about how many different websites you've posted your opinions on, and how many other people have done the same thing. Hell, I'm doing it right now!

After reading through a bunch of different NFL-related websites that I regularly visit, I realized that many of the people who were posting their opinions had to post the same opinion over and over again on different sites. I got sick of the talking heads predicting that the Jaguars will take Ryan Kerrigan with their first round pick, and other Jaguars fans posting their opinions of why that wasn't a good pick. Obviously most people aren't draft experts, but during the period of time between the super bowl and the end of April, we like to think that we are. I've noticed a huge increase in the number of 'mock draft' websites and posts. Unfortunately, nobody is a superfan of all 32 NFL teams, so mock drafts are generally pretty myopic. People know which players they want their team to draft, or how they think their team will draft, but it is difficult to get input from other 'experts' from other teams.

I'm planning on writing an app that will address some of the things that I find lacking in many of the mock drafts out there. Here are some of the features that I would like to include.
- create mock drafts using a database of all eligible draft prospects.
- Up to date draft order, including compensatory picks.
- Rank player prospects on your own 'big board'.
- Rank player prospects based on different defensive or offensive schemes. (4-3 vs 3-4 defense, etc)
- Allow users to add a quantifiable reason for the picks that they made. 3 rankings would be used with a scale of agree -> disagree:
     - This pick fills a team need
     - This pick reflects a player that I think this teams tm would pick.
     - This pick is the best available player on the board
- Users could rank the picks on other users mock drafts
- The cumulative data would be used to provide insight into average player rankings, as well as how well this player fits the teams draft strategy.
- After the draft, the mocks could be compared to the actual draft results to determine who had the most accurate mock draft.

Think of it as a continuously updated fan ranking of your mock draft. Even if fan perception of a certain player is off, you could have a record of how accurate your mock draft was after the real draft.

I've realized that many of my apps involve running statistics on large datasets. I love the idea of using many peoples opinions to find a general consensus, and then being able to read everyone's reasons for their decision.

Thoughts dumping ground

I figured that I should create some kind of area where I can keep track of all of my development ideas, and maybe even get some feedback from anyone who cares about what I'm working on. Here we go!