A middleware for mobile sensor programming