Skip to content
Snippets Groups Projects
Commit d2d2a10b authored by Peter Joseph De Jonckheere CESM2014's avatar Peter Joseph De Jonckheere CESM2014
Browse files

Need to get debug key.

parent 93cffaff
No related branches found
No related tags found
No related merge requests found
......@@ -16,11 +16,12 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">
<meta-data
android:name="com.google.android.awareness.API_KEY"
android:value="AIzaSyDqliqBcEQQAvMZR-RengdLUJaAYeRKbgs"/>
<activity android:name="com.notificationFramework.sedentary.frontEnd.MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
......@@ -56,9 +57,5 @@
</action>
</intent-filter>
</receiver>
<meta-data
android:name="com.google.android.awareness.API_KEY"
android:value="AIzaSyDRgsg2n4oPOSRGZ5qYb1QCAeADwoVC0lA">
</meta-data>
</application>
</manifest>
\ No newline at end of file
......@@ -272,8 +272,9 @@ public class SigMotionDetect extends Service implements StimulusStrategy {
lbm.sendBroadcast(i);
}
private void getExtraData(){
SharedPreferences preferences = this.getSharedPreferences(getString(
R.string.preference_file_key), Context.MODE_PRIVATE);
try {
double latitude = Awareness.getSnapshotClient(this).getLocation()
.getResult().getLocation().getLatitude();
......@@ -283,11 +284,20 @@ public class SigMotionDetect extends Service implements StimulusStrategy {
.getPlaces().getResult().getPlaceLikelihoods();
Weather weather = Awareness.getSnapshotClient(this).getWeather().getResult()
.getWeather();
SharedPreferences.Editor editor = preferences.edit();
editor.putLong(this.getString(R.string.store_lat),Double.doubleToLongBits(latitude));
editor.putLong(this.getString(R.string.store_long),Double.doubleToLongBits(longitude));
editor.putString(this.getString(R.string.store_place), String.valueOf(placeLikelihoods.get(0).getPlace().getName()));
editor.putFloat(this.getString(R.string.store_placelike), placeLikelihoods.get(0).getLikelihood());
editor.putFloat(this.getString(R.string.store_temp),weather.getTemperature(Weather.CELSIUS));
editor.commit();
SaveFile.recordData(latitude, longitude, placeLikelihoods, weather, this);
}catch(SecurityException e){
Intent i = new Intent(this, RequestPermission.class);
startActivity(i);
}
}
/**
* The method which reponds to a bind request for this service.
*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment