Mobile Architecture for Dynamic Generation and Scalable Distribution of Sensor-based Applications