diff --git a/app/build.gradle b/app/build.gradle
index 8bcaf080..d3a68793 100644
--- a/app/build.gradle
+++ b/app/build.gradle
@@ -11,8 +11,8 @@ android {
compileSdkVersion 29
buildToolsVersion '29.0.2'
useLibrary 'org.apache.http.legacy'
- versionCode 116
- versionName "1.7.2"
+ versionCode 117
+ versionName "1.7.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
diff --git a/app/src/apkFlavor/AndroidManifest.xml b/app/src/apkFlavor/AndroidManifest.xml
index 5ac27c15..84884a92 100644
--- a/app/src/apkFlavor/AndroidManifest.xml
+++ b/app/src/apkFlavor/AndroidManifest.xml
@@ -152,6 +152,7 @@
+
diff --git a/app/src/main/java/com/jens/automation2/Action.java b/app/src/main/java/com/jens/automation2/Action.java
index 61763e2e..bb31d05d 100644
--- a/app/src/main/java/com/jens/automation2/Action.java
+++ b/app/src/main/java/com/jens/automation2/Action.java
@@ -44,6 +44,7 @@ public class Action
setScreenBrightness,
playSound,
vibrate,
+ createNotification,
sendTextMessage;
public String getFullName(Context context)
@@ -108,6 +109,8 @@ public class Action
return context.getResources().getString(R.string.sendTextMessage);
case setScreenBrightness:
return context.getResources().getString(R.string.setScreenBrightness);
+ case createNotification:
+ return context.getResources().getString(R.string.createNotification);
default:
return "Unknown";
}
@@ -237,6 +240,9 @@ public class Action
case setScreenBrightness:
returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.setScreenBrightness));
break;
+ case createNotification:
+ returnString.append(Miscellaneous.getAnyContext().getResources().getString(R.string.createNotification));
+ break;
default:
returnString.append(action.toString());
}
@@ -281,7 +287,7 @@ public class Action
}
else
if (parameter2 != null && parameter2.length() > 0)
- returnString.append(": " + parameter2);
+ returnString.append(": " + parameter2.replace(Action.actionParameter2Split, "; "));
return returnString.toString();
}
@@ -451,6 +457,9 @@ public class Action
case playSound:
Actions.playSound(getParameter1(), getParameter2());
break;
+ case createNotification:
+ Actions.createNotification(this);
+ break;
default:
Miscellaneous.logEvent("w", "Action", context.getResources().getString(R.string.unknownActionSpecified), 3);
break;
diff --git a/app/src/main/java/com/jens/automation2/Actions.java b/app/src/main/java/com/jens/automation2/Actions.java
index 4df26e7b..0858fb43 100644
--- a/app/src/main/java/com/jens/automation2/Actions.java
+++ b/app/src/main/java/com/jens/automation2/Actions.java
@@ -8,7 +8,6 @@ import android.app.PendingIntent;
import android.app.admin.DevicePolicyManager;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
-import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.content.ActivityNotFoundException;
import android.content.Context;
@@ -28,7 +27,6 @@ import android.telephony.SmsManager;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Log;
-import android.view.WindowManager;
import android.widget.Toast;
import androidx.annotation.RequiresApi;
@@ -54,6 +52,7 @@ import java.lang.reflect.Method;
import java.net.InetAddress;
import java.net.NetworkInterface;
import java.security.KeyStore;
+import java.util.Calendar;
import java.util.Collections;
import java.util.List;
import java.util.Set;
@@ -79,7 +78,27 @@ public class Actions
public static final String wireguard_tunnel_down = "com.wireguard.android.action.SET_TUNNEL_DOWN";
public static final String wireguard_tunnel_refresh = "com.wireguard.android.action.REFRESH_TUNNEL_STATES";
- public static class WifiStuff
+ public static void createNotification(Action action)
+ {
+ String[] elements = action.getParameter2().split(Action.actionParameter2Split);
+
+ Miscellaneous.logEvent("w", "createNotification", "Creating notification with title " + elements[0] + " and text " + elements[1], 3);
+
+ int notificationId = Math.round(Calendar.getInstance().getTimeInMillis()/1000);
+
+ try
+ {
+ String title = Miscellaneous.replaceVariablesInText(elements[0], Miscellaneous.getAnyContext());
+ String text = Miscellaneous.replaceVariablesInText(elements[1], Miscellaneous.getAnyContext());
+ Miscellaneous.createDismissibleNotification(title, text, notificationId, false, AutomationService.NOTIFICATION_CHANNEL_ID_RULES, null);
+ }
+ catch (Exception e)
+ {
+ Miscellaneous.logEvent("w", "createNotification", "Error occurred while replacing vars: " + Log.getStackTraceString(e), 3);
+ }
+ }
+
+ public static class WifiStuff
{
public static Boolean setWifi(Context context, Boolean desiredState, boolean toggleActionIfPossible)
{
diff --git a/app/src/main/java/com/jens/automation2/ActivityManageActionBrightnessSetting.java b/app/src/main/java/com/jens/automation2/ActivityManageActionBrightnessSetting.java
index 1225e7e8..1a901903 100644
--- a/app/src/main/java/com/jens/automation2/ActivityManageActionBrightnessSetting.java
+++ b/app/src/main/java/com/jens/automation2/ActivityManageActionBrightnessSetting.java
@@ -14,6 +14,9 @@ import androidx.annotation.Nullable;
public class ActivityManageActionBrightnessSetting extends Activity
{
+ public static final String intentNameAutoBrightness = "autoBrightness";
+ public static final String intentNameBrightnessValue = "brightnessValue";
+
CheckBox chkAutoBrightness;
SeekBar sbBrightness;
Button bApplyBrightness;
@@ -32,11 +35,11 @@ public class ActivityManageActionBrightnessSetting extends Activity
Intent input = getIntent();
- if(input.hasExtra("autoBrightness"))
- chkAutoBrightness.setChecked(input.getBooleanExtra("autoBrightness", false));
+ if(input.hasExtra(intentNameAutoBrightness))
+ chkAutoBrightness.setChecked(input.getBooleanExtra(intentNameAutoBrightness, false));
- if(input.hasExtra("brightnessValue"))
- sbBrightness.setProgress(input.getIntExtra("brightnessValue", 0));
+ if(input.hasExtra(intentNameBrightnessValue))
+ sbBrightness.setProgress(input.getIntExtra(intentNameBrightnessValue, 0));
bApplyBrightness.setOnClickListener(new View.OnClickListener()
{
@@ -44,8 +47,8 @@ public class ActivityManageActionBrightnessSetting extends Activity
public void onClick(View view)
{
Intent answer = new Intent();
- answer.putExtra("autoBrightness", chkAutoBrightness.isChecked());
- answer.putExtra("brightnessValue", sbBrightness.getProgress());
+ answer.putExtra(intentNameAutoBrightness, chkAutoBrightness.isChecked());
+ answer.putExtra(intentNameBrightnessValue, sbBrightness.getProgress());
setResult(RESULT_OK, answer);
finish();
}
diff --git a/app/src/main/java/com/jens/automation2/ActivityManageActionCreateNotification.java b/app/src/main/java/com/jens/automation2/ActivityManageActionCreateNotification.java
new file mode 100644
index 00000000..d4f8bc41
--- /dev/null
+++ b/app/src/main/java/com/jens/automation2/ActivityManageActionCreateNotification.java
@@ -0,0 +1,66 @@
+package com.jens.automation2;
+
+import android.app.Activity;
+import android.content.Intent;
+import android.os.Bundle;
+import android.view.View;
+import android.widget.Button;
+import android.widget.EditText;
+import android.widget.Toast;
+
+import androidx.annotation.Nullable;
+
+import org.apache.commons.lang3.StringUtils;
+
+public class ActivityManageActionCreateNotification extends Activity
+{
+ public static final String intentNameNotificationTitle = "notificationTitle";
+ public static final String intentNameNotificationText = "notificationText";
+
+ EditText etNotificationTitle, etNotificationText;
+ Button bSaveActionNotification;
+
+ @Override
+ protected void onCreate(@Nullable Bundle savedInstanceState)
+ {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_manage_action_create_notification);
+
+ etNotificationTitle = (EditText) findViewById(R.id.etNotificationTitle);
+ etNotificationText = (EditText)findViewById(R.id.etNotificationText);
+ bSaveActionNotification = (Button)findViewById(R.id.bSaveActionNotification);
+
+ Intent input = getIntent();
+
+ if(input.hasExtra(intentNameNotificationTitle))
+ etNotificationTitle.setText(input.getStringExtra(intentNameNotificationTitle));
+
+ if(input.hasExtra(intentNameNotificationText))
+ etNotificationText.setText(input.getStringExtra(intentNameNotificationText));
+
+ bSaveActionNotification.setOnClickListener(new View.OnClickListener()
+ {
+ @Override
+ public void onClick(View view)
+ {
+ if(StringUtils.isBlank(etNotificationTitle.getText().toString()))
+ {
+ Toast.makeText(ActivityManageActionCreateNotification.this, getResources().getString(R.string.enterTitle), Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ if(StringUtils.isBlank(etNotificationText.getText().toString()))
+ {
+ Toast.makeText(ActivityManageActionCreateNotification.this, getResources().getString(R.string.enterText), Toast.LENGTH_LONG).show();
+ return;
+ }
+
+ Intent answer = new Intent();
+ answer.putExtra(intentNameNotificationTitle, etNotificationTitle.getText().toString());
+ answer.putExtra(intentNameNotificationText, etNotificationText.getText().toString());
+ setResult(RESULT_OK, answer);
+ finish();
+ }
+ });
+ }
+}
diff --git a/app/src/main/java/com/jens/automation2/ActivityManageRule.java b/app/src/main/java/com/jens/automation2/ActivityManageRule.java
index 0ef6f245..6e49f4a6 100644
--- a/app/src/main/java/com/jens/automation2/ActivityManageRule.java
+++ b/app/src/main/java/com/jens/automation2/ActivityManageRule.java
@@ -115,6 +115,8 @@ public class ActivityManageRule extends Activity
final static int requestCodeActionSendTextMessageEdit = 5002;
final static int requestCodeActionVibrateAdd = 801;
final static int requestCodeActionVibrateEdit = 802;
+ final static int requestCodeActionCreateNotificationAdd = 803;
+ final static int requestCodeActionCreateNotificationEdit = 804;
public static ActivityManageRule getInstance()
{
@@ -353,8 +355,8 @@ public class ActivityManageRule extends Activity
break;
case setScreenBrightness:
Intent activityEditScreenBrightnessIntent = new Intent(ActivityManageRule.this, ActivityManageActionBrightnessSetting.class);
- activityEditScreenBrightnessIntent.putExtra("autoBrightness", a.getParameter1());
- activityEditScreenBrightnessIntent.putExtra("brightnessValue", Integer.parseInt(a.getParameter2()));
+ activityEditScreenBrightnessIntent.putExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, a.getParameter1());
+ activityEditScreenBrightnessIntent.putExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, Integer.parseInt(a.getParameter2()));
startActivityForResult(activityEditScreenBrightnessIntent, requestCodeActionScreenBrightnessEdit);
break;
case vibrate:
@@ -362,6 +364,13 @@ public class ActivityManageRule extends Activity
activityEditVibrateIntent.putExtra("vibratePattern", a.getParameter2());
startActivityForResult(activityEditVibrateIntent, requestCodeActionVibrateEdit);
break;
+ case createNotification:
+ Intent activityEditCreateNotificationIntent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
+ String[] elements = a.getParameter2().split(Action.actionParameter2Split);
+ activityEditCreateNotificationIntent.putExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle, elements[0]);
+ activityEditCreateNotificationIntent.putExtra(ActivityManageActionCreateNotification.intentNameNotificationText, elements[1]);
+ startActivityForResult(activityEditCreateNotificationIntent, requestCodeActionCreateNotificationEdit);
+ break;
case playSound:
Intent actionPlaySoundIntent = new Intent(context, ActivityManageActionPlaySound.class);
actionPlaySoundIntent.putExtra("edit", true);
@@ -1335,8 +1344,8 @@ public class ActivityManageRule extends Activity
{
if(resultCode == RESULT_OK)
{
- newAction.setParameter1(data.getBooleanExtra("autoBrightness", false));
- newAction.setParameter2(String.valueOf(data.getIntExtra("brightnessValue", 0)));
+ newAction.setParameter1(data.getBooleanExtra(ActivityManageActionBrightnessSetting.intentNameAutoBrightness, false));
+ newAction.setParameter2(String.valueOf(data.getIntExtra(ActivityManageActionBrightnessSetting.intentNameBrightnessValue, 0)));
newAction.setParentRule(ruleToEdit);
ruleToEdit.getActionSet().add(newAction);
this.refreshActionList();
@@ -1367,6 +1376,20 @@ public class ActivityManageRule extends Activity
this.refreshActionList();
}
}
+ else if(requestCode == requestCodeActionCreateNotificationAdd)
+ {
+ if(resultCode == RESULT_OK)
+ {
+ newAction.setParentRule(ruleToEdit);
+ newAction.setParameter2(
+ data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle)
+ + Action.actionParameter2Split +
+ data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationText)
+ );
+ ruleToEdit.getActionSet().add(newAction);
+ this.refreshActionList();
+ }
+ }
else if(requestCode == requestCodeActionVibrateEdit)
{
if(resultCode == RESULT_OK)
@@ -1379,6 +1402,22 @@ public class ActivityManageRule extends Activity
this.refreshActionList();
}
}
+ else if(requestCode == requestCodeActionCreateNotificationEdit)
+ {
+ if(resultCode == RESULT_OK)
+ {
+ ruleToEdit.getActionSet().get(editIndex).setParentRule(ruleToEdit);
+
+ if(data.hasExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle))
+ ruleToEdit.getActionSet().get(editIndex).setParameter2(
+ data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationTitle)
+ + Action.actionParameter2Split +
+ data.getStringExtra(ActivityManageActionCreateNotification.intentNameNotificationText)
+ );
+
+ this.refreshActionList();
+ }
+ }
else if(requestCode == requestCodeActionPlaySoundAdd)
{
if(resultCode == RESULT_OK)
@@ -1519,6 +1558,8 @@ public class ActivityManageRule extends Activity
items.add(new Item(typesLong[i].toString(), R.drawable.sound));
else if(types[i].toString().equals(Action_Enum.vibrate.toString()))
items.add(new Item(typesLong[i].toString(), R.drawable.vibrate));
+ else if(types[i].toString().equals(Action_Enum.createNotification.toString()))
+ items.add(new Item(typesLong[i].toString(), R.drawable.notification));
else if(types[i].toString().equals(Action_Enum.sendTextMessage.toString()))
{
// if(ActivityPermissions.isPermissionDeclaratedInManifest(ActivityManageSpecificRule.this, "android.permission.SEND_SMS") && !Miscellaneous.isGooglePlayInstalled(ActivityManageSpecificRule.this))
@@ -1681,6 +1722,12 @@ public class ActivityManageRule extends Activity
Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionVibrate.class);
startActivityForResult(intent, requestCodeActionVibrateAdd);
}
+ else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.createNotification.toString()))
+ {
+ newAction.setAction(Action_Enum.createNotification);
+ Intent intent = new Intent(ActivityManageRule.this, ActivityManageActionCreateNotification.class);
+ startActivityForResult(intent, requestCodeActionCreateNotificationAdd);
+ }
else if(Action.getActionTypesAsArray()[which].toString().equals(Action_Enum.setScreenBrightness.toString()))
{
newAction.setAction(Action_Enum.setScreenBrightness);
diff --git a/app/src/main/java/com/jens/automation2/ActivityPermissions.java b/app/src/main/java/com/jens/automation2/ActivityPermissions.java
index 57d29794..d2db3b92 100644
--- a/app/src/main/java/com/jens/automation2/ActivityPermissions.java
+++ b/app/src/main/java/com/jens/automation2/ActivityPermissions.java
@@ -529,7 +529,7 @@ public class ActivityPermissions extends Activity
break;
case sendTextMessage:
addToArrayListUnique(Manifest.permission.SEND_SMS, requiredPermissions);
- checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
+ getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
break;
case setAirplaneMode:
addToArrayListUnique(Manifest.permission.WRITE_SETTINGS, requiredPermissions);
@@ -588,7 +588,7 @@ public class ActivityPermissions extends Activity
// addToArrayListUnique("android.permission.TETHER_PRIVILEGED", requiredPermissions);
break;
case speakText:
- checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
+ getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
break;
case startOtherActivity:
if(
@@ -608,7 +608,7 @@ public class ActivityPermissions extends Activity
break;
case triggerUrl:
addToArrayListUnique(Manifest.permission.INTERNET, requiredPermissions);
- checkPermissionsInVariableUse(action.getParameter2(), requiredPermissions);
+ getPermissionsForVariablesInUse(action.getParameter2(), requiredPermissions);
break;
case turnBluetoothOff:
addToArrayListUnique(Manifest.permission.BLUETOOTH_ADMIN, requiredPermissions);
@@ -1150,7 +1150,7 @@ public class ActivityPermissions extends Activity
}
}
- static ArrayList checkPermissionsInVariableUse(String text, ArrayList permsList)
+ static ArrayList getPermissionsForVariablesInUse(String text, ArrayList permsList)
{
/*
[uniqueid]
diff --git a/app/src/main/java/com/jens/automation2/AutomationService.java b/app/src/main/java/com/jens/automation2/AutomationService.java
index a14a91d0..51d4aac8 100644
--- a/app/src/main/java/com/jens/automation2/AutomationService.java
+++ b/app/src/main/java/com/jens/automation2/AutomationService.java
@@ -41,8 +41,16 @@ public class AutomationService extends Service implements OnInitListener
protected final static int notificationIdRestrictions = 1005;
protected final static int notificationIdLocationRestriction = 1006;
- final static String NOTIFICATION_CHANNEL_ID = "com.jens.automation2";
- final static String channelName = "Service notification";
+// final static String NOTIFICATION_CHANNEL_ID = "com.jens.automation2";
+
+ final static String NOTIFICATION_CHANNEL_ID_SERVICE = "com.jens.automation2_service";
+ final static String NOTIFICATION_CHANNEL_NAME_SERVICE = "Service notification";
+
+ final static String NOTIFICATION_CHANNEL_ID_FUNCTIONALITY = "com.jens.automation2_functionality";
+ final static String NOTIFICATION_CHANNEL_NAME_FUNCTIONALITY = "Functionality information";
+
+ final static String NOTIFICATION_CHANNEL_ID_RULES = "com.jens.automation2_rules";
+ final static String NOTIFICATION_CHANNEL_NAME_RULES = "Rule notifications";
protected static Notification myNotification;
protected static NotificationCompat.Builder notificationBuilder = null;
@@ -205,7 +213,7 @@ public class AutomationService extends Service implements OnInitListener
Intent myIntent = new Intent(this, ActivityMainTabLayout.class);
myPendingIntent = PendingIntent.getActivity(this, 0, myIntent, 0);
- notificationBuilder = createDefaultNotificationBuilder();
+ notificationBuilder = createServiceNotificationBuilder();
updateNotification();
@@ -365,9 +373,9 @@ public class AutomationService extends Service implements OnInitListener
Miscellaneous.logEvent("w", "Features disabled", "Features disabled because of rule " + rule, 5);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
- Miscellaneous.createDismissableNotificationWithDelay(1010, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, pi);
+ Miscellaneous.createDismissibleNotificationWithDelay(1010, null, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
else
- Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, pi);
+ Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), ActivityPermissions.notificationIdPermissions, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
}
}
}
@@ -389,9 +397,9 @@ public class AutomationService extends Service implements OnInitListener
Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5);
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
- Miscellaneous.createDismissableNotificationWithDelay(3300, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, pi);
+ Miscellaneous.createDismissibleNotificationWithDelay(3300, null, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
else
- Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, pi);
+ Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), notificationIdRestrictions, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
}
}
}
@@ -411,9 +419,9 @@ public class AutomationService extends Service implements OnInitListener
Miscellaneous.logEvent("w", "Features disabled", "Background location disabled because Google to blame.", 5);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O_MR1)
- Miscellaneous.createDismissableNotificationWithDelay(2200, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
+ Miscellaneous.createDismissibleNotificationWithDelay(2200, null, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
else
- Miscellaneous.createDismissableNotification(getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, pi);
+ Miscellaneous.createDismissibleNotification(null, getResources().getString(R.string.featuresDisabled), notificationIdLocationRestriction, false, AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, pi);
}
}
@@ -482,7 +490,7 @@ public class AutomationService extends Service implements OnInitListener
return builder;
}
- protected static NotificationCompat.Builder createDefaultNotificationBuilder()
+ protected static NotificationCompat.Builder createServiceNotificationBuilder()
{
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
@@ -490,14 +498,14 @@ public class AutomationService extends Service implements OnInitListener
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
{
- NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_LOW);
-// chan.setLightColor(Color.BLUE);
- chan.enableVibration(false);
- chan.setSound(null, null);
- chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
- mNotificationManager.createNotificationChannel(chan);
+ NotificationChannel channel = Miscellaneous.getNotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE);
+// channel.setLightColor(Color.BLUE);
+ channel.enableVibration(false);
+ channel.setSound(null, null);
+ channel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
+ mNotificationManager.createNotificationChannel(channel);
- builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
+ builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID_SERVICE);
}
else
builder = new NotificationCompat.Builder(AutomationService.getInstance());
@@ -576,7 +584,7 @@ public class AutomationService extends Service implements OnInitListener
String textToDisplay = bodyText + " " + lastRuleString;
if(notificationBuilder == null)
- notificationBuilder = createDefaultNotificationBuilder();
+ notificationBuilder = createServiceNotificationBuilder();
notificationBuilder.setContentText(textToDisplay);
notificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
diff --git a/app/src/main/java/com/jens/automation2/Miscellaneous.java b/app/src/main/java/com/jens/automation2/Miscellaneous.java
index 25da177f..20737f2b 100644
--- a/app/src/main/java/com/jens/automation2/Miscellaneous.java
+++ b/app/src/main/java/com/jens/automation2/Miscellaneous.java
@@ -8,7 +8,6 @@ import android.app.NotificationChannel;
import android.app.NotificationManager;
import android.app.PendingIntent;
import android.app.Service;
-import android.content.ContentProvider;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
@@ -16,6 +15,8 @@ import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
import android.content.res.Configuration;
import android.database.Cursor;
+import android.media.AudioAttributes;
+import android.media.RingtoneManager;
import android.net.ConnectivityManager;
import android.net.NetworkInfo;
import android.net.Uri;
@@ -26,7 +27,6 @@ import android.os.IBinder;
import android.provider.MediaStore;
import android.provider.Settings.Secure;
import android.telephony.PhoneNumberUtils;
-import android.telephony.TelephonyManager;
import android.util.Base64;
import android.util.Log;
import android.widget.Toast;
@@ -83,6 +83,7 @@ import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
+import java.util.List;
import java.util.Scanner;
import java.util.zip.ZipEntry;
import java.util.zip.ZipInputStream;
@@ -98,13 +99,10 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
+import androidx.annotation.RequiresApi;
import androidx.core.app.NotificationCompat;
import androidx.documentfile.provider.DocumentFile;
-import static android.provider.CalendarContract.CalendarCache.URI;
-import static com.jens.automation2.AutomationService.NOTIFICATION_CHANNEL_ID;
-import static com.jens.automation2.AutomationService.channelName;
-
public class Miscellaneous extends Service
{
protected static String writeableFolderStringCache = null;
@@ -877,7 +875,7 @@ public class Miscellaneous extends Service
@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
- public static void createDismissableNotificationWithDelay(long delay, String textToDisplay, int notificationId, PendingIntent pendingIntent)
+ public static void createDismissibleNotificationWithDelay(long delay, String title, String textToDisplay, int notificationId, String notificationChannelId, PendingIntent pendingIntent)
{
/*
Now what's this about?
@@ -903,7 +901,7 @@ public class Miscellaneous extends Service
catch(Exception e)
{}
- createDismissableNotification(textToDisplay, notificationId, pendingIntent);
+ createDismissibleNotification(title, textToDisplay, notificationId, true, notificationChannelId, pendingIntent);
return null;
}
@@ -924,40 +922,82 @@ public class Miscellaneous extends Service
@SuppressLint("NewApi")
@SuppressWarnings("deprecation")
- public static void createDismissableNotification(String textToDisplay, int notificationId, PendingIntent pendingIntent)
+ public static void createDismissibleNotification(String title, String textToDisplay, int notificationId, boolean vibrate, String notificationChannelId, PendingIntent pendingIntent)
{
if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
{
- createDismissableNotificationSdk26(textToDisplay, notificationId, pendingIntent);
+ createDismissibleNotificationSdk26(title, textToDisplay, notificationId, vibrate, notificationChannelId, pendingIntent);
return;
}
NotificationManager mNotificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
- NotificationCompat.Builder dismissableNotificationBuilder = createDismissableNotificationBuilder(pendingIntent);
- dismissableNotificationBuilder.setContentText(textToDisplay);
- dismissableNotificationBuilder.setContentIntent(pendingIntent);
- dismissableNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
- dismissableNotificationBuilder.setAutoCancel(true);
+ NotificationCompat.Builder dismissibleNotificationBuilder = createDismissibleNotificationBuilder(vibrate, notificationChannelId, pendingIntent);
- Notification dismissableNotification = dismissableNotificationBuilder.build();
+ if(title == null)
+ dismissibleNotificationBuilder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
+ else
+ dismissibleNotificationBuilder.setContentTitle(title);
- mNotificationManager.notify(notificationId, dismissableNotification);
+ dismissibleNotificationBuilder.setContentText(textToDisplay);
+ dismissibleNotificationBuilder.setContentIntent(pendingIntent);
+ dismissibleNotificationBuilder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
+ dismissibleNotificationBuilder.setAutoCancel(true);
- /*NotificationCompat.Builder mBuilder = new NotificationCompat.Builder(this)
- .setSmallIcon(R.drawable.ic_launcher) // notification icon
- .setContentTitle("Notification!") // title for notification
- .setContentText("Hello word") // message for notification
- .setAutoCancel(true); // clear notification after click
- Intent intent = new Intent(this, MainActivity.class);
- PendingIntent pi = PendingIntent.getActivity(this,0,intent,Intent.FLAG_ACTIVITY_NEW_TASK);
- mBuilder.setContentIntent(pi);
- NotificationManager mNotificationManager =
- (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
- mNotificationManager.notify(0, dismissableNotification);*/
+ if(notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_RULES))
+ dismissibleNotificationBuilder.setSmallIcon(R.drawable.info);
+
+ Notification dismissibleNotification = dismissibleNotificationBuilder.build();
+
+ mNotificationManager.notify(notificationId, dismissibleNotification);
}
- static void createDismissableNotificationSdk26(String textToDisplay, int notificationId, PendingIntent pendingIntent)
+ @RequiresApi(api = Build.VERSION_CODES.O)
+ static NotificationChannel findExistingChannel(List channels, String channelId)
+ {
+ for(NotificationChannel c : channels)
+ {
+ if(c.getId().equals(channelId))
+ return c;
+ }
+
+ return null;
+ }
+ @RequiresApi(api = Build.VERSION_CODES.O)
+ static NotificationChannel getNotificationChannel(String channelId)
+ {
+ NotificationManager nm = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
+ List channels = nm.getNotificationChannels();
+ if(channels.size() > 3)
+ {
+ for(NotificationChannel c : channels)
+ nm.deleteNotificationChannel(c.getId());
+ }
+
+ NotificationChannel channel = findExistingChannel(channels, channelId);
+
+ if(channel == null)
+ {
+ switch (channelId)
+ {
+ case AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE:
+ channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE, AutomationService.NOTIFICATION_CHANNEL_NAME_SERVICE, NotificationManager.IMPORTANCE_LOW);
+ break;
+ case AutomationService.NOTIFICATION_CHANNEL_ID_FUNCTIONALITY:
+ channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_FUNCTIONALITY, AutomationService.NOTIFICATION_CHANNEL_NAME_FUNCTIONALITY, NotificationManager.IMPORTANCE_HIGH);
+ break;
+ case AutomationService.NOTIFICATION_CHANNEL_ID_RULES:
+ channel = new NotificationChannel(AutomationService.NOTIFICATION_CHANNEL_ID_RULES, AutomationService.NOTIFICATION_CHANNEL_NAME_RULES, NotificationManager.IMPORTANCE_HIGH);
+ break;
+ default:
+ break;
+ }
+ }
+
+ return channel;
+ }
+
+ static void createDismissibleNotificationSdk26(String title, String textToDisplay, int notificationId, boolean vibrate, String notificationChannelId, PendingIntent pendingIntent)
{
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
@@ -965,29 +1005,44 @@ public class Miscellaneous extends Service
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
{
- NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, "Functionality warnings", NotificationManager.IMPORTANCE_HIGH);
-// chan.setLightColor(Color.BLUE);
- chan.enableVibration(false);
-// chan.setSound(null, null);
- chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
- mNotificationManager.createNotificationChannel(chan);
+ NotificationChannel notificationChannel = getNotificationChannel(notificationChannelId);
+// notificationChannel.setLightColor(Color.BLUE);
+ notificationChannel.enableVibration(vibrate);
+ try
+ {
+ Uri notificationSound = RingtoneManager.getDefaultUri(RingtoneManager.TYPE_NOTIFICATION);
+// Uri notificationSound = Uri.parse(ContentResolver.SCHEME_ANDROID_RESOURCE+ "://" +mContext.getPackageName()+"/"+R.raw.apple_ring));
+// Ringtone r = RingtoneManager.getRingtone(Miscellaneous.getAnyContext(), notification);
+ AudioAttributes.Builder b = new AudioAttributes.Builder();
+ b.setContentType(AudioAttributes.CONTENT_TYPE_UNKNOWN);
+ notificationChannel.setSound(notificationSound, b.build());
+ }
+ catch (Exception e)
+ {
+ Miscellaneous.logEvent("i", "Notification", Log.getStackTraceString(e), 2);
+ }
+ notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
+ mNotificationManager.createNotificationChannel(notificationChannel);
- builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
+ builder = new NotificationCompat.Builder(AutomationService.getInstance(), notificationChannel.getId());
}
else
builder = new NotificationCompat.Builder(AutomationService.getInstance());
-// if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP)
-// builder.setCategory(Notification.CATEGORY_SERVICE);
-
builder.setWhen(System.currentTimeMillis());
builder.setContentIntent(pendingIntent);
- builder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
+ if(title == null)
+ builder.setContentTitle(AutomationService.getInstance().getResources().getString(R.string.app_name));
+ else
+ builder.setContentTitle(title);
+
builder.setOnlyAlertOnce(true);
- if(Settings.showIconWhenServiceIsRunning)
+ if(Settings.showIconWhenServiceIsRunning && notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE))
builder.setSmallIcon(R.drawable.ic_launcher);
+ else if(!notificationChannelId.equals(AutomationService.NOTIFICATION_CHANNEL_ID_SERVICE))
+ builder.setSmallIcon(R.drawable.info);
builder.setContentText(textToDisplay);
builder.setStyle(new NotificationCompat.BigTextStyle().bigText(textToDisplay));
@@ -995,7 +1050,6 @@ public class Miscellaneous extends Service
NotificationManager notificationManager = (NotificationManager) Miscellaneous.getAnyContext().getSystemService(Context.NOTIFICATION_SERVICE);
notificationManager.notify(1, builder.build());
-
// Intent notifyIntent = new Intent(context, notification.class);
// notifyIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP);
//
@@ -1017,7 +1071,7 @@ public class Miscellaneous extends Service
// notificationManager.notify(1, notification);
}
- protected static NotificationCompat.Builder createDismissableNotificationBuilder(PendingIntent myPendingIntent)
+ protected static NotificationCompat.Builder createDismissibleNotificationBuilder(boolean vibrate, String notificationChannelId, PendingIntent myPendingIntent)
{
NotificationManager mNotificationManager = (NotificationManager) AutomationService.getInstance().getSystemService(Context.NOTIFICATION_SERVICE);
@@ -1025,14 +1079,14 @@ public class Miscellaneous extends Service
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)
{
- NotificationChannel chan = new NotificationChannel(NOTIFICATION_CHANNEL_ID, channelName, NotificationManager.IMPORTANCE_HIGH);
-// chan.setLightColor(Color.BLUE);
-// chan.enableVibration(false);
-// chan.setSound(null, null);
- chan.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
- mNotificationManager.createNotificationChannel(chan);
+ NotificationChannel notificationChannel = getNotificationChannel(notificationChannelId);
+// notificationChannel.setLightColor(Color.BLUE);
+ notificationChannel.enableVibration(vibrate);
+// notificationChannel.setSound(null, null);
+ notificationChannel.setLockscreenVisibility(Notification.VISIBILITY_PRIVATE);
+ mNotificationManager.createNotificationChannel(notificationChannel);
- builder = new NotificationCompat.Builder(AutomationService.getInstance(), NOTIFICATION_CHANNEL_ID);
+ builder = new NotificationCompat.Builder(AutomationService.getInstance(), notificationChannelId);
}
else
builder = new NotificationCompat.Builder(AutomationService.getInstance());
diff --git a/app/src/main/res/drawable/info.xml b/app/src/main/res/drawable/info.xml
new file mode 100644
index 00000000..17255b7a
--- /dev/null
+++ b/app/src/main/res/drawable/info.xml
@@ -0,0 +1,10 @@
+
+
+
diff --git a/app/src/main/res/layout/activity_manage_action_create_notification.xml b/app/src/main/res/layout/activity_manage_action_create_notification.xml
new file mode 100644
index 00000000..2a34c955
--- /dev/null
+++ b/app/src/main/res/layout/activity_manage_action_create_notification.xml
@@ -0,0 +1,90 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml
index b30eef92..26d2052b 100644
--- a/app/src/main/res/values-de/strings.xml
+++ b/app/src/main/res/values-de/strings.xml
@@ -57,7 +57,7 @@
EndeSpeichernURL, die ausgelöst werden soll:
- Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds\n[notificationTitle] - Titel der letzten Benachrichtigung\n[notificationText] - Text der letzten Benachrichtigung
+ Variablen:\nSie können die folgenden Variablen verwenden. Vor dem Auslösen werden sie mit dem entsprechenden Wert Ihres Geräts ersetzt. Die Klammern müssen in den Text mit aufgenommen werden.\n\n[uniqueid] - Die Unique ID Ihres Geräts\n[serialnr] - Die Seriennummer Ihres Geräts (< Android 9)\n[latitude] - Ihr gegenwärtiger Breitengrad\n[longitude] - Ihr gegenwärtiger Längengrad\n[phonenr] - Nummer des letzten ein- oder ausgehenden Anrufs\n[d] - Tag des Monats, 2-stellig mit führender Null\n[m] - Monat als Zahl, mit führenden Nullen\n[Y] - Vierstellige Jahreszahl\n[h] - Stunde im 12-Stunden-Format, mit führenden Nullen\n[H] - Stunde im 24-Stunden-Format, mit führenden Nullen\n[i] - Minuten, mit führenden Nullen\n[s] - Sekunden, mit führenden Nullen\n[ms] - milliseconds\n[notificationTitle] - Titel der letzten Benachrichtigung\n[notificationText] - Text der letzten BenachrichtigungWLANAktiviereDeaktiviere
diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml
index b3ff3035..3121be29 100644
--- a/app/src/main/res/values-es/strings.xml
+++ b/app/src/main/res/values-es/strings.xml
@@ -358,7 +358,7 @@
Red exactitud [m]Tiempo mínimo para cambio en milisegundos para actualizar posiciónTiempo para actualizar [milisegundos]
- Variables: Puede usar esas variables. Mientras ejecuta van a sustituir con los valores correspondientes en su dispositivo. Incluya las paréntecis en su texto. [uniqueid] - el número único de su dispositivo [serialnr] - el número de serie de su dispositivo [latitude] - su latitud [longitude] - su longitud [phonenr] - Ùltimo número de llamada realizada tanto de salida como entrante [d] - Dia del mes, 2 digitos con cero al comienzo [m] - número del mes, 2 digitos con cero al comienzo [Y] - Número del año, 4 digitos [h] - Hora, formato 12 horas con cero al comienzo [H] - Hora, formato 24 horas con cero al comienzo [i] - Minutos con cero al comienzo [s] - Segundos con cero al comienzo [ms] - milisegundos [notificationTitle] - Título de la última notificación [notificationText] - Texto de la última notificación
+ Variables: Puede usar esas variables. Mientras ejecuta van a sustituir con los valores correspondientes en su dispositivo. Incluya las paréntecis en su texto.\n\n[uniqueid] - el número único de su dispositivo\n[serialnr] - el número de serie de su dispositivo (< Android 9)\n[latitude] - su latitud\n[longitude] - su longitud\n[phonenr] - Ùltimo número de llamada realizada tanto de salida como entrante\n[d] - Dia del mes, 2 digitos con cero al comienzo\n[m] - número del mes, 2 digitos con cero al comienzo\n[Y] - Número del año, 4 digitos\n[h] - Hora, formato 12 horas con cero al comienzo\n[H] - Hora, formato 24 horas con cero al comienzo\n[i] - Minutos con cero al comienzo\n[s] - Segundos con cero al comienzo\n[ms] - milisegundos\n[notificationTitle] - Título de la última notificación\n[notificationText] - Texto de la última notificaciónRotación del monitor todavia esta activado.Rotación del monitor todavia esta desactivado.Se puede usar la lista de wifis conocidos para determinar los sitios en los cuales estuvo. Por eso el permiso de localización es necesario para cargar la lista de wifis. Si quiere elegir uno de la lista tiene que conceder el permiso. En caso contrario todavia puede introducir un nombre wifi manualmente.
diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml
index 5e6f5aaf..d05e1feb 100644
--- a/app/src/main/res/values-it/strings.xml
+++ b/app/src/main/res/values-it/strings.xml
@@ -533,7 +533,7 @@
MartedìErrore indeterminato.finchè
- Variabili:\n È possibile utilizzare le seguenti variabili. All\'attivazione saranno sostituite con il valore corrispondente sul dispositivo. Includi le parentesi nel tuo testo.\n\n[uniqueid] - Il numero di serie del tuo dispositivo\n[serialnr] - Il serial number del tuo dispositivio\n[latitude] - La latitudine del tuo dispositivo\n[longitude] - La longitudine del tuo dispositivo\n[phonenr] - Numero dell\'ultima chiamata (entrante o uscente)\n[d] - Il giorno del mese, sempre 2 cifre\n[m] - Mese in formato numerico, sempre 2 cifre\n[Y] - L\’anno, sempre 4 cifre\n[h] - Ore in formato 12 ore, sempre 2 cifre con due punti\n[H] - Ore in formato 24 ore, sempre 2 cifre con due punti\n[i] - Minuti, sempre 2 cifre\n[s] - Secondi, sempre 2 cifre\n[ms] - millisecondi, sempre 3 cifre [notificationTitle] - titolo dell\'ultima notifica [notificationText] - testo dell\'ultima notifica
+ Variabili:\n È possibile utilizzare le seguenti variabili. All\'attivazione saranno sostituite con il valore corrispondente sul dispositivo. Includi le parentesi nel tuo testo.\n\n[uniqueid] - Il numero di serie del tuo dispositivo\n[serialnr] - Il serial number del tuo dispositivio (< Android 9)\n[latitude] - La latitudine del tuo dispositivo\n[longitude] - La longitudine del tuo dispositivo\n[phonenr] - Numero dell\'ultima chiamata (entrante o uscente)\n[d] - Il giorno del mese, sempre 2 cifre\n[m] - Mese in formato numerico, sempre 2 cifre\n[Y] - L\’anno, sempre 4 cifre\n[h] - Ore in formato 12 ore, sempre 2 cifre con due punti\n[H] - Ore in formato 24 ore, sempre 2 cifre con due punti\n[i] - Minuti, sempre 2 cifre\n[s] - Secondi, sempre 2 cifre\n[ms] - millisecondi, sempre 3 cifre [notificationTitle] - titolo dell\'ultima notifica [notificationText] - testo dell\'ultima notificaURL da caricare:L\'url deve avere almeno 10 caratteri.Questo molto probabilmente non funzionerà dato che sei su una versione superiore ad Android 2.3. Tuttavia è possibile utilizzare la connessione wifi tethering per attivare la regola.
diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml
index 69915d0f..f92ba0b7 100644
--- a/app/src/main/res/values-nl/strings.xml
+++ b/app/src/main/res/values-nl/strings.xml
@@ -56,7 +56,7 @@
EindeOpslaanURL om te activeren:
- Variabelen:U kunt de volgende variabelen gebruiken. Bij het triggeren zullen ze worden vervangen door de corresponderende waarde op je apparaat. Zet de haakjes in uw tekst. \n[uniqueid] - Het unieke id van uw apparaat[serienummer] - Het serienummer van uw apparaat[latitude] - De breedtegraad van uw apparaat[longitude] - De lengtegraad van uw apparaat[phonenr] - Nummer van het laatste inkomende of uitgaande gesprek[d] - Dag van de maand, 2 cijfers met voorloopnullen[m] - Numerieke weergave van een maand, met voorloopnullen[Y] - een volledige numerieke weergave van een jaar, 4 cijfers[h] - 12-uurs indeling van een uur, met voorloopnullen[H] - 24-uurs indeling van een uur, met voorloopnullen[i] - minuten, met voorloopnullen[s] - seconden, met voorloopnullen[ms] - milliseconden[notificationTitle] - titel van de laatste melding[notificationText] - tekst van de laatste melding
+ Variabelen:U kunt de volgende variabelen gebruiken. Bij het triggeren zullen ze worden vervangen door de corresponderende waarde op je apparaat. Zet de haakjes in uw tekst. \n[uniqueid] - Het unieke id van uw apparaat[serialnr] - Het serienummer van uw apparaat (< Android 9)[latitude] - De breedtegraad van uw apparaat[longitude] - De lengtegraad van uw apparaat[phonenr] - Nummer van het laatste inkomende of uitgaande gesprek[d] - Dag van de maand, 2 cijfers met voorloopnullen[m] - Numerieke weergave van een maand, met voorloopnullen[Y] - een volledige numerieke weergave van een jaar, 4 cijfers[h] - 12-uurs indeling van een uur, met voorloopnullen[H] - 24-uurs indeling van een uur, met voorloopnullen[i] - minuten, met voorloopnullen[s] - seconden, met voorloopnullen[ms] - milliseconden[notificationTitle] - titel van de laatste melding[notificationText] - tekst van de laatste meldingwifiActiverenDeactiveren
diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml
index d10467cc..8116fc22 100644
--- a/app/src/main/res/values/strings.xml
+++ b/app/src/main/res/values/strings.xml
@@ -70,7 +70,7 @@
EndSaveURL to trigger:
- Variables:\nYou can use the following variables. Upon triggering they will be replaced with the corresponding value on your device. Include the brackets in your text.\n\n[uniqueid] - Your device\'s unique id\n[serialnr] - Your device\'s serial number\n[latitude] - Your device\'s latitude\n[longitude] - Your device\'s longitude\n[phonenr] - Number of last incoming or outgoing call\n[d] - Day of the month, 2 digits with leading zeros\n[m] - Numeric representation of a month, with leading zeros\n[Y] - A full numeric representation of a year, 4 digits\n[h] - 12-hour format of an hour with leading zeros\n[H] - 24-hour format of an hour with leading zeros\n[i] - Minutes with leading zeros\n[s] - Seconds, with leading zeros\n[ms] - milliseconds\n[notificationTitle] - title of last notification\n[notificationText] - text of last notification
+ Variables:\nYou can use the following variables. Upon triggering they will be replaced with the corresponding value on your device. Include the brackets in your text.\n\n[uniqueid] - Your device\'s unique id\n[serialnr] - Your device\'s serial number (< Android 9)\n[latitude] - Your device\'s latitude\n[longitude] - Your device\'s longitude\n[phonenr] - Number of last incoming or outgoing call\n[d] - Day of the month, 2 digits with leading zeros\n[m] - Numeric representation of a month, with leading zeros\n[Y] - A full numeric representation of a year, 4 digits\n[h] - 12-hour format of an hour with leading zeros\n[H] - 24-hour format of an hour with leading zeros\n[i] - Minutes with leading zeros\n[s] - Seconds, with leading zeros\n[ms] - milliseconds\n[notificationTitle] - title of last notification\n[notificationText] - text of last notificationwifiActivatingDeactivating
@@ -755,4 +755,9 @@
Choose manuallyEasy mode: Automation can try to identify the launcher activity of the desired program automatically. Alternatively you can also pick one of the application\'s activities manually. What would you like?A launcher activity of this app could not be identified. You will have to pick one manually.
+ Create notification
+ Enter a title.
+ Enter a text.
+ Icon
+ Sound
\ No newline at end of file
diff --git a/fastlane/metadata/android/de-DE/full_description.txt b/fastlane/metadata/android/de-DE/full_description.txt
index 9aceaca4..45939122 100644
--- a/fastlane/metadata/android/de-DE/full_description.txt
+++ b/fastlane/metadata/android/de-DE/full_description.txt
@@ -20,6 +20,7 @@ Mögliche Auslöser:
* Telefongespräch im Gange
* Benachrichtigungen anderer Anwendungen
* Geräteausrichtung (Gyroskop)
+* Profile aktiv oder nicht
Mögliche Aktionen:
* WLAN ein-/ausschalten
@@ -40,6 +41,7 @@ Mögliche Aktionen:
* Bildschirmhelligkeit ändern
* SMS verschicken
* Sounddatei abspielen.
+* Benachrichtigungen erstellen
Es ist ziemlich schwierig diese Anwendung über die vielen verschiedenen Geräte und Android Versionen am Laufen zu halten. Ich kann vieles im Emulator testen, aber eben nicht alles.
Wenn also eine bestimmte Funktion nicht so tut wie sie sollte - lassen Sie es mich wissen. Über die Jahre habe ich noch alle Fehler behoben, die mir vernünftig gemeldet wurden. Aber dafür bin ich auf Ihre Mithilfe angewiesen.
diff --git a/fastlane/metadata/android/en-US/full_description.txt b/fastlane/metadata/android/en-US/full_description.txt
index 6d6845a0..77cb6e69 100644
--- a/fastlane/metadata/android/en-US/full_description.txt
+++ b/fastlane/metadata/android/en-US/full_description.txt
@@ -20,6 +20,7 @@ Supported triggers:
* Phone call running
* Notifications of other apps
* Device orientation (gyroscope)
+* Profile active or not
Supported actions:
* Change wifi state
@@ -40,6 +41,7 @@ Supported actions:
* Change screen brightness
* Send text message
* Play sound file
+* Create notifications
It's quite hard to keep this app working across the many different hardwares as well as the many changes Android undergoes over the versions. I can test it in the emulator, but that cannot show all bugs.
So if a certain feature is not working on your device - let me know. Over the years I have fixed almost all bugs that have been reasonably reported to me. But for that I'm dependend on your input.
diff --git a/fastlane/metadata/android/es-ES/full_description.txt b/fastlane/metadata/android/es-ES/full_description.txt
index 9e0c49dc..f9a3acf8 100644
--- a/fastlane/metadata/android/es-ES/full_description.txt
+++ b/fastlane/metadata/android/es-ES/full_description.txt
@@ -20,6 +20,7 @@ Disparadores:
* Llamado de teléfono activo
* Notificaciónes de otras apps
* Orientación del dispositivo (giroscopio)
+* Perfil activado o no
Aciónes:
* Pasar de wifi
@@ -40,6 +41,7 @@ Aciónes:
* Cambiar luminosidad del monitor
* Enviar mensaje
* Tocar archivo sonido
+* Crear notificaciones
Es muy dificil mantener esta applicación functionando en todos los hardwares y versiónes de Android. Puedo probrar mucho en el emulator, pero no puedo enviar todos los errores.
Si una función no funcióna - digame. En muchos años resolvaba la mayoria de los errores que los halladores me informaron bien. Pero dependo en su ayuda.
diff --git a/fastlane/metadata/android/it-IT/full_description.txt b/fastlane/metadata/android/it-IT/full_description.txt
index 582a126b..3c22ac56 100644
--- a/fastlane/metadata/android/it-IT/full_description.txt
+++ b/fastlane/metadata/android/it-IT/full_description.txt
@@ -20,6 +20,7 @@ Eventi supportati:
* Chiamata in esecuzione
* Notificazione di un altra applicazione
* Orientamento del dispositivo (giroscopio)
+* Profilo attivo o meno
Azioni supportate:
* Cambia lo stato del wifi
@@ -40,6 +41,7 @@ Azioni supportate:
* Cambia la luminosità dello schermo
* Manda un messaggio di testo
* Esegui un file musicale
+* Creare notifiche
È piuttosto difficile mantere questa applicazione funzionante su tutti gli hardware esistenti ed includendo tutti i cambi che Android riceve fra una versione e l'altra. Posso effettuare tests nell'emulatore, ma non sarà possibile trovare tutti gli errori.
Pertanto, se una certa funzione non funziona sul tuo dispositivo - fammelo sapere. Nel corso degli anni ho potuto risolvere tutti gli errori che sono stati riportati in maniera ragionevole. Infatti, per questo, dipendo dalle informazioni condivise.
diff --git a/fastlane/metadata/android/nl-NL/full_description.txt b/fastlane/metadata/android/nl-NL/full_description.txt
index 5fd26cb3..d27980c7 100644
--- a/fastlane/metadata/android/nl-NL/full_description.txt
+++ b/fastlane/metadata/android/nl-NL/full_description.txt
@@ -22,6 +22,7 @@ Ondersteunde triggers:
* Lopend telefoongesprek
* Meldingen van andere apps
* Apparaat oriëntatie (gyroscoop)
+* Profiel actief of niet
Ondersteunde acties:
* Wijzig wifi status
@@ -42,6 +43,7 @@ Ondersteunde acties:
* Verander de helderheid van het scherm
* Verstuur tekstbericht
* Geluidsbestand afspelen
+* Meldingen maken
Het is lastig om deze App werkend te houden over de vele verschillende hardware en de vele veranderingen die Android ondergaat in de loop der versies.
Ik test het in een emulator, maar dat kan niet alle bugs laten zien.