From dcd264adb4f58a231c6693dd385375a89496f5b2 Mon Sep 17 00:00:00 2001 From: Marown Date: Sun, 18 Dec 2022 14:48:17 +0100 Subject: [PATCH] Add support for background notification download when power save mode is enabled (#411) ## What changes were proposed in this pull request? * Add support for background notification download when power save mode is enabled (Fixes #408) * Remove social links ## How was this patch tested? Manually. Co-authored-by: Amab Reviewed-on: https://git.cuernodehipnos.es/Marown/SWADroid/pulls/411 --- SWADroid/src/main/AndroidManifest.xml | 26 ++- .../java/es/ugr/swad/swadroid/Constants.java | 4 + .../java/es/ugr/swad/swadroid/SWADMain.java | 29 ++- .../gui/AlertNotificationFactory.java | 196 ++++++++++-------- .../modules/notifications/Notifications.java | 160 ++++---------- .../NotificationsSyncAdapterService.java | 65 ++++-- .../RestarterNotificationsReceiver.java | 48 +++++ .../swadroid/preferences/Preferences.java | 19 -- .../preferences/PreferencesActivity.java | 72 ------- SWADroid/src/main/res/raw-es/changes.html | 163 ++++++++------- SWADroid/src/main/res/raw/changes.html | 163 ++++++++------- SWADroid/src/main/res/values-es/strings.xml | 1 + SWADroid/src/main/res/values/strings.xml | 1 + SWADroid/src/main/res/xml/preferences.xml | 20 -- 14 files changed, 476 insertions(+), 491 deletions(-) create mode 100644 SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/RestarterNotificationsReceiver.java diff --git a/SWADroid/src/main/AndroidManifest.xml b/SWADroid/src/main/AndroidManifest.xml index f06cc045..2645e97c 100644 --- a/SWADroid/src/main/AndroidManifest.xml +++ b/SWADroid/src/main/AndroidManifest.xml @@ -14,9 +14,12 @@ - + + + + @@ -366,6 +368,26 @@ android:resource="@xml/sync_notifications" /> + + + + + + + + + + + + + + + + + = android.os.Build.VERSION_CODES.O) { + AlertNotificationFactory.createNotificationChanel(this); + } + //Check if this is the first run after an install or upgrade lastVersion = Preferences.getLastVersion(); currentVersion = getPackageManager().getPackageInfo(getPackageName(), 0).versionCode; @@ -191,6 +204,20 @@ public class SWADMain extends MenuExpandableListActivity { } } + @RequiresApi(Build.VERSION_CODES.TIRAMISU) + @Override + protected void onStart() { + super.onStart(); + + // Check Android 13 permission + if (ContextCompat.checkSelfPermission(this, Manifest.permission.POST_NOTIFICATIONS) + != PackageManager.PERMISSION_GRANTED) { + ActivityCompat.requestPermissions(this, + new String[]{Manifest.permission.POST_NOTIFICATIONS}, + Constants.PERMISSIONS_REQUEST_POST_NOTIFICATIONS); + } + } + /* * (non-Javadoc) * @see android.app.Activity#onResume() diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/gui/AlertNotificationFactory.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/gui/AlertNotificationFactory.java index 73d524de..ecaa9bd1 100644 --- a/SWADroid/src/main/java/es/ugr/swad/swadroid/gui/AlertNotificationFactory.java +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/gui/AlertNotificationFactory.java @@ -19,118 +19,150 @@ package es.ugr.swad.swadroid.gui; +import static es.ugr.swad.swadroid.utils.NotificationUtils.SWADROID_CHANNEL_ID; + import android.app.Notification; +import android.app.NotificationChannel; import android.app.NotificationManager; import android.app.PendingIntent; import android.content.Context; +import android.content.Intent; import android.graphics.BitmapFactory; +import android.graphics.Color; +import android.os.Build; + +import androidx.annotation.RequiresApi; import androidx.core.app.NotificationCompat; +import es.ugr.swad.swadroid.modules.notifications.Notifications; import es.ugr.swad.swadroid.utils.NotificationUtils; -import static es.ugr.swad.swadroid.utils.NotificationUtils.SWADROID_CHANNEL_ID; - /** * Class for create notification alerts. * * @author Juan Miguel Boyero Corral */ public class AlertNotificationFactory { - public static NotificationCompat.Builder createAlertNotificationBuilder(Context context, String contentTitle, String contentText, - String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, - boolean autocancel, boolean ongoing, boolean onlyAlertOnce) { - - int flags = 0; + public static final String CHANNEL_NAME = "Background Service"; + public static NotificationCompat.Builder createAlertNotificationBuilder(Context context, String contentTitle, String contentText, + String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, + boolean autocancel, boolean ongoing, boolean onlyAlertOnce) { - NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context, SWADROID_CHANNEL_ID) - .setAutoCancel(autocancel) - .setSmallIcon(smallIcon) - .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), largeIcon)) - .setContentTitle(contentTitle) - .setContentText(contentText) - .setTicker(ticker) - .setOngoing(ongoing) - .setOnlyAlertOnce(onlyAlertOnce) - .setWhen(System.currentTimeMillis()); - //.setLights(Color.GREEN, 500, 500); + int flags = 0; + + NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context, SWADROID_CHANNEL_ID) + .setAutoCancel(autocancel) + .setSmallIcon(smallIcon) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), largeIcon)) + .setContentTitle(contentTitle) + .setContentText(contentText) + .setTicker(ticker) + .setOngoing(ongoing) + .setOnlyAlertOnce(onlyAlertOnce) + .setWhen(System.currentTimeMillis()); + //.setLights(Color.GREEN, 500, 500); //Launch activity on alert click - if(pendingIntent != null) { + if (pendingIntent != null) { notifBuilder.setContentIntent(pendingIntent); - } - + } + //Add sound, vibration and lights flags |= Notification.DEFAULT_SOUND; flags |= Notification.DEFAULT_VIBRATE; flags |= Notification.DEFAULT_LIGHTS; - - notifBuilder.setDefaults(flags); - - return notifBuilder; - } - - public static NotificationCompat.Builder createProgressNotificationBuilder(Context context, String contentTitle, String contentText, - String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, - boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) { - - NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context, - contentTitle, - contentText, - ticker, - pendingIntent, - smallIcon, - largeIcon, - autocancel, - ongoing, - onlyAlertOnce); - - notifBuilder.setProgress(maxProgress, progress, indeterminate); - - return notifBuilder; - } - - public static Notification createAlertNotification(Context context, String contentTitle, String contentText, - String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, - boolean autocancel, boolean ongoing, boolean onlyAlertOnce) { - NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context, - contentTitle, - contentText, - ticker, - pendingIntent, - smallIcon, - largeIcon, - autocancel, - ongoing, - onlyAlertOnce); - + notifBuilder.setDefaults(flags); + + return notifBuilder; + } + + public static NotificationCompat.Builder createProgressNotificationBuilder(Context context, String contentTitle, String contentText, + String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, + boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) { + + NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context, + contentTitle, + contentText, + ticker, + pendingIntent, + smallIcon, + largeIcon, + autocancel, + ongoing, + onlyAlertOnce); + + notifBuilder.setProgress(maxProgress, progress, indeterminate); + + return notifBuilder; + } + + public static Notification createAlertNotification(Context context, String contentTitle, String contentText, + String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, + boolean autocancel, boolean ongoing, boolean onlyAlertOnce) { + + NotificationCompat.Builder notifBuilder = createAlertNotificationBuilder(context, + contentTitle, + contentText, + ticker, + pendingIntent, + smallIcon, + largeIcon, + autocancel, + ongoing, + onlyAlertOnce); + //Create alert return notifBuilder.build(); } - - public static Notification createProgressNotification(Context context, String contentTitle, String contentText, - String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, - boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) { - NotificationCompat.Builder notifBuilder = createProgressNotificationBuilder(context, - contentTitle, - contentText, - ticker, - pendingIntent, - smallIcon, - largeIcon, - autocancel, - ongoing, - onlyAlertOnce, - maxProgress, - progress, - indeterminate); - + public static Notification createProgressNotification(Context context, String contentTitle, String contentText, + String ticker, PendingIntent pendingIntent, int smallIcon, int largeIcon, + boolean autocancel, boolean ongoing, boolean onlyAlertOnce, int maxProgress, int progress, boolean indeterminate) { + + NotificationCompat.Builder notifBuilder = createProgressNotificationBuilder(context, + contentTitle, + contentText, + ticker, + pendingIntent, + smallIcon, + largeIcon, + autocancel, + ongoing, + onlyAlertOnce, + maxProgress, + progress, + indeterminate); + //Create alert return notifBuilder.build(); } - - public static void showAlertNotification(Context context, Notification notif, int notifId) { + + public static Notification createBackgroundNotification(Context context, String contentTitle, int smallIcon, int largeIcon, PendingIntent pendingIntent) { + NotificationCompat.Builder notifBuilder = new NotificationCompat.Builder(context, SWADROID_CHANNEL_ID) + .setOngoing(true) + .setSmallIcon(smallIcon) + .setLargeIcon(BitmapFactory.decodeResource(context.getResources(), largeIcon)) + .setContentTitle(contentTitle) + .setPriority(NotificationManager.IMPORTANCE_HIGH) + .setCategory(Notification.CATEGORY_SERVICE) + .setContentIntent(pendingIntent); + + //Create alert + return notifBuilder.build(); + } + + @RequiresApi(Build.VERSION_CODES.O) + public static void createNotificationChanel(Context context) { + NotificationChannel channel = new NotificationChannel(SWADROID_CHANNEL_ID, CHANNEL_NAME, NotificationManager.IMPORTANCE_DEFAULT); + NotificationManager manager = (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); + + assert manager != null; + channel.setLightColor(Color.BLUE); + manager.createNotificationChannel(channel); + } + + public static void showAlertNotification(Context context, Notification notif, int notifId) { NotificationManager notifManager; //Obtain a reference to the notification service @@ -144,5 +176,5 @@ public class AlertNotificationFactory { //Send alert notifManager.notify(notifId, notif); - } + } } diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/Notifications.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/Notifications.java index c1f5700e..b46e4062 100644 --- a/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/Notifications.java +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/Notifications.java @@ -19,7 +19,6 @@ package es.ugr.swad.swadroid.modules.notifications; import android.accounts.Account; -import android.annotation.TargetApi; import android.app.Activity; import android.app.Notification; import android.app.PendingIntent; @@ -28,9 +27,7 @@ import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.content.IntentFilter; -import android.os.Build; import android.os.Bundle; -import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; import android.util.Log; import android.view.Menu; import android.view.MenuItem; @@ -42,6 +39,8 @@ import android.widget.LinearLayout; import android.widget.TextView; import android.widget.Toast; +import androidx.swiperefreshlayout.widget.SwipeRefreshLayout; + import org.ksoap2.serialization.SoapObject; import java.util.ArrayList; @@ -142,48 +141,44 @@ public class Notifications extends Module implements /** * Id for the not seen notifications group */ - private int NOT_SEEN_GROUP_ID = 0; + private final int NOT_SEEN_GROUP_ID = 0; /** * Id for the seen notifications group */ - private int SEEN_GROUP_ID = 1; + private final int SEEN_GROUP_ID = 1; /** * ListView click listener */ - private OnChildClickListener clickListener = new OnChildClickListener() { - @Override - public boolean onChildClick(ExpandableListView parent, View v, - int groupPosition, int childPosition, long id) { - - TextView notifCode = (TextView) v.findViewById(R.id.notifCode); - TextView code = (TextView) v.findViewById(R.id.eventCode); - TextView type = (TextView) v.findViewById(R.id.eventType); - TextView userPhoto = (TextView) v.findViewById(R.id.eventUserPhoto); - TextView sender = (TextView) v.findViewById(R.id.eventSender); - TextView course = (TextView) v.findViewById(R.id.eventLocation); - TextView summary = (TextView) v.findViewById(R.id.eventSummary); - TextView content = (TextView) v.findViewById(R.id.eventText); - TextView date = (TextView) v.findViewById(R.id.eventDate); - TextView time = (TextView) v.findViewById(R.id.eventTime); - TextView seenLocalText = (TextView) v.findViewById(R.id.seenLocal); + private final OnChildClickListener clickListener = (parent, v, groupPosition, childPosition, id) -> { + + TextView notifCode = v.findViewById(R.id.notifCode); + TextView code = v.findViewById(R.id.eventCode); + TextView type = v.findViewById(R.id.eventType); + TextView userPhoto = v.findViewById(R.id.eventUserPhoto); + TextView sender = v.findViewById(R.id.eventSender); + TextView course = v.findViewById(R.id.eventLocation); + TextView summary = v.findViewById(R.id.eventSummary); + TextView content = v.findViewById(R.id.eventText); + TextView date = v.findViewById(R.id.eventDate); + TextView time = v.findViewById(R.id.eventTime); + TextView seenLocalText = v.findViewById(R.id.seenLocal); - Intent activity = new Intent(getApplicationContext(), - NotificationItem.class); - activity.putExtra("notifCode", notifCode.getText().toString()); - activity.putExtra("eventCode", code.getText().toString()); - activity.putExtra("notificationType", type.getText().toString()); - activity.putExtra("userPhoto", userPhoto.getText().toString()); - activity.putExtra("sender", sender.getText().toString()); - activity.putExtra("course", course.getText().toString()); - activity.putExtra("summary", summary.getText().toString()); - activity.putExtra("content", content.getText().toString()); - activity.putExtra("date", date.getText().toString()); - activity.putExtra("time", time.getText().toString()); - activity.putExtra("seenLocal", seenLocalText.getText().toString()); - startActivity(activity); - - return true; - } + Intent activity = new Intent(getApplicationContext(), + NotificationItem.class); + activity.putExtra("notifCode", notifCode.getText().toString()); + activity.putExtra("eventCode", code.getText().toString()); + activity.putExtra("notificationType", type.getText().toString()); + activity.putExtra("userPhoto", userPhoto.getText().toString()); + activity.putExtra("sender", sender.getText().toString()); + activity.putExtra("course", course.getText().toString()); + activity.putExtra("summary", summary.getText().toString()); + activity.putExtra("content", content.getText().toString()); + activity.putExtra("date", date.getText().toString()); + activity.putExtra("time", time.getText().toString()); + activity.putExtra("seenLocal", seenLocalText.getText().toString()); + startActivity(activity); + + return true; }; /** @@ -280,9 +275,9 @@ public class Notifications extends Module implements refreshLayout = (SwipeRefreshLayout) findViewById(R.id.swipe_container_expandablelist); list = (ExpandableListView) findViewById(R.id.expandablelist_pulltorefresh); - emptyNotifTextView = (TextView) findViewById(R.id.list_item_title); + emptyNotifTextView = findViewById(R.id.list_item_title); mBirthdayLayout = (LinearLayout) findViewById(R.id.notify_layout); - mBirthdayTextView = (TextView) findViewById(R.id.notifyTextView); + mBirthdayTextView = findViewById(R.id.notifyTextView); groupItem = new ArrayList<>(); childItem = new ArrayList<>(); @@ -331,7 +326,7 @@ public class Notifications extends Module implements refreshScreen(); } - + /* * (non-Javadoc) * @@ -406,12 +401,12 @@ public class Notifications extends Module implements notifCount = 0; for (int i = 0; i < numNotif; i++) { SoapObject pii = (SoapObject) soap.getProperty(i); - Long notifCode = Long.valueOf(pii.getProperty("notifCode") + long notifCode = Long.parseLong(pii.getProperty("notifCode") .toString()); - Long eventCode = Long.valueOf(pii.getProperty( + long eventCode = Long.parseLong(pii.getProperty( "eventCode").toString()); String eventType = pii.getProperty("eventType").toString(); - Long eventTime = Long.valueOf(pii.getProperty("eventTime") + long eventTime = Long.parseLong(pii.getProperty("eventTime") .toString()); String userNickname = pii.getProperty("userNickname") .toString(); @@ -424,7 +419,7 @@ public class Notifications extends Module implements String userPhoto = pii.getProperty("userPhoto").toString(); String location = pii.getProperty("location").toString(); String summary = pii.getProperty("summary").toString(); - Integer status = Integer.valueOf(pii.getProperty("status") + int status = Integer.parseInt(pii.getProperty("status") .toString()); String content = pii.getProperty("content").toString(); boolean notifReadSWAD = (status >= 4); @@ -587,17 +582,14 @@ public class Notifications extends Module implements @Override public boolean onOptionsItemSelected(MenuItem item) { - switch (item.getItemId()) { - case R.id.action_markAllRead: + if (item.getItemId() == R.id.action_markAllRead) { dbHelper.updateAllNotifications("seenLocal", Utils.parseBoolString(true)); sendReadNotifications(); refreshScreen(); return true; - - default: - return super.onOptionsItemSelected(item); } + return super.onOptionsItemSelected(item); } /* @@ -638,76 +630,8 @@ public class Notifications extends Module implements refreshLayout.setEnabled(enable); } }); - /* - * Create a ListView-specific touch listener. ListViews are given special treatment because - * by default they handle touches for their list items... i.e. they're in charge of drawing - * the pressed state (the list selector), handling list item clicks, etc. - * - * Requires Android 3.1 (HONEYCOMB_MR1) or newer - */ - /*if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB_MR1) { - SwipeListViewTouchListener touchListener = - new SwipeListViewTouchListener( - list, - new SwipeListViewTouchListener.OnSwipeCallback() { - @Override - public void onSwipeLeft(ListView listView, int [] reverseSortedPositions) { - if(reverseSortedPositions.length > 0) { - swipeItem(reverseSortedPositions[0]); - } - } - - @Override - public void onSwipeRight(ListView listView, int [] reverseSortedPositions) { - if(reverseSortedPositions.length > 0) { - swipeItem(reverseSortedPositions[0]); - } - } - - @Override - public void onStartSwipe() { - disableSwipe(); - } - - @Override - public void onStopSwipe() { - enableSwipe(); - } - }, - true, - true); - - list.setOnTouchListener(touchListener); - // Setting this scroll listener is required to ensure that during ListView scrolling, - // we don't look for swipes. - list.setOnScrollListener(touchListener.makeScrollListener(refreshLayout)); - } else { - Log.w(TAG, "SwipeListViewTouchListener requires Android 3.1 (HONEYCOMB_MR1) or newer"); - list.setOnScrollListener(new AbsListView.OnScrollListener() { - @Override - public void onScrollStateChanged(AbsListView absListView, int scrollState) { - } - - @Override - public void onScroll(AbsListView absListView, int firstVisibleItem, - int visibleItemCount, int totalItemCount) { - - boolean enable = false; - if(list != null && list.getChildCount() > 0){ - // check if the first item of the list is visible - boolean firstItemVisible = list.getFirstVisiblePosition() == 0; - // check if the top of the first item is visible - boolean topOfFirstItemVisible = list.getChildAt(0).getTop() == 0; - // enabling or disabling the refresh layout - enable = firstItemVisible && topOfFirstItemVisible; - } - refreshLayout.setEnabled(enable); - } - }); - }*/ } - @TargetApi(Build.VERSION_CODES.ICE_CREAM_SANDWICH) private void setAppearance() { refreshLayout.setColorSchemeResources(android.R.color.holo_blue_bright, android.R.color.holo_green_light, diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java index 5a8949d2..92af7e83 100644 --- a/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java @@ -59,7 +59,6 @@ import es.ugr.swad.swadroid.model.SWADNotification; import es.ugr.swad.swadroid.model.User; import es.ugr.swad.swadroid.modules.login.Login; import es.ugr.swad.swadroid.preferences.Preferences; -import es.ugr.swad.swadroid.ssl.SecureConnection; import es.ugr.swad.swadroid.utils.Utils; import es.ugr.swad.swadroid.webservices.IWebserviceClient; import es.ugr.swad.swadroid.webservices.SOAPClient; @@ -72,8 +71,6 @@ import es.ugr.swad.swadroid.webservices.SOAPClient; */ public class NotificationsSyncAdapterService extends Service { private static final String TAG = "NotificationsSyncAdapterService"; - private static Preferences prefs; - private static SecureConnection conn; private static SyncAdapterImpl sSyncAdapter = null; private static int notifCount; private static DataBaseHelper dbHelper; @@ -81,14 +78,9 @@ public class NotificationsSyncAdapterService extends Service { private static String METHOD_NAME = ""; private static Object result; private static String errorMessage = ""; - private static boolean isConnected; private static boolean isDebuggable; public static final String START_SYNC = "es.ugr.swad.swadroid.sync.start"; public static final String STOP_SYNC = "es.ugr.swad.swadroid.sync.stop"; - /** - * Application context - */ - private static Context mCtx; public NotificationsSyncAdapterService() { super(); @@ -100,7 +92,6 @@ public class NotificationsSyncAdapterService extends Service { public SyncAdapterImpl(Context context) { super(context, true); mContext = context; - mCtx = context; } @Override @@ -187,7 +178,6 @@ public class NotificationsSyncAdapterService extends Service { */ @Override public void onCreate() { - isConnected = Utils.connectionAvailable(this); // Check if debug mode is enabled try { getPackageManager().getApplicationInfo( @@ -198,7 +188,6 @@ public class NotificationsSyncAdapterService extends Service { } try { - prefs = new Preferences(this); dbHelper = new DataBaseHelper(this); //Initialize webservices client webserviceClient = null; @@ -206,19 +195,57 @@ public class NotificationsSyncAdapterService extends Service { Log.e(TAG, "Error initializing database and preferences", e); } + if (Build.VERSION.SDK_INT > Build.VERSION_CODES.O) { + Log.i(TAG, "Starting persistent notification in custom foreground mode"); + startCustomForeground(); + } else { + Log.i(TAG, "Starting persistent notification in standard foreground mode"); + startForeground(1, new Notification()); + } + super.onCreate(); } + @Override + public void onDestroy() { + super.onDestroy(); + + Intent broadcastIntent = new Intent(); + broadcastIntent.setAction("restartNotificationsService"); + broadcastIntent.setClass(this, RestarterNotificationsReceiver.class); + this.sendBroadcast(broadcastIntent); + } + + private void startCustomForeground() { + Intent notificationIntent = new Intent(this, Notifications.class); + PendingIntent pendingIntent; + + notificationIntent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); + //single top to avoid creating many activity stacks queue + notificationIntent.addFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP); + + pendingIntent = PendingIntent.getActivity(this, + 0, + notificationIntent, + PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT | PendingIntent.FLAG_IMMUTABLE); + + Notification notification = AlertNotificationFactory.createBackgroundNotification( + this, + getString(R.string.appRunningBackground), + R.drawable.ic_launcher_swadroid_notif, + R.drawable.ic_launcher_swadroid, + pendingIntent); + + startForeground(2, notification); + } + /* (non-Javadoc) * @see android.app.Service#onStartCommand(android.content.Intent, int, int) */ @Override public int onStartCommand(Intent intent, int flags, int startId) { super.onStartCommand(intent, flags, startId); - // return START_NOT_STICKY - we want this Service to be left running - // unless explicitly stopped, and it's process is killed, we want it to - // be restarted - return START_STICKY; + return START_REDELIVER_INTENT; } @Override @@ -342,10 +369,10 @@ public class NotificationsSyncAdapterService extends Service { notifCount = 0; for (int i = 0; i < numNotif; i++) { SoapObject pii = (SoapObject) soap.getProperty(i); - Long notifCode = Long.valueOf(pii.getProperty("notifCode").toString()); - Long eventCode = Long.valueOf(pii.getProperty("eventCode").toString()); + long notifCode = Long.parseLong(pii.getProperty("notifCode").toString()); + long eventCode = Long.parseLong(pii.getProperty("eventCode").toString()); String eventType = pii.getProperty("eventType").toString(); - Long eventTime = Long.valueOf(pii.getProperty("eventTime").toString()); + long eventTime = Long.parseLong(pii.getProperty("eventTime").toString()); String userNickname = pii.getProperty("userNickname").toString(); String userSurname1 = pii.getProperty("userSurname1").toString(); String userSurname2 = pii.getProperty("userSurname2").toString(); @@ -353,7 +380,7 @@ public class NotificationsSyncAdapterService extends Service { String userPhoto = pii.getProperty("userPhoto").toString(); String location = pii.getProperty("location").toString(); String summary = pii.getProperty("summary").toString(); - Integer status = Integer.valueOf(pii.getProperty("status").toString()); + int status = Integer.parseInt(pii.getProperty("status").toString()); String content = pii.getProperty("content").toString(); boolean notifReadSWAD = (status >= 4); boolean notifCancelled = (status >= 8); diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/RestarterNotificationsReceiver.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/RestarterNotificationsReceiver.java new file mode 100644 index 00000000..50eb354a --- /dev/null +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/modules/notifications/RestarterNotificationsReceiver.java @@ -0,0 +1,48 @@ +/* + * This file is part of SWADroid. + * + * Copyright (C) 2010 Juan Miguel Boyero Corral + * + * SWADroid is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * SWADroid is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with SWADroid. If not, see . + */ + +package es.ugr.swad.swadroid.modules.notifications; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.os.Build; +import android.util.Log; + +/** + * Restarter for NotificationsSyncAdapterService service. + * + * @author Juan Miguel Boyero Corral + */ +public class RestarterNotificationsReceiver extends BroadcastReceiver { + private static final String TAG = "RestarterNotificationsReceiver"; + + @Override + public void onReceive(Context context, Intent intent) { + Log.i(TAG, "Service tried to stop"); + + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { + context.startForegroundService(new Intent(context, NotificationsSyncAdapterService.class)); + } else { + context.startService(new Intent(context, NotificationsSyncAdapterService.class)); + } + + Log.i(TAG, "Service restarted"); + } +} diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/Preferences.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/Preferences.java index 16b4a4e5..b94d433a 100644 --- a/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/Preferences.java +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/Preferences.java @@ -18,11 +18,9 @@ */ package es.ugr.swad.swadroid.preferences; -import android.annotation.TargetApi; import android.content.Context; import android.content.SharedPreferences; import android.content.SharedPreferences.Editor; -import android.os.Build; import android.os.Bundle; import android.util.Log; @@ -85,22 +83,6 @@ public class Preferences { * Rate preference name */ public static final String RATEPREF = "ratePref"; - /** - * Twitter preference name - */ - public static final String TWITTERPREF = "twitterPref"; - /** - * Facebook preference name - */ - public static final String FACEBOOKPREF = "facebookPref"; - /** - * Telegram preference name - */ - public static final String TELEGRAMPREF = "telegramPref"; - /** - * Blog preference name - */ - public static final String BLOGPREF = "blogPref"; /** * Share preference name */ @@ -177,7 +159,6 @@ public class Preferences { /** * Constructor */ - @TargetApi(Build.VERSION_CODES.HONEYCOMB) public Preferences(Context ctx) { getPreferences(ctx); diff --git a/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/PreferencesActivity.java b/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/PreferencesActivity.java index 15904c90..c7b036c5 100644 --- a/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/PreferencesActivity.java +++ b/SWADroid/src/main/java/es/ugr/swad/swadroid/preferences/PreferencesActivity.java @@ -82,22 +82,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere * Rate preference */ private static Preference ratePref; - /** - * Twitter preference - */ - private static Preference twitterPref; - /** - * Facebook preference - */ - private static Preference facebookPref; - /** - * Telegram preference - */ - private static Preference telegramPref; - /** - * Blog preference - */ - private static Preference blogPref; /** * Share preference */ @@ -180,10 +164,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere logOutPref = findPreference(Preferences.LOGOUTPREF); currentVersionPref = findPreference(Preferences.CURRENTVERSIONPREF); ratePref = findPreference(Preferences.RATEPREF); - twitterPref = findPreference(Preferences.TWITTERPREF); - facebookPref = findPreference(Preferences.FACEBOOKPREF); - telegramPref = findPreference(Preferences.TELEGRAMPREF); - blogPref = findPreference(Preferences.BLOGPREF); sharePref = findPreference(Preferences.SHAREPREF); privacyPolicyPref = findPreference(Preferences.PRIVACYPOLICYPREF); syncTimePref = findPreference(Preferences.SYNCTIMEPREF); @@ -191,10 +171,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere //syncTimeLocationPref = findPreference(Preferences.SYNCLOCATIONTIMEPREF); ratePref.setOnPreferenceChangeListener(this); - twitterPref.setOnPreferenceChangeListener(this); - facebookPref.setOnPreferenceChangeListener(this); - telegramPref.setOnPreferenceChangeListener(this); - blogPref.setOnPreferenceChangeListener(this); sharePref.setOnPreferenceChangeListener(this); privacyPolicyPref.setOnPreferenceChangeListener(this); syncEnablePref.setOnPreferenceChangeListener(this); @@ -229,54 +205,6 @@ public class PreferencesActivity extends PreferenceActivity implements OnPrefere return true; } }); - twitterPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { - /** - * Called when a preference is selected. - * @param preference Preference selected. - */ - public boolean onPreferenceClick(Preference preference) { - Intent urlIntent = new Intent(Intent.ACTION_VIEW); - urlIntent.setData(Uri.parse(getString(R.string.twitterURL))); - startActivity(urlIntent); - return true; - } - }); - facebookPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { - /** - * Called when a preference is selected. - * @param preference Preference selected. - */ - public boolean onPreferenceClick(Preference preference) { - Intent urlIntent = new Intent(Intent.ACTION_VIEW); - urlIntent.setData(Uri.parse(getString(R.string.facebookURL))); - startActivity(urlIntent); - return true; - } - }); - telegramPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { - /** - * Called when a preference is selected. - * @param preference Preference selected. - */ - public boolean onPreferenceClick(Preference preference) { - Intent urlIntent = new Intent(Intent.ACTION_VIEW); - urlIntent.setData(Uri.parse(getString(R.string.telegramURL))); - startActivity(urlIntent); - return true; - } - }); - blogPref.setOnPreferenceClickListener(new OnPreferenceClickListener() { - /** - * Called when a preference is selected. - * @param preference Preference selected. - */ - public boolean onPreferenceClick(Preference preference) { - Intent urlIntent = new Intent(Intent.ACTION_VIEW); - urlIntent.setData(Uri.parse(getString(R.string.blogURL))); - startActivity(urlIntent); - return true; - } - }); sharePref.setOnPreferenceClickListener(new OnPreferenceClickListener() { /** * Called when a preference is selected. diff --git a/SWADroid/src/main/res/raw-es/changes.html b/SWADroid/src/main/res/raw-es/changes.html index dc75379e..402efbe3 100644 --- a/SWADroid/src/main/res/raw-es/changes.html +++ b/SWADroid/src/main/res/raw-es/changes.html @@ -18,22 +18,27 @@ - -

1.5.8 (2022-05-23)

+

1.5.9

+
    +
  • Añadido soporte para la descarga de notificaciones en segundo plano cuando la optimización de batería está habilitada
  • +
+ +

1.5.8

  • Corregida descarga de notificaciones en Android 12 (S)
-

1.5.7 (2020-12-19)

+

1.5.7

  • Corregida descarga de archivos en Android R
-

1.5.6 (2019-11-05)

+

1.5.6

  • Pasar lista: @@ -41,13 +46,13 @@
-

1.5.5 (2019-07-08)

+

1.5.5

  • Añadido soporte para Android-Q
  • Corregidas erratas en el historial de cambios
-

1.5.4 (2018-02-25)

+

1.5.4

    [CORRECCIONES]
  • @@ -56,7 +61,7 @@
-

1.5.3 (2017-10-25)

+

1.5.3

    [NOVEDADES]
  • Añadida compatibilidad con el sistema de notificaciones de Android @@ -64,7 +69,7 @@
-

1.5.2 (2017-02-12)

+

1.5.2

    [NOVEDADES]
  • Añadida política de privacidad de datos en la pantalla de @@ -78,12 +83,12 @@ Calificaciones, ahora se encuentran en la nueva carpeta Archivos
-

1.5.1 (2017-01-21)

+

1.5.1

    [CORRECCIONES]
  • Corregido error unparseable date: "anyType{}"(at offset 0)
-

1.5.0 (2016-09-01)

+

1.5.0

    [NOVEDADES]
  • @@ -91,7 +96,7 @@ Añadida búsqueda de destinatarios
-

1.4.0 (2016-07-25)

+

1.4.0

    [NOVEDADES]
  • @@ -107,7 +112,7 @@ Corregida consulta de calificaciones desde el rol estudiante
-

1.3.4 (2016-07-17)

+

1.3.4

    [ACTUALIZACIONES]
  • @@ -129,7 +134,7 @@ Mejoras menores
-

1.3.3 (2016-01-31)

+

1.3.3

    [NOVEDADES]
  • Añadidas notificaciones sociales
  • @@ -142,12 +147,12 @@ mayor a 30 días
-

1.3.2 (2016-01-06)

+

1.3.2

    [NOVEDADES]
  • Añadida gestión de permisos en Android 6.0 Marshmallow
-

1.3.1 (2015-12-06)

+

1.3.1

    [ACTUALIZACIONES]
  • Mejoras en las pantallas de identificación y creación de @@ -155,7 +160,7 @@
  • Ahora las notificaciones canceladas no se descargan durante la sincronización
-

1.3 (2015-09-03)

+

1.3

    [NOVEDADES]
  • Añadida creación de cuentas de usuario
  • @@ -166,13 +171,13 @@ y tests (parcial en tests)
-

1.2.4 (2015-03-15)

+

1.2.4

    [ACTUALIZACIONES]
  • Reducido retardo entre escaneos de códigos a un segundo
  • Ahora el módulo de descargas requiere Android 3.0 o superior
-

1.2.3 (2014-11-30)

+

1.2.3

    [NOVEDADES]
  • Añadido soporte para escaneo de códigos de barras en el @@ -186,7 +191,7 @@
  • Reducido retardo entre escaneos de códigos a 2 segundos
-

1.2.2 (2014-11-26)

+

1.2.2

    [ACTUALIZACIONES]
  • Deshabilitado el deslizamiento lateral de las notificaciones
  • @@ -201,7 +206,7 @@ correctamente
-

1.2.1 (2014-11-24)

+

1.2.1

    [ACTUALIZACIONES]
  • Ahora se pueden enviar listados de asistencias vacíos para marcar @@ -212,7 +217,7 @@ [CORRECCIONES]
  • Corregido refresco en pantalla del listado de asistencias
-

1.2 (2014-11-23)

+

1.2

    [NOVEDADES]
  • Añadidas felicitaciones de cumpleaños
  • @@ -220,19 +225,19 @@ las asistencias a SWAD
-

1.1.4 (2014-11-11)

+

1.1.4

    [CORRECCIONES]
  • Corregida descarga de notificaciones por modificaciones en SWAD
-

1.1.3 (2014-10-05)

+

1.1.3

    [CORRECCIONES]
  • Corregida actualización errónea de las notificaciones al desplazar hacia arriba la lista
-

1.1.2 (2014-09-18)

+

1.1.2

    [ACTUALIZACIONES]
  • Mejoras en los mensajes de error
  • @@ -244,7 +249,7 @@ [CORRECCIONES]
  • Corregidos errores tipográficos en el historial de cambios
-

1.1.1 (2014-09-16)

+

1.1.1

    [ACTUALIZACIONES]
  • Ahora el desplazamiento lateral de las notificaciones sólo está @@ -257,7 +262,7 @@ desplazar la lista hacia arriba sin estar en la parte superior de la misma
-

1.1 (2014-09-08)

+

1.1

    [ACTUALIZACIONES]
  • Ahora las notificaciones se agrupan en @@ -293,7 +298,7 @@ aplicación
-

1.0 (2014-03-26)

+

1.0

    [NOVEDADES]
  • Nueva interfaz gráfica estilo Holo
  • @@ -316,7 +321,7 @@
  • Eliminados los idiomas no utilizados por los usuarios
-

0.13 (2014-02-02)

+

0.13

    [NOVEDADES]
  • Añadida pantalla de identificación
  • @@ -327,7 +332,7 @@ 2.3 o superior cuando la sincronización automática está activada
-

0.12.7 (2013-12-14)

+

0.12.7

    [NOVEDADES]
  • Añadida información de las notificaciones vistas en SWAD al @@ -344,7 +349,7 @@
  • Corregido error al recuperar la configuración de los tests
-

0.12.6 (2013-11-24)

+

0.12.6

    [NOVEDADES]
  • Añadido control de las notificaciones vistas
  • @@ -366,17 +371,17 @@
  • Corregido color de fondo negro al deslizar el listado de notificaciones
-

0.12.5 (2013-11-10)

+

0.12.5

    [CORRECCIONES]
  • Corregido error que impedía responder mensajes
-

0.12.4 (2013-11-09)

+

0.12.4

    [CORRECCIONES]
  • Corregido error que impedía consultar las sesiones de prácticas
-

0.12.3 (2013-11-09)

+

0.12.3

    [NOVEDADES]
  • Añadido sistema de actualización "Arrastrar-para-actualizar" @@ -420,13 +425,13 @@
  • Corregido error en la selección del número de preguntas de test
-

0.12.2 (2013-06-19)

+

0.12.2

    [ACTUALIZACIONES]
  • Actualizadas las comunicaciones con el servidor
-

0.12.1 (2013-06-09)

+

0.12.1

    [NOVEDADES]
  • Añadidas notificaciones de foros
  • @@ -455,7 +460,7 @@
  • Corregida la detección del valor nulo en la respuesta del servidor
-

0.12 (2013-04-20)

+

0.12

    [NOVEDADES]
  • Añadidos los nuevos tipos de notificación de Documentos, @@ -500,7 +505,7 @@ dispositivos
-

0.11.3 (2013-03-03)

+

0.11.3

    [ACTUALIZACIONES]
  • Ahora se muestra el servidor por defecto cuando el campo "Servidor" se deja @@ -514,7 +519,7 @@ asignaturas ante un cambio de configuración
-

0.11.2 (2013-02-24)

+

0.11.2

    [NOVEDADES]
  • Añadido botón de actualización de las asignaturas en la @@ -539,7 +544,7 @@
  • Corregido comportamiento anómalo de los checkboxes en Android 4.2
-

0.11.1 (2013-01-26)

+

0.11.1

    [NOVEDADES]
  • Añadida compatibilidad con pantallas táctiles básicas @@ -568,7 +573,7 @@ descriptores de los tests
-

0.11 (2012-12-15)

+

0.11

    [NOVEDADES]
  • Añadido módulo de Descargas
  • @@ -580,7 +585,7 @@ opciones de SWAD
-

0.10.1 (2012-11-17)

+

0.10.1

    [NOVEDADES]
  • Añadida compatibilidad con Android 4.2
  • @@ -603,7 +608,7 @@ asunto
-

0.10 (2012-11-09)

+

0.10

    [NOVEDADES]
  • Añadido módulo de inscripción a grupos
  • @@ -620,7 +625,7 @@
  • Corregido error en la comprobación de la conexión a Internet
-

0.9.3 (2012-07-20)

+

0.9.3

    [NOVEDADES]
  • Añadido soporte para carpetas en la URL del servidor
  • @@ -629,14 +634,14 @@ [ACTUALIZACIONES]
  • mMjoras en los mensajes de error
-

0.9.2 (2012-07-10)

+

0.9.2

    [CORRECCIONES]
  • La característica camera.autofocus ahora es opcional para corregir incompatibilidades con algunos dispositivos
-

0.9.1 (2012-07-09)

+

0.9.1

    [NOVEDADES]
  • Añadido soporte pana DNI con letra (primera y última posición) @@ -648,19 +653,19 @@ [CORRECCIONES]
  • Corregido soporte para pantallas grandes
-

0.9 (2012-07-01)

+

0.9

    [NOVEDADES]
  • Añadido módulo para pasar lista
-

0.8.1 (2012-05-20)

+

0.8.1

    [NOVEDADES]
  • Añadida opción para responder mensajes desde su notificación abierta
-

0.8 (2012-05-01)

+

0.8

    [NOVEDADES]
  • Añadida sincronización automática de las @@ -691,7 +696,7 @@
  • Corregido bug HTML en el campo "location" de las notificaciones
  • Corregido error en la etiqueta br de las notificaciones
-

0.7.2 (2012-02-22)

+

0.7.2

    [NOVEDADES]
  • Añadidas alertas de notificaciones en la barra de estado
  • @@ -701,7 +706,7 @@ [ACTUALIZACIONES]
  • Optimizadas las consultas a la base de datos
-

0.7.1 (2012-01-11)

+

0.7.1

    [ACTUALIZACIONES]
  • Mejorada la velocidad de renderizado de las calificaciones
  • @@ -710,14 +715,14 @@ [CORRECCIONES]
  • Corregidos errores de renderizado en las calificaciones
-

0.7 (2012-01-10)

+

0.7

    [NOVEDADES]
  • Añadida visualización de las calificaciones al pulsar sobre la notificación asociada
-

0.6.2 (2011-12-09)

+

0.6.2

    [NOVEDADES]
  • Añadido enlace al blog de la aplicación en la pantalla de @@ -732,7 +737,7 @@
  • Cambios menores en los mensajes de error
-

0.6.1 (2011-11-16)

+

0.6.1

    [NOVEDADES]
  • Añadido enlace a la página de Google+ de la @@ -747,7 +752,7 @@ [CORRECCIONES]
  • Corregido el funcionamiento del menú de opciones
-

0.6 (2011-11-06)

+

0.6

    [NOVEDADES]
  • Añadida compatibilidad con Android 4.0
  • @@ -759,7 +764,7 @@
  • Añadido autor de SWAD en la pantalla de configuración
-

0.5.2 (2011-09-29)

+

0.5.2

    [NOVEDADES]
  • Añadido el nombre real de los destinatarios en el mensaje "Mensaje @@ -774,12 +779,12 @@ [CORRECCIONES]
  • Corregido error en la descarga de las preguntas de test
-

0.5.1 (2011-09-26)

+

0.5.1

    [CORRECCIONES]
  • Corregido error al responder mensajes
-

0.5 (2011-09-26)

+

0.5

    [NOVEDADES]
  • Añadido módulo de envío de mensajes
  • @@ -788,17 +793,17 @@ [CORRECCIONES]
  • Correcciones menores
-

0.4.5 (2011-07-08)

+

0.4.5

    [ACTUALIZACIONES]
  • Optimizada la descarga de las preguntas de test
-

0.4.4 (2011-07-05)

+

0.4.4

    [CORRECCIONES]
  • Correccoines menores
-

0.4.3 (2011-06-15)

+

0.4.3

    [ACTUALIZACIONES]
  • mejorada la vissualización de los tests
  • @@ -807,7 +812,7 @@ [CORRECCIONES]
  • Correcciones menores
-

0.4.2 (2011-06-15)

+

0.4.2

    [ACTUALIZACIONES]
  • Ahora las preguntas no contestadas puntúan como 0
  • @@ -816,7 +821,7 @@
  • mejoras en la cisualización de los tests
-

0.4.1 (2011-06-14)

+

0.4.1

    [ACTUALIZACIONES]
  • Se permiten puntuacioes negativas en los tests
  • @@ -825,7 +830,7 @@ [CORRECCIONES]
  • Correcifo error al descargar las preguntas de test
-

0.4 (2011-06-13)

+

0.4

    [NOVEDADES]
  • Añadido módulo de Tests
  • @@ -834,7 +839,7 @@ [CORRECCIONES]
  • Correcciones menores
-

0.3.10 (2011-05-19)

+

0.3.10

    [NOVEDADES]
  • Añadidas notificaciones de actividades, encuestas y notificaciones @@ -848,28 +853,28 @@
  • Añadido mensaje de error de credenciales erróneas
-

0.3.9 (2011-05-03)

+

0.3.9

    [CORRECCIONES]
  • Corregido error de campos vacíos en las notificaciones
-

0.3.8 (2011-04-27)

+

0.3.8

    [CORRECCIONES]
  • Corregido error al borrar las notificaciones antiguas
-

0.3.7 (2011-04-14)

+

0.3.7

    [CORRECCIONES]
  • Corregido error en el apellido de las notificaciones
-

0.3.6 (2011-04-13)

+

0.3.6

    [NOVEDADES]
  • Añadidos detalles de las notificaciones
  • Añadido mensaje de actualización de la aplicación
-

0.3.5 (2011-04-05)

+

0.3.5

    [NOVEDADES]
  • Añadida barra de acción
  • @@ -882,7 +887,7 @@
  • Mejorada la interfaz de usuario
  • Mejoras de rendimiento
-

0.3.4 (2011-03-27)

+

0.3.4

    [ACTUALIZACIONES]
  • Mejorada la interfaz de usuario
  • @@ -891,12 +896,12 @@ [CORRECCIONES]
  • Corregidos errores menores en los mensajes de error
-

0.3.3 (2011-03-27)

+

0.3.3

    [ACTUALIZACIONES]
  • Rediseñada la interfaz de usuario
-

0.3.2 (2011-03-24)

+

0.3.2

    [NOVEDADES]
  • Añadido cuadro de diálogo de primer inicio de la aplicación
  • @@ -905,7 +910,7 @@ [ACTUALIZACIONES]
  • mejorada la pantalla de configuración
-

0.3.1 (2011-03-21)

+

0.3.1

    [NOVEDADES]
  • Añadido guardado automático de la configuración
  • @@ -921,13 +926,13 @@ [CORRECCIONES]
  • Corregidos problemas de compatibilidad con algunos dispositivos
-

0.3 (2011-03-08)

+

0.3

    [NOVEDADES]
  • Añadido módulo de Notificaciones
  • Añadida compatibilidad con Android 3.0 Honeycomb
-

0.2.2 (2011-01-18)

+

0.2.2

    [NOVEDADES]
  • Añadida comprobación de la conexión a Internet
  • @@ -944,13 +949,13 @@
  • Corregidos los iconos del lanzador
  • Corregidos problemas de compatibilidad con Android 1.6
-

0.2.1 (2010-12-15)

+

0.2.1

    [NOVEDADES]
  • Añadida compatibilidad con Android 2.3 Gingerbread
  • Completado el módulo de Login
-

0.2 (2010-12-08)

+

0.2

    [NOVEDADES]
  • Añadido cierre de sesión automático cuando se modifica @@ -958,7 +963,7 @@
  • Añadida base de datos inicial
-

0.1.1 (2010-11-06)

+

0.1.1

    [NOVEDADES]
  • Añadida imagen de fondo en la pantalla principal
  • @@ -967,7 +972,7 @@ [CORRECCIONES]
  • Correcciones menores en la pantalla principal
-

0.1 (2010-11-03)

+

0.1

    [NOVEDADES]
  • Versión inicial
  • diff --git a/SWADroid/src/main/res/raw/changes.html b/SWADroid/src/main/res/raw/changes.html index 2b95db3f..dc294391 100644 --- a/SWADroid/src/main/res/raw/changes.html +++ b/SWADroid/src/main/res/raw/changes.html @@ -18,22 +18,27 @@ -

    1.5.8 (2022-05-23)

    +

    1.5.9

    +
      +
    • Added support for background notification download when power save mode is enabled
    • +
    + +

    1.5.8

    • Fixed notifications downloads on Android 12 (S)
    -

    1.5.7 (2020-12-19)

    +

    1.5.7

    • Fixed file downloads on Android R
    -

    1.5.6 (2019-11-05)

    +

    1.5.6

    • Rollcall: @@ -41,13 +46,13 @@
    -

    1.5.5 (2019-07-08)

    +

    1.5.5

    • Added support for Android-Q
    • Fixed CHANGELOG typos
    -

    1.5.4 (2018-02-25)

    +

    1.5.4

      [FIXES]
    • @@ -56,13 +61,13 @@
    -

    1.5.3 (2017-10-25)

    +

    1.5.3

      [NEW]
    • Added compatibility for Android Oreo notifications system
    -

    1.5.2 (2017-02-12)

    +

    1.5.2

      [NEW]
    • Added privacy policy in Preferences screen
    • @@ -73,12 +78,12 @@ files, such as Documents, Shared and Marks, are now available in the new Files folder
    -

    1.5.1 (2017-01-21)

    +

    1.5.1

      [FIXES]
    • Fixed unparseable date: "anyType{}"(at offset 0) error
    -

    1.5.0 (2016-09-01)

    +

    1.5.0

      [NEW]
    • @@ -86,7 +91,7 @@ Added search of recipients
    -

    1.4.0 (2016-07-25)

    +

    1.4.0

      [NEW]
    • @@ -101,7 +106,7 @@ Fixed consultation of marks from the student role
    -

    1.3.4 (2016-07-17)

    +

    1.3.4

      [UPDATES]
    • @@ -122,7 +127,7 @@ Minor improvements
    -

    1.3.3 (2016-01-31)

    +

    1.3.3

      [NEW]
    • Added social notifications
    • @@ -133,18 +138,18 @@ Now notifications are automatically removed with greater age than 30 days
    -

    1.3.2 (2016-01-06)

    +

    1.3.2

      [NEW]
    • Added permission management on Android 6.0 Marshmallow
    -

    1.3.1 (2015-12-06)

    +

    1.3.1

      [UPDATES]
    • Improvements on login screen and create account screen
    • Now canceled notifications are not downloaded during synchronization
    -

    1.3 (2015-09-03)

    +

    1.3

      [NEW]
    • Added creation of user accounts
    • @@ -154,13 +159,13 @@ (partial in tests)
    -

    1.2.4 (2015-03-15)

    +

    1.2.4

      [UPDATES]
    • Changed scan delay of codes to one second
    • Now the Downloads module requires Android 3.0 or higher
    -

    1.2.3 (2014-11-30)

    +

    1.2.3

      [NEW]
    • Added support for barcode scanning in rollcall module
    • @@ -170,7 +175,7 @@
    • Now the events list is sorted in rollcall module
    • Changed scan delay of codes to 2 seconds
    -

    1.2.2 (2014-11-26)

    +

    1.2.2

      [UPDATES]
    • Disabled lateral sliding of notifications
    • @@ -181,7 +186,7 @@
    • Fixed screen refresh of users and attendances lists
    • Now the relationship between events and courses is handled properly
    -

    1.2.1 (2014-11-24)

    +

    1.2.1

      [UPDATES]
    • Now you can send empty attendance listings to mark all attendees as @@ -192,23 +197,23 @@ [FIXES]
    • Fixed screen refresh of attendances list
    -

    1.2 (2014-11-23)

    +

    1.2

      [NEW]
    • Added birthday greetings
    • Added rollcall module with sending of attendances to SWAD
    -

    1.1.4 (2014-11-11)

    +

    1.1.4

      [FIXES]
    • Fixed download of notifications due to changes in SWAD
    -

    1.1.3 (2014-10-05)

    +

    1.1.3

      [FIXES]
    • Fixed wrong update of notifications when sliding up the list
    -

    1.1.2 (2014-09-18)

    +

    1.1.2

      [UPDATES]
    • Improvements in error messages
    • @@ -220,7 +225,7 @@ [FIXES]
    • Fixed typos in changelog
    -

    1.1.1 (2014-09-16)

    +

    1.1.1

      [UPDATES]
    • Now the lateral sliding of the notifications is only available for Android @@ -233,7 +238,7 @@ without being on top of it
    -

    1.1 (2014-09-08)

    +

    1.1

      [UPDATES]
    • Now the notifications are grouped into @@ -260,7 +265,7 @@
    • Fixed crash for open downloaded files with no apps to open with
    -

    1.0 (2014-03-26)

    +

    1.0

      [NEW]
    • New GUI Holo style
    • @@ -276,7 +281,7 @@
    • Disabled rollcall module (pending redesign and integration with SWAD)
    • Removed unused languages
    -

    0.13 (2014-02-02)

    +

    0.13

      [NEW]
    • Added login screen
    • @@ -287,7 +292,7 @@ when automatic synchronization is enabled
    -

    0.12.7 (2013-12-14)

    +

    0.12.7

      [NEW]
    • Added info of seen notifications from SWAD on notifications download
    • @@ -300,7 +305,7 @@
    • Fixed error retrieving the list of students on the rollcall module
    • Fixed error retrieving the tests configuration
    -

    0.12.6 (2013-11-24)

    +

    0.12.6

      [NEW]
    • Added management of seen notifications
    • @@ -317,17 +322,17 @@
    • Fixed black background color when the notifications list is being pulled
    -

    0.12.5 (2013-11-10)

    +

    0.12.5

      [FIXES]
    • Fixed bug that prevented replying messages
    -

    0.12.4 (2013-11-09)

    +

    0.12.4

      [FIXES]
    • Fixed bug that prevented consulting practice sessions
    -

    0.12.3 (2013-11-09)

    +

    0.12.3

      [NEW]
    • Added pull-to-refresh update system to the notifications
    • @@ -357,12 +362,12 @@
    • Fixed a bug when trying to download an user picture from an empty URL
    • Fixed display bug on number of questions input of the tests
    -

    0.12.2 (2013-06-19)

    +

    0.12.2

      [UPDATES]
    • Updated communications with server
    -

    0.12.1 (2013-06-09)

    +

    0.12.1

      [NEW]
    • Added forumPostCourse notification type
    • @@ -387,7 +392,7 @@
    • Fixed error messages display
    • Modified NULL value detection in server response
    -

    0.12 (2013-04-20)

    +

    0.12

      [NEW]
    • Added new notification types "documentFile", "sharedFile", "enrollment" and @@ -429,7 +434,7 @@
    • Fixed non decimal keyboard type for decimal numbers on some devices
    -

    0.11.3 (2013-03-03)

    +

    0.11.3

      [UPDATES]
    • Shows default server in preference summary when the preference value is @@ -443,7 +448,7 @@ preferences change
    -

    0.11.2 (2013-02-24)

    +

    0.11.2

      [NEW]
    • Added refresh button on main screen to update courses without clean the @@ -466,7 +471,7 @@ behaviour is exactly the opposite in Android 4.2)
    -

    0.11.1 (2013-01-26)

    +

    0.11.1

      [NEW]
    • Added compatibility with screens with basic touch capabilities
    • @@ -492,7 +497,7 @@ descriptors
    -

    0.11 (2012-12-15)

    +

    0.11

      [NEW]
    • Added downloads module
    • @@ -504,7 +509,7 @@ functions in SWAD
    -

    0.10.1 (2012-11-17)

    +

    0.10.1

      [NEW]
    • Added Android 4.2 compatibility
    • @@ -521,7 +526,7 @@
    • Fixed available choose for groups with real membership
    • Fixed problem with uppercase letter in notifications without summary
    -

    0.10 (2012-11-09)

    +

    0.10

      [NEW]
    • Added module for enrollment to course groups
    • @@ -539,7 +544,7 @@
    • Fixed some bugs in course selection spinner
    • Fixed bug when checking available connections
    -

    0.9.3 (2012-07-20)

    +

    0.9.3

      [NEW]
    • Added folders support in server URL
    • @@ -548,14 +553,14 @@ [UPDATES]
    • Improved error messages
    -

    0.9.2 (2012-07-10)

    +

    0.9.2

      [FIXES]
    • camera.autofocus feature marked as optional in order to fix device incompatibilities
    -

    0.9.1 (2012-07-09)

    +

    0.9.1

      [NEW]
    • Added DNI with letter (first and last) support and DNI with zeros support @@ -566,17 +571,17 @@ [FIXES]
    • Fixed xlarge screens support
    -

    0.9 (2012-07-01)

    +

    0.9

      [NEW]
    • Added RollCall module
    -

    0.8.1 (2012-05-20)

    +

    0.8.1

      [NEW]
    • Added message replys from open notifications
    -

    0.8 (2012-05-01)

    +

    0.8

      [NEW]
    • Added automatic synchronization of notifications
    • @@ -597,7 +602,7 @@
    • Fixed HTML bug in location field of notifications
    • Fixed br tag bug in notifications
    -

    0.7.2 (2012-02-22)

    +

    0.7.2

      [NEW]
    • Added notification alerts on status bar
    • @@ -607,7 +612,7 @@ [UPDATES]
    • Improved query statements
    -

    0.7.1 (2012-01-11)

    +

    0.7.1

      [UPDATES]
    • Improved rendering speed in marks function
    • @@ -616,12 +621,12 @@ [FIXES]
    • Fixed rendering errors in marks function
    -

    0.7 (2012-01-10)

    +

    0.7

      [NEW]
    • Added marks function in notifications module
    -

    0.6.2 (2011-12-09)

    +

    0.6.2

      [NEW]
    • Added Blog URL to preferences screen
    • @@ -632,7 +637,7 @@
    • Reinitialized last course selected on database cleaning
    • Minor changes on error messages
    -

    0.6.1 (2011-11-16)

    +

    0.6.1

      [NEW]
    • Added Google+ account to preferences screen
    • @@ -645,7 +650,7 @@ [FIXES]
    • Fixed menu operation in all activities
    -

    0.6 (2011-11-06)

    +

    0.6

      [NEW]
    • Added Android 4.0 compatibility
    • @@ -653,7 +658,7 @@
    • Added clean database option to application menu
    • Added name of SWAD's creator to author preferences
    -

    0.5.2 (2011-09-29)

    +

    0.5.2

      [NEW]
    • Added real names of receivers in "Message Sent" toast
    • @@ -666,12 +671,12 @@ [FIXES]
    • Fixed bug on test questions syncronization
    -

    0.5.1 (2011-09-26)

    +

    0.5.1

      [FIXES]
    • Fixed bug in reply messages function
    -

    0.5 (2011-09-26)

    +

    0.5

      [NEW]
    • Added messages module
    • @@ -680,17 +685,17 @@ [FIXES]
    • Minor fixes
    -

    0.4.5 (2011-07-08)

    +

    0.4.5

      [UPDATES]
    • Optimized questions syncronization
    -

    0.4.4 (2011-07-05)

    +

    0.4.4

      [FIXES]
    • Minor fixes
    -

    0.4.3 (2011-06-15)

    +

    0.4.3

      [UPDATES]
    • Improved tests GUI
    • @@ -699,7 +704,7 @@ [FIXES]
    • Minor fixes
    -

    0.4.2 (2011-06-15)

    +

    0.4.2

      [UPDATES]
    • Now not answered questions score as 0
    • @@ -708,7 +713,7 @@
    • Improved tests GUI
    -

    0.4.1 (2011-06-14)

    +

    0.4.1

      [UPDATES]
    • Allowed negative scores on tests
    • @@ -717,7 +722,7 @@ [FIXES]
    • Fixed bug on questions syncronization
    -

    0.4 (2011-06-13)

    +

    0.4

      [NEW]
    • Added tests module
    • @@ -726,7 +731,7 @@ [FIXES]
    • Minor fixes
    -

    0.3.10 (2011-05-19)

    +

    0.3.10

      [NEW]
    • Added assignment, survey and unknown notifications
    • @@ -734,28 +739,28 @@
    • Added forced relogin if connection time exceeds a certain period
    • Added incorrect user or password error message
    -

    0.3.9 (2011-05-03)

    +

    0.3.9

      [FIXES]
    • Fixed empty fields bug on notifications module
    -

    0.3.8 (2011-04-27)

    +

    0.3.8

      [FIXES]
    • Fixed bug on cleaning old notifications
    -

    0.3.7 (2011-04-14)

    +

    0.3.7

      [FIXES]
    • Fixed notifications bug in surname
    -

    0.3.6 (2011-04-13)

    +

    0.3.6

      [NEW]
    • Added notification details
    • Added upgrade dialog
    -

    0.3.5 (2011-04-05)

    +

    0.3.5

      [NEW]
    • Added action bar
    • @@ -766,7 +771,7 @@
    • Improved GUI
    • Improved performance
    -

    0.3.4 (2011-03-27)

    +

    0.3.4

      [UPDATES]
    • Improved GUI
    • @@ -775,12 +780,12 @@ [FIXES]
    • Fixed minor errors on error messages
    -

    0.3.3 (2011-03-27)

    +

    0.3.3

      [UPDATES]
    • Redesigned GUI
    -

    0.3.2 (2011-03-24)

    +

    0.3.2

      [NEW]
    • Added first run dialog
    • @@ -789,7 +794,7 @@ [UPDATES]
    • Improved preferences screen
    -

    0.3.1 (2011-03-21)

    +

    0.3.1

      [NEW]
    • Added automatic saving of preferences
    • @@ -804,13 +809,13 @@ [FIXES]
    • Fixed compatibility issues with some devices
    -

    0.3 (2011-03-08)

    +

    0.3

      [NEW]
    • Added notifications module
    • Added Android 3.0 Honeycomb compatibility
    -

    0.2.2 (2011-01-18)

    +

    0.2.2

      [NEW]
    • Added connection check
    • @@ -827,19 +832,19 @@
    • Fixed launcher icons
    • Fixed Android 1.6 compatibility issues
    -

    0.2.1 (2010-12-15)

    +

    0.2.1

      [NEW]
    • Added Android 2.3 Gingerbread compatibility
    • Completed login module
    -

    0.2 (2010-12-08)

    +

    0.2

      [NEW]
    • Added auto logout when user id or password changes
    • Added initial database
    -

    0.1.1 (2010-11-06)

    +

    0.1.1

      [NEW]
    • Added background image to main activity
    • @@ -848,7 +853,7 @@ [Fixes]
    • Minor fixes on main screen
    -

    0.1 (2010-11-03)

    +

    0.1

      [NEW]
    • First release
    • diff --git a/SWADroid/src/main/res/values-es/strings.xml b/SWADroid/src/main/res/values-es/strings.xml index 264c8194..4ce470e8 100644 --- a/SWADroid/src/main/res/values-es/strings.xml +++ b/SWADroid/src/main/res/values-es/strings.xml @@ -356,4 +356,5 @@ Hora Ubicación no encontrada Punto de acceso inalámbrico más cercano + SWADroid se está ejecutando diff --git a/SWADroid/src/main/res/values/strings.xml b/SWADroid/src/main/res/values/strings.xml index bf66df7a..a33eb3de 100644 --- a/SWADroid/src/main/res/values/strings.xml +++ b/SWADroid/src/main/res/values/strings.xml @@ -372,4 +372,5 @@ Time Location not found Nearest wireless access point + SWADroid is running diff --git a/SWADroid/src/main/res/xml/preferences.xml b/SWADroid/src/main/res/xml/preferences.xml index c3c1b921..f07b56fc 100644 --- a/SWADroid/src/main/res/xml/preferences.xml +++ b/SWADroid/src/main/res/xml/preferences.xml @@ -66,26 +66,6 @@ android:key="sharePref" android:summary="@string/shareBodyMsg" android:title="@string/shareTitle_menu" /> - - - -