Something went wrong on our end
-
Peter Joseph De Jonckheere CESM2014 authored
Discovered new sensors which were added as possible strategies.Combinations of these and existing will be used to provide best range of possible strategies for detecting sedentary behaviour. To show framework aspects possibly implement a step counter alone to send notifications on each multiple of 100 steps or at the end of each day? Continued to try to refine the notification setup.
Peter Joseph De Jonckheere CESM2014 authoredDiscovered new sensors which were added as possible strategies.Combinations of these and existing will be used to provide best range of possible strategies for detecting sedentary behaviour. To show framework aspects possibly implement a step counter alone to send notifications on each multiple of 100 steps or at the end of each day? Continued to try to refine the notification setup.
SedentaryNotification.java 1.57 KiB
package com.example.notification;
import android.annotation.TargetApi;
import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
import android.app.TaskStackBuilder;
import android.content.Context;
import android.content.Intent;
import android.graphics.Color;
import android.os.Build;
import android.os.IBinder;
import android.support.annotation.Nullable;
import android.support.v4.app.NotificationCompat;
import android.support.v7.app.AppCompatActivity;
import com.example.pharmacy.frontEnd.MainActivity;
import com.example.pharmacy.frontEnd.R;
/**
* Created by pharmacy on 09/01/2018.
*/
public class SedentaryNotification extends Notification {
@Nullable
@Override
public IBinder onBind(Intent intent) {
return null;
}
protected NotificationCompat.Builder setParameters(NotificationCompat.Builder builder) {
//Get parameters from settings? or set strings?
builder.setSmallIcon(0);
builder.setContentTitle("");
builder.setContentText("");
return builder;
}
@TargetApi(26)
protected NotificationChannel setChannelParameters(NotificationChannel nc) {
nc.setDescription("");
nc.enableLights(true);
// Sets the notification light color for notifications posted to this
// channel, if the device supports this feature.
nc.setLightColor(Color.RED);
nc.enableVibration(true);
nc.setVibrationPattern(new long[]{100, 200, 300, 400, 500, 400, 300, 200, 400});
return nc;
}
}