1/* 2 * Copyright (C) 2012 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package android.bordeaux.services; 18 19import android.util.Log; 20import java.util.HashMap; 21import java.util.Map; 22 23class MotionStatsAggregator extends Aggregator { 24 final String TAG = "MotionStatsAggregator"; 25 public static final String CURRENT_MOTION = "Current Motion"; 26 public String[] getListOfFeatures(){ 27 String [] list = new String[1]; 28 list[0] = CURRENT_MOTION; 29 return list; 30 } 31 public Map<String,String> getFeatureValue(String featureName) { 32 HashMap<String,String> m = new HashMap<String,String>(); 33 if (featureName.equals(CURRENT_MOTION)) 34 m.put(CURRENT_MOTION,"Running"); //TODO maybe use clustering for user motion 35 else 36 Log.e(TAG, "There is no motion feature called " + featureName); 37 return (Map) m; 38 } 39} 40