From 1fdb6fd54c55c482a1ce3993525ff3cb73de2f36 Mon Sep 17 00:00:00 2001 From: Waruna Samarsinghe Date: Fri, 13 May 2016 14:15:39 +0530 Subject: [PATCH] fix bugs location and accelerometer --- .../app/build.gradle | 0 .../app/src/main/AndroidManifest.xml | 0 .../iot/android/sense/RegisterActivity.java | 0 .../sense/constants/SenseConstants.java | 0 .../data/publisher/DataPublisherReceiver.java | 0 .../data/publisher/DataPublisherService.java | 123 ++++++++++-------- .../android/sense/data/publisher/Event.java | 95 +++++++++----- .../mqtt/AndroidSenseMQTTHandler.java | 0 .../mqtt/transport/MQTTTransportHandler.java | 2 +- .../mqtt/transport/TransportHandler.java | 0 .../transport/TransportHandlerException.java | 0 .../sense/event/SenseScheduleReceiver.java | 0 .../iot/android/sense/event/SenseService.java | 0 .../sense/event/streams/DataReader.java | 0 .../event/streams/Location/LocationData.java | 0 .../streams/Location/LocationDataReader.java | 119 +++++++++++------ .../event/streams/SenseDataCollector.java | 0 .../event/streams/Sensor/SensorData.java | 0 .../streams/Sensor/SensorDataReader.java | 4 +- .../event/streams/battery/BatteryData.java | 0 .../streams/battery/BatteryDataReceiver.java | 0 .../realtimeviewer/ActivitySelectSensor.java | 0 .../realtimeviewer/datastore/TempStore.java | 0 .../event/RealTimeSensorChangeReceiver.java | 0 .../event/realtimesensor/RealTimeSensor.java | 0 .../realtimesensor/RealTimeSensorReader.java | 0 .../AvailableSensorsInDevice.java | 0 .../sensorlisting/SupportedSensors.java | 0 .../view/adaptor/SensorViewAdaptor.java | 0 .../sensor/selector/SelectSensorDialog.java | 0 .../sense/speech/detector/IVoiceControl.java | 0 .../detector/WordRecognitionActivity.java | 0 .../detector/util/ListeningActivity.java | 0 .../speech/detector/util/ProcessWords.java | 0 .../detector/util/StringSimilarity.java | 0 .../util/VoiceRecognitionListener.java | 0 .../sense/speech/detector/util/WordData.java | 0 .../iot/android/sense/util/LocalRegistry.java | 0 .../iot/android/sense/util/SenseClient.java | 0 .../sense/util/SenseClientAsyncExecutor.java | 0 .../android/sense/util/SenseDataHolder.java | 15 ++- .../iot/android/sense/util/SenseUtils.java | 0 .../iot/android/sense/util/SenseWakeLock.java | 0 .../sense/util/dto/AccessTokenInfo.java | 0 .../sense/util/dto/AndroidConfiguration.java | 0 .../util/dto/AndroidSenseManagerService.java | 0 .../ApiApplicationRegistrationService.java | 0 .../util/dto/ApiRegistrationProfile.java | 0 .../dto/DynamicClientRegistrationService.java | 0 .../sense/util/dto/OAuthApplicationInfo.java | 0 .../util/dto/OAuthRequestInterceptor.java | 0 .../android/sense/util/dto/RegisterInfo.java | 0 .../sense/util/dto/RegistrationProfile.java | 0 .../sense/util/dto/TokenIssuerService.java | 0 .../app/src/main/res/drawable/mic.png | Bin .../src/main/res/drawable/pushtoserver.png | Bin .../app/src/main/res/drawable/sensor.png | Bin .../src/main/res/drawable/side_nav_bar.xml | 0 .../activity_activity_select_sensor.xml | 0 .../src/main/res/layout/activity_register.xml | 0 .../res/layout/activity_sense_settings.xml | 0 .../res/layout/activity_speech_sense_main.xml | 0 .../layout/app_bar_activity_select_sensor.xml | 0 .../layout/content_activity_select_sensor.xml | 0 .../main/res/layout/display_sensor_values.xml | 0 .../layout/fragment_select_sensor_dialog.xml | 0 .../nav_header_activity_select_sensor.xml | 0 ...activity_activity_select_sensor_drawer.xml | 0 .../main/res/menu/activity_select_sensor.xml | 0 .../src/main/res/menu/menu_sense_settings.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../app/src/main/res/mipmap-hdpi/wso2logo.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../src/main/res/raw/client_truststore.bks | Bin .../app/src/main/res/raw/wso2carbon.cer | Bin .../app/src/main/res/values-v21/styles.xml | 0 .../app/src/main/res/values-w820dp/dimens.xml | 0 .../app/src/main/res/values/device.xml | 0 .../app/src/main/res/values/dimens.xml | 0 .../app/src/main/res/values/strings.xml | 0 .../res/values/strings_activity_register.xml | 0 .../app/src/main/res/values/styles.xml | 0 .../build.gradle | 2 +- .../gradle/wrapper/gradle-wrapper.properties | 4 +- .../gradlew.bat | 0 .../pom.xml | 0 .../settings.gradle | 0 89 files changed, 226 insertions(+), 138 deletions(-) mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/build.gradle mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/AndroidManifest.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/RegisterActivity.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/constants/SenseConstants.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherReceiver.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/Event.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/AndroidSenseMQTTHandler.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandler.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandlerException.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseScheduleReceiver.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/DataReader.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationData.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationDataReader.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/SenseDataCollector.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorData.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorDataReader.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryData.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryDataReceiver.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/ActivitySelectSensor.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/datastore/TempStore.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/RealTimeSensorChangeReceiver.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensor.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensorReader.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/AvailableSensorsInDevice.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/SupportedSensors.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/adaptor/SensorViewAdaptor.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/sensor/selector/SelectSensorDialog.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/IVoiceControl.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/WordRecognitionActivity.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ListeningActivity.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ProcessWords.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/StringSimilarity.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/VoiceRecognitionListener.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/WordData.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/LocalRegistry.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClient.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClientAsyncExecutor.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseDataHolder.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseUtils.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseWakeLock.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AccessTokenInfo.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidConfiguration.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidSenseManagerService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiApplicationRegistrationService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiRegistrationProfile.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/DynamicClientRegistrationService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthApplicationInfo.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthRequestInterceptor.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegisterInfo.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegistrationProfile.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/TokenIssuerService.java mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/mic.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/pushtoserver.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/sensor.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/side_nav_bar.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_activity_select_sensor.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_sense_settings.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_speech_sense_main.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/app_bar_activity_select_sensor.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/content_activity_select_sensor.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/display_sensor_values.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/fragment_select_sensor_dialog.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/nav_header_activity_select_sensor.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_activity_select_sensor_drawer.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_select_sensor.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/menu_sense_settings.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/ic_launcher.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/wso2logo.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-mdpi/ic_launcher.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xhdpi/ic_launcher.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xxhdpi/ic_launcher.png mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/client_truststore.bks mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/wso2carbon.cer mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-v21/styles.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-w820dp/dimens.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/device.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/dimens.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings_activity_register.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/styles.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/build.gradle mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradle/wrapper/gradle-wrapper.properties mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradlew.bat mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/pom.xml mode change 100644 => 100755 components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/settings.gradle diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/build.gradle b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/build.gradle old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/AndroidManifest.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/AndroidManifest.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/RegisterActivity.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/RegisterActivity.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/constants/SenseConstants.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/constants/SenseConstants.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherReceiver.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherReceiver.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java old mode 100644 new mode 100755 index a95f94767c..694445f735 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/DataPublisherService.java @@ -29,6 +29,8 @@ import org.wso2.carbon.iot.android.sense.data.publisher.mqtt.transport.MQTTTrans import org.wso2.carbon.iot.android.sense.data.publisher.mqtt.transport.TransportHandlerException; import org.wso2.carbon.iot.android.sense.constants.SenseConstants; import org.wso2.carbon.iot.android.sense.event.streams.Location.LocationData; +import org.wso2.carbon.iot.android.sense.event.streams.Location.LocationDataReader; + import org.wso2.carbon.iot.android.sense.event.streams.Sensor.SensorData; import org.wso2.carbon.iot.android.sense.event.streams.battery.BatteryData; import org.wso2.carbon.iot.android.sense.speech.detector.util.ProcessWords; @@ -50,6 +52,7 @@ public class DataPublisherService extends Service { private static String VALUE_TAG = "value"; public static Context context; + LocationData gps; @Nullable @Override @@ -66,64 +69,74 @@ public class DataPublisherService extends Service { public void run() { try { List events = new ArrayList<>(); - //retreive sensor data. + //retrieve sensor data. List sensorDataMap = SenseDataHolder.getSensorDataHolder(); - for (SensorData sensorData : sensorDataMap) { - Event event = new Event(); - event.setTimestamp(sensorData.getTimestamp()); - switch (sensorData.getSensorType()) { - case Sensor.TYPE_ACCELEROMETER: - event.setAccelerometer(sensorData.getSensorValues()); - events.add(event); - break; - case Sensor.TYPE_MAGNETIC_FIELD: - event.setMagnetic(sensorData.getSensorValues()); - events.add(event); - break; - case Sensor.TYPE_GYROSCOPE: - event.setGyroscope(sensorData.getSensorValues()); - events.add(event); - break; - case Sensor.TYPE_LIGHT: - event.setLight(sensorData.getSensorValues()[0]); - break; - case Sensor.TYPE_PRESSURE: - event.setPressure(sensorData.getSensorValues()[0]); - events.add(event); - break; - case Sensor.TYPE_PROXIMITY: - event.setProximity(sensorData.getSensorValues()[0]); - events.add(event); - break; - case Sensor.TYPE_GRAVITY: - event.setGravity(sensorData.getSensorValues()); - events.add(event); - break; - case Sensor.TYPE_GAME_ROTATION_VECTOR: - event.setRotation(sensorData.getSensorValues()); - events.add(event); - break; + if (!sensorDataMap.isEmpty()) { + for (SensorData sensorData : sensorDataMap) { + Event event = new Event(); + event.setTimestamp(sensorData.getTimestamp()); + switch (sensorData.getSensorType()) { + case Sensor.TYPE_ACCELEROMETER: + event.setAccelerometer(sensorData.getSensorValues()); + events.add(event); + break; + case Sensor.TYPE_MAGNETIC_FIELD: + event.setMagnetic(sensorData.getSensorValues()); + events.add(event); + break; + case Sensor.TYPE_GYROSCOPE: + event.setGyroscope(sensorData.getSensorValues()); + events.add(event); + break; + case Sensor.TYPE_LIGHT: + event.setLight(sensorData.getSensorValues()[0]); + break; + case Sensor.TYPE_PRESSURE: + event.setPressure(sensorData.getSensorValues()[0]); + events.add(event); + break; + case Sensor.TYPE_PROXIMITY: + event.setProximity(sensorData.getSensorValues()[0]); + events.add(event); + break; + case Sensor.TYPE_GRAVITY: + event.setGravity(sensorData.getSensorValues()); + events.add(event); + break; + case Sensor.TYPE_GAME_ROTATION_VECTOR: + event.setRotation(sensorData.getSensorValues()); + events.add(event); + break; + } } } SenseDataHolder.resetSensorDataHolder(); - //retreive batter data. + //retrieve batter data. List batteryDataMap = SenseDataHolder.getBatteryDataHolder(); - for (BatteryData batteryData : batteryDataMap) { - Event event = new Event(); - event.setTimestamp(batteryData.getTimestamp()); - event.setBattery(batteryData.getLevel()); - events.add(event); + + if (!batteryDataMap.isEmpty()) { + + for (BatteryData batteryData : batteryDataMap) { + Event event = new Event(); + event.setTimestamp(batteryData.getTimestamp()); + event.setBattery(batteryData.getLevel()); + events.add(event); + } + } SenseDataHolder.resetBatteryDataHolder(); - //retreive location data. + //retrieve location data. List locationDataMap = SenseDataHolder.getLocationDataHolder(); - for (LocationData locationData : locationDataMap) { - Event event = new Event(); - event.setTimestamp(locationData.getTimeStamp()); - event.setGps(new double[]{locationData.getLatitude(), locationData.getLongitude()}); - events.add(event); - } + + if (!locationDataMap.isEmpty()) { + for (LocationData locationData : locationDataMap) { + Event event = new Event(); + event.setTimestamp(locationData.getTimeStamp()); + event.setGps(new double[]{locationData.getLatitude(), locationData.getLongitude()}); + events.add(event); + } + } SenseDataHolder.resetLocationDataHolder(); //retrieve words @@ -158,13 +171,19 @@ public class DataPublisherService extends Service { event.setDeviceId(deviceId); jsonArray.put(new JSONObject().put("event", event.getEvent())); } + MQTTTransportHandler mqttTransportHandler = AndroidSenseMQTTHandler.getInstance(context); if (!mqttTransportHandler.isConnected()) { mqttTransportHandler.connect(); } - String topic = LocalRegistry.getTenantDomain(context) + "/" + SenseConstants - .DEVICE_TYPE + "/" + deviceId + "/data"; - mqttTransportHandler.publishDeviceData(user, deviceId, jsonArray.toString(), topic); + + + String topic = "wso2/" + LocalRegistry.getTenantDomain(context) + "/" + SenseConstants + .DEVICE_TYPE + "/" + deviceId + "/data"; + mqttTransportHandler.publishDeviceData(user, deviceId, jsonArray.toString(), topic); + + + } } catch (JSONException e) { Log.e(TAG, "Json Data Parsing Exception", e); diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/Event.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/Event.java old mode 100644 new mode 100755 index a8d936010f..cae36625b4 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/Event.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/Event.java @@ -2,6 +2,9 @@ package org.wso2.carbon.iot.android.sense.data.publisher; import org.json.JSONException; import org.json.JSONObject; +import org.wso2.carbon.iot.android.sense.event.streams.Location.LocationData; +import android.util.Log; + /** * This hold the definition of the stream that android sense is publishing to. @@ -26,8 +29,11 @@ public class Event { private String wordStatus; private long timestamp; + private static final String TAG = Event.class.getName(); + LocationData gpsLoc; + private int getBattery() { - return battery; + return this.battery; } public void setBattery(int battery) { @@ -36,7 +42,8 @@ public class Event { } private double[] getGps() { - return gps != null ? gps : new double[]{0, 0}; + + return gps != null ? this.gps : new double[]{gps[0],gps[1]}; } public void setGps(double[] gps) { @@ -45,7 +52,7 @@ public class Event { } private float[] getAccelerometer() { - return accelerometer != null ? accelerometer : new float[]{0, 0, 0}; + return this.accelerometer != null ? this.accelerometer : new float[]{0, 0, 0}; } public void setAccelerometer(float[] accelerometer) { @@ -54,7 +61,7 @@ public class Event { } private float[] getMagnetic() { - return magnetic != null ? magnetic : new float[]{0, 0, 0}; + return this.magnetic != null ? this.magnetic : new float[]{0, 0, 0}; } public void setMagnetic(float[] magnetic) { @@ -63,7 +70,7 @@ public class Event { } private float[] getGyroscope() { - return gyroscope != null ? gyroscope : new float[]{0, 0, 0}; + return this.gyroscope != null ? this.gyroscope : new float[]{0, 0, 0}; } public void setGyroscope(float[] gyroscope) { @@ -72,7 +79,7 @@ public class Event { } public float getLight() { - return light; + return this.light; } public void setLight(float light) { @@ -81,7 +88,7 @@ public class Event { } public float getPressure() { - return pressure; + return this.pressure; } public void setPressure(float pressure) { @@ -90,7 +97,7 @@ public class Event { } public float getProximity() { - return proximity; + return this.proximity; } public void setProximity(float proximity) { @@ -99,7 +106,7 @@ public class Event { } private float[] getGravity() { - return gravity != null ? gravity : new float[]{0, 0, 0}; + return this.gravity != null ? this.gravity : new float[]{0, 0, 0}; } public void setGravity(float gravity[]) { @@ -108,7 +115,7 @@ public class Event { } private float[] getRotation() { - return rotation != null ? rotation : new float[]{0, 0, 0}; + return this.rotation != null ? this.rotation : new float[]{0, 0, 0}; } public void setRotation(float rotation[]) { @@ -125,7 +132,7 @@ public class Event { } private String getWord() { - return word != null ? word : ""; + return this.word != null ? this.word : ""; } public void setWord(String word) { @@ -176,44 +183,60 @@ public class Event { JSONObject jsonPayloadData = new JSONObject(); jsonPayloadData.put("battery", getBattery()); - //gps - double gpsEvents[] = getGps(); - jsonPayloadData.put("gps_lat", gpsEvents[0]); - jsonPayloadData.put("gps_long", gpsEvents[1]); - //acceleromter - float events[] = getAccelerometer(); - jsonPayloadData.put("accelerometer_x", events[0]); - jsonPayloadData.put("accelerometer_y", events[1]); - jsonPayloadData.put("accelerometer_z", events[2]); + //gps & accelerometer + + if (gps !=null && accelerometer !=null) { + jsonPayloadData.put("gps_lat", gps[0]); + jsonPayloadData.put("gps_long", gps[1]); + + jsonPayloadData.put("accelerometer_x", accelerometer[0]); + jsonPayloadData.put("accelerometer_y", accelerometer[1]); + jsonPayloadData.put("accelerometer_z", accelerometer[2]); + } + + //magnetic - events = getMagnetic(); - jsonPayloadData.put("magnetic_x", events[0]); - jsonPayloadData.put("magnetic_y", events[1]); - jsonPayloadData.put("magnetic_z", events[2]); + //events = getMagnetic(); + if (magnetic !=null) { + jsonPayloadData.put("magnetic_x", magnetic[0]); + jsonPayloadData.put("magnetic_y", magnetic[1]); + jsonPayloadData.put("magnetic_z", magnetic[2]); + } //gyroscope - events = getGyroscope(); - jsonPayloadData.put("gyroscope_x", events[0]); - jsonPayloadData.put("gyroscope_y", events[1]); - jsonPayloadData.put("gyroscope_z", events[2]); + //events = getGyroscope(); + + if (gyroscope != null) { + jsonPayloadData.put("gyroscope_x", gyroscope[0]); + jsonPayloadData.put("gyroscope_y", gyroscope[1]); + jsonPayloadData.put("gyroscope_z", gyroscope[2]); + } + jsonPayloadData.put("light", getLight()); + jsonPayloadData.put("pressure", getPressure()); jsonPayloadData.put("proximity", getProximity()); //gravity - events = getGravity(); - jsonPayloadData.put("gravity_x", events[0]); - jsonPayloadData.put("gravity_y", events[1]); - jsonPayloadData.put("gravity_z", events[2]); + //events = getGravity(); + if (gravity!=null) { + jsonPayloadData.put("gravity_x", gravity[0]); + jsonPayloadData.put("gravity_y", gravity[1]); + jsonPayloadData.put("gravity_z", gravity[2]); + } //rotation - events = getRotation(); - jsonPayloadData.put("rotation_x", events[0]); - jsonPayloadData.put("rotation_y", events[1]); - jsonPayloadData.put("rotation_z", events[2]); + //events = getRotation(); + if (rotation!=null) { + jsonPayloadData.put("rotation_x", rotation[0]); + jsonPayloadData.put("rotation_y", rotation[1]); + jsonPayloadData.put("rotation_z", rotation[2]); + } //word jsonPayloadData.put("word", getWord()); jsonPayloadData.put("word_sessionId", getWordSessionId()); jsonPayloadData.put("word_status", getWordStatus()); + + jsonEvent.put("payloadData", jsonPayloadData); return jsonEvent; diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/AndroidSenseMQTTHandler.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/AndroidSenseMQTTHandler.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java old mode 100644 new mode 100755 index 17884381c0..c2bd4b5d29 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/MQTTTransportHandler.java @@ -77,7 +77,7 @@ public abstract class MQTTTransportHandler implements MqttCallback, TransportHan String username = LocalRegistry.getUsername(context); String deviceId = LocalRegistry.getDeviceId(context); this.clientId = deviceId + ":" + SenseConstants.DEVICE_TYPE; - this.subscribeTopic = LocalRegistry.getTenantDomain(context)+ "/" + SenseConstants.DEVICE_TYPE + "/" + + this.subscribeTopic = "wso2/" + LocalRegistry.getTenantDomain(context)+ "/" + SenseConstants.DEVICE_TYPE + "/" + deviceId + "/command/#"; this.clientWillTopic = DISCONNECTION_WILL_TOPIC_PREFIX + SenseConstants.DEVICE_TYPE; this.mqttBrokerEndPoint = LocalRegistry.getMqttEndpoint(context); diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandler.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandler.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandlerException.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/data/publisher/mqtt/transport/TransportHandlerException.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseScheduleReceiver.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseScheduleReceiver.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/SenseService.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/DataReader.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/DataReader.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationData.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationData.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationDataReader.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationDataReader.java old mode 100644 new mode 100755 index ca97f21200..565ad85b10 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationDataReader.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Location/LocationDataReader.java @@ -23,75 +23,101 @@ import org.wso2.carbon.iot.android.sense.event.streams.DataReader; import org.wso2.carbon.iot.android.sense.util.SenseDataHolder; import java.util.concurrent.TimeUnit; + + + /** * This is used to retrieve the location data using GPS and used Network connection to increase the accuracy. */ public class LocationDataReader extends DataReader implements LocationListener { protected LocationManager locationManager; - private Context mContext; + private final Context mContext; + + LocationData gps; + + // flag for GPS status + private boolean isGPSEnabled = false; + + // flag for network status + private boolean isNetworkEnabled = false; + + // flag for GPS status private boolean canGetLocation = false; + //private boolean canGetLocation = false; private static final String TAG = LocationDataReader.class.getName(); Location location; // location double latitude; // latitude double longitude; // longitude + // The minimum distance to change Updates in meters + private static final long MIN_DISTANCE_CHANGE_FOR_UPDATES = 10; // 10 meters + + // The minimum time between updates in milliseconds + private static final long MIN_TIME_BW_UPDATES = 1000 * 60 * 1; // 1 minute + public LocationDataReader(Context context) { - mContext = context; + this.mContext = context; getLocation(); } public Location getLocation() { - locationManager = (LocationManager) mContext.getSystemService(mContext.LOCATION_SERVICE); - - // getting GPS status - boolean isGPSEnabled = locationManager - .isProviderEnabled(LocationManager.GPS_PROVIDER); - - // getting network status - boolean isNetworkEnabled = locationManager - .isProviderEnabled(LocationManager.NETWORK_PROVIDER); - - if (!isGPSEnabled && !isNetworkEnabled) { - // no network provider is enabled - } else { - this.canGetLocation = true; - // First get location from Network Provider - if (isNetworkEnabled) { - locationManager.requestLocationUpdates( - LocationManager.NETWORK_PROVIDER, 0, 0, this); - // MIN_TIME_BW_UPDATES, - // MIN_DISTANCE_CHANGE_FOR_UPDATES, this); - - if (locationManager != null) { - location = locationManager - .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); - if (location != null) { - latitude = location.getLatitude(); - longitude = location.getLongitude(); - } - } - } - // if GPS Enabled get lat/long using GPS Services - if (isGPSEnabled) { - if (location == null) { - locationManager.requestLocationUpdates( - LocationManager.GPS_PROVIDER, 0, 0, this); - //MIN_TIME_BW_UPDATES, - //MIN_DISTANCE_CHANGE_FOR_UPDATES, this); + try { + + locationManager = (LocationManager) mContext + .getSystemService(mContext.LOCATION_SERVICE); - Log.d(TAG, "GPS Enabled"); + // getting GPS status + isGPSEnabled = locationManager + .isProviderEnabled(LocationManager.GPS_PROVIDER); + + // getting network status + isNetworkEnabled = locationManager + .isProviderEnabled(LocationManager.NETWORK_PROVIDER); + + if (!isGPSEnabled && !isNetworkEnabled) { + // no network provider is enabled + } else { + this.canGetLocation = true; + if (isNetworkEnabled) { + locationManager.requestLocationUpdates( + LocationManager.NETWORK_PROVIDER, + MIN_TIME_BW_UPDATES, + MIN_DISTANCE_CHANGE_FOR_UPDATES, this); + Log.d("Network", "Network"); if (locationManager != null) { location = locationManager - .getLastKnownLocation(LocationManager.GPS_PROVIDER); + .getLastKnownLocation(LocationManager.NETWORK_PROVIDER); if (location != null) { latitude = location.getLatitude(); longitude = location.getLongitude(); } } } + // if GPS Enabled get lat/long using GPS Services + if (isGPSEnabled) { + if (location == null) { + locationManager.requestLocationUpdates( + LocationManager.GPS_PROVIDER, + MIN_TIME_BW_UPDATES, + MIN_DISTANCE_CHANGE_FOR_UPDATES, this); + Log.d("GPS Enabled", "GPS Enabled"); + if (locationManager != null) { + location = locationManager + .getLastKnownLocation(LocationManager.GPS_PROVIDER); + if (location != null) { + latitude = location.getLatitude(); + longitude = location.getLongitude(); + } + } + } + } } + + } catch (Exception e) { + e.printStackTrace(); } + return location; } @@ -148,6 +174,7 @@ public class LocationDataReader extends DataReader implements LocationListener { } + @Override public void run() { Log.d(TAG, "running -Location"); @@ -155,8 +182,16 @@ public class LocationDataReader extends DataReader implements LocationListener { TimeUnit.MILLISECONDS.sleep(10000); double lat = getLatitude(); double longit = getLongitude(); + + + if (lat != 0 && longit != 0) { - SenseDataHolder.getLocationDataHolder().add(new LocationData(getLatitude(), getLongitude())); + Log.d(TAG, "YYY " + getLatitude() + ", XXX " + getLongitude()); + + gps = new LocationData(getLatitude(), getLongitude()); + + SenseDataHolder.getLocationDataHolder().add(gps); + } } catch (InterruptedException e) { // Restore the interrupted status diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/SenseDataCollector.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/SenseDataCollector.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorData.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorData.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorDataReader.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorDataReader.java old mode 100644 new mode 100755 index f1d9445623..3a57d4d48f --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorDataReader.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/Sensor/SensorDataReader.java @@ -97,8 +97,8 @@ public class SensorDataReader extends DataReader implements SensorEventListener @Override public void run() { Log.d(TAG, "running -sensorDataMap"); - Vector sensorDatas = getSensorData(); - for (SensorData data : sensorDatas) { + Vector sensorDetails = getSensorData(); + for (SensorData data : sensorDetails) { SenseDataHolder.getSensorDataHolder().add(data); } } diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryData.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryData.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryDataReceiver.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/event/streams/battery/BatteryDataReceiver.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/ActivitySelectSensor.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/ActivitySelectSensor.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/datastore/TempStore.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/datastore/TempStore.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/RealTimeSensorChangeReceiver.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/RealTimeSensorChangeReceiver.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensor.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensor.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensorReader.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/event/realtimesensor/RealTimeSensorReader.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/AvailableSensorsInDevice.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/AvailableSensorsInDevice.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/SupportedSensors.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/sensorlisting/SupportedSensors.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/adaptor/SensorViewAdaptor.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/adaptor/SensorViewAdaptor.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/sensor/selector/SelectSensorDialog.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/realtimeviewer/view/sensor/selector/SelectSensorDialog.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/IVoiceControl.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/IVoiceControl.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/WordRecognitionActivity.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/WordRecognitionActivity.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ListeningActivity.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ListeningActivity.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ProcessWords.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/ProcessWords.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/StringSimilarity.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/StringSimilarity.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/VoiceRecognitionListener.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/VoiceRecognitionListener.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/WordData.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/speech/detector/util/WordData.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/LocalRegistry.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/LocalRegistry.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClient.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClient.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClientAsyncExecutor.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseClientAsyncExecutor.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseDataHolder.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseDataHolder.java old mode 100644 new mode 100755 index 463cf8ab9f..8f0cefb56c --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseDataHolder.java +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseDataHolder.java @@ -17,9 +17,10 @@ import org.wso2.carbon.iot.android.sense.event.streams.Location.LocationData; import org.wso2.carbon.iot.android.sense.event.streams.Sensor.SensorData; import org.wso2.carbon.iot.android.sense.event.streams.battery.BatteryData; import org.wso2.carbon.iot.android.sense.speech.detector.util.WordData; - import java.util.List; import java.util.concurrent.CopyOnWriteArrayList; +import android.util.Log; + /** * This holds the sensor,battery and location data inmemory. @@ -31,6 +32,12 @@ public class SenseDataHolder { private static List locationDataHolder; private static List wordDataHolder; + //LocationData gps; + + + private static final String TAG = SenseDataHolder.class.getName(); + + public static List getSensorDataHolder(){ if(sensorDataHolder == null){ sensorDataHolder = new CopyOnWriteArrayList<>(); @@ -46,10 +53,14 @@ public class SenseDataHolder { } public static List getLocationDataHolder(){ + + if(locationDataHolder == null){ + locationDataHolder = new CopyOnWriteArrayList<>(); } - return locationDataHolder; + return locationDataHolder; + } public static List getWordDataHolder(){ diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseUtils.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseUtils.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseWakeLock.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/SenseWakeLock.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AccessTokenInfo.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AccessTokenInfo.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidConfiguration.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidConfiguration.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidSenseManagerService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/AndroidSenseManagerService.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiApplicationRegistrationService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiApplicationRegistrationService.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiRegistrationProfile.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/ApiRegistrationProfile.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/DynamicClientRegistrationService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/DynamicClientRegistrationService.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthApplicationInfo.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthApplicationInfo.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthRequestInterceptor.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/OAuthRequestInterceptor.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegisterInfo.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegisterInfo.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegistrationProfile.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/RegistrationProfile.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/TokenIssuerService.java b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/java/org/wso2/carbon/iot/android/sense/util/dto/TokenIssuerService.java old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/mic.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/mic.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/pushtoserver.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/pushtoserver.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/sensor.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/sensor.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/side_nav_bar.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/drawable/side_nav_bar.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_activity_select_sensor.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_activity_select_sensor.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_register.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_sense_settings.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_sense_settings.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_speech_sense_main.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/activity_speech_sense_main.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/app_bar_activity_select_sensor.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/app_bar_activity_select_sensor.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/content_activity_select_sensor.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/content_activity_select_sensor.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/display_sensor_values.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/display_sensor_values.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/fragment_select_sensor_dialog.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/fragment_select_sensor_dialog.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/nav_header_activity_select_sensor.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/layout/nav_header_activity_select_sensor.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_activity_select_sensor_drawer.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_activity_select_sensor_drawer.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_select_sensor.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/activity_select_sensor.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/menu_sense_settings.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/menu/menu_sense_settings.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/ic_launcher.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/ic_launcher.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/wso2logo.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-hdpi/wso2logo.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-mdpi/ic_launcher.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-mdpi/ic_launcher.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xhdpi/ic_launcher.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xhdpi/ic_launcher.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xxhdpi/ic_launcher.png b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/mipmap-xxhdpi/ic_launcher.png old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/client_truststore.bks b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/client_truststore.bks old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/wso2carbon.cer b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/raw/wso2carbon.cer old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-v21/styles.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-v21/styles.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-w820dp/dimens.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values-w820dp/dimens.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/device.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/device.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/dimens.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/dimens.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings_activity_register.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/strings_activity_register.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/styles.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/app/src/main/res/values/styles.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/build.gradle b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/build.gradle old mode 100644 new mode 100755 index 952246faf1..83876c80ad --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/build.gradle +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/build.gradle @@ -6,7 +6,7 @@ buildscript { maven { url 'https://repo.eclipse.org/content/repositories/paho-releases/' } } dependencies { - classpath 'com.android.tools.build:gradle:1.3.0' + classpath 'com.android.tools.build:gradle:2.1.0' // NOTE: Do not place your application dependencies here; they belong // in the individual module build.gradle files diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradle/wrapper/gradle-wrapper.properties b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradle/wrapper/gradle-wrapper.properties old mode 100644 new mode 100755 index 5a1377c93b..e7ff442f33 --- a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradle/wrapper/gradle-wrapper.properties +++ b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Fri Dec 11 10:25:01 IST 2015 +#Wed May 11 14:40:10 IST 2016 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-2.4-all.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradlew.bat b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/gradlew.bat old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/pom.xml b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/pom.xml old mode 100644 new mode 100755 diff --git a/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/settings.gradle b/components/iot-plugins/androidsense-plugin/org.wso2.carbon.device.mgt.iot.androidsense.agent/settings.gradle old mode 100644 new mode 100755