Monthly Archive: May 2011

Eight Foursquare resources for colleges and universities

Selected bits of this post are also cross-posted on the W&M Creative Services Blog

FoursquareWhile working with William & Mary’s Foursquare presence and from my personal use of Foursquare over the past year or so, I’ve collected a few links I’ve found particularly useful, ranging from explaining what Foursquare is to those unfamiliar with the site, to resources for folks in higher ed in particular:

  1. Foursquare 101 offers an excellent introduction of what Foursquare is and how it works courtesy of the About Foursquare blog (this blog also offers a lot of great info and tips, as well as the latest Foursquare news)
  2. The Foursquare Support site is a good starting point for more specific questions, from how to use Foursquare to etiquette to software issues, all this is info straight from the source.
  3. Official Foursquare for Universities page is the place to start to see how other schools are using Foursquare, benefits to using Foursquare on your campus, and to apply to have your school get a branded page.
  4. Getting started with Foursquare for colleges and universities is a great overview from About Foursquare for what to do to start up your campus’ Foursquare presence.
  5. Here’s why Dave Olsen from WVU thinks Foursquare can help your school
  6. Badges are quite popular on Foursquare and they’ve made a set just for colleges and universities (just make sure that the primary category for each venue is “College/University – <type of venue>,” otherwise checkins at these venues won’t go towards unlocking the college-themed badges).
  7. If you’re looking to flesh out some of your school’s venues with some photos (and you don’t want them to be ones just from your mobile phone), About Foursquare describes a nice way to upload photos from your desktop (a little programming knowledge is required).
  8. Working with all of William & Mary‘s venues I’ve spent a lot of time using a site called tidysquare. It will display, on a map, all the Foursquare venues for a given location, show you possible duplicates, as well as find venues with incomplete information. It’s a great place to start if you’re working to clean up your campus’ venues or just looking for a way to gauge how much of a Foursquare presence has been established in your area.
Super what?

So one of the things I think is really cool (and smart) about Foursquare is that they crowdsource the maintenance of their venues. Folks known as “superusers” are given permission to update and add information to the various venues in an effort to keep the data as accurate as possible. There are three levels of superusers, ranging from 1 (the lowest) to 3 (the highest), and Foursquare just opened things up yesterday so that anyone can apply to become a superuser (as long as you promise to use your powers for good). I had been a “Level 1 Superuser” courtesy of all the work I’ve done with William & Mary’s Foursquare presence but, being the geek I am, I applied to be upgraded yesterday to a Level 2 Superuser. The whole thing really appeals to my super-organized side so I’m excited to appease that and help out the larger Foursquare community at the same time 🙂

So after all that I encourage you to create a Foursquare profile for your school or organization if you don’t have one already, claim venues around your campus, add new venues, offer tips to share some insider knowledge about your area, and find out all the new places this location-based stuff can take you.


Full-screen video playback for Android

AndroidSo you want to have video playback in your Android app? This is pretty straightforward to do once you know what you’re looking for and, aside from a few (rather tedious to figure out) small snags which I’ll go into later, can be completed relatively quickly.

What we wanted to do for W&M’s Dress the Griffin app was, when a button was pressed, open a video fullscreen, automatically play it, and when the video completes, return to the previous screen. It took me a while to find the correct Android widget to use, but once I did, things were pretty straightforward (I went off-track for a bit trying to get a MediaPlayer to work, but it turns out there’s a VideoView explicitly for doing what I was looking to accomplish).

The two main files you’ll need for a full-screen video player are a new Activity class that will create a VideoView and set it as the main content view until the video playback has completed:

package yourpkg;

import android.os.Bundle;
import android.widget.VideoView;

public class VideoPlayer extends Activity
   implements OnCompletionListener {

	private VideoView mVideoView;

	public void onCreate(Bundle b) {
		// Bring the video player to the front
		// Get a handle on the VideoView
		mVideoView =
		// Load in the video file
		// Handle when the video finishes playing
		// Start playing the video

	public void onCompletion(MediaPlayer mp) {
		// The video has finished, return from this activity

And a layout XML file to show your video fullscreen:

<?xml version="1.0" encoding="utf-8"?>
<!-- Create a full-screen layout
	The video I'm playing back is portrait/vertical so
	set the orientation accordingly.

<!-- Create a full-screen VideoView -->


Once these are set up you are pretty much ready to go, all you’ll need to do is start the video playback activity, spurred by a button press or something similar:

Intent videoPlaybackActivity =
	new Intent(v.getContext(), VideoPlayer.class);

and you’re off.

The three main things you have to be aware of are file size, aspect ratio, and video encoding.

File Size: Try and make your video the smallest file size and lowest resolution that you can tolerate, since this will be played back on a myriad of devices with a wide range of memory limitations.

Aspect Ratio: Keep in mind your video will be letterboxed to fit the screen dimensions of each device, so make sure you can handle the smallest size and screen density that you can (depending on what devices you plan on supporting). For more about supporting multiple screen sizes the Android documentation offers a pretty nice overview.

Video Encoding: This caused me more problems than anything else. I was presented with a lot of “Sorry this video cannot be played” messages, blank screens that would immediately kick back to the main screen, or blank screens that would only play the audio and not the video on my way to finding the correct video encoding (and all of those symptoms are frequently, if not exclusively, caused by incorrect video encoding).

The Android documentation’s list of supported media formats was a good start, but even when I thought I had the correct encoding I was still having major issues with playback. Luckily a great open-source multi-platform video transcoder app called Handbrake came to the rescue. After tweaking seemingly every possible combination of controls in Handbrake I ended up back on what was essentially the “iPhone and iPod Touch” preset. So here are the video export settings for Handbrake that worked for me for video playback for Android:

  • MP4 format (so end up with a .m4v file)
  • MPEG-4 video codec (with “constant quality” setting QP 14)
  • AAC audio codec, 128 kbps

The only change from the “iPhone and iPod Touch” preset is that the video codec is changed from H.264 to MPEG-4. This tweak wasn’t really intuitive from the documentation (which made it seem like either H.264 or MPEG-4 should’ve been fine) but this is what ultimately worked for me.

Happy full-screen video playing!