diff --git a/SWADroid/AndroidManifest.xml b/SWADroid/AndroidManifest.xml
index d71db84b..143eab6a 100644
--- a/SWADroid/AndroidManifest.xml
+++ b/SWADroid/AndroidManifest.xml
@@ -7,6 +7,9 @@
+
+
+
@@ -126,6 +129,12 @@
android:configChanges="keyboard|keyboardHidden|orientation"
android:label="@string/noticesModuleLabel"
android:theme="@android:style/Theme.Translucent.NoTitleBar" >
+
+
+
Código QR no válido
No existen datos de este alumno
No se ha detectado ningún código QR válido
- Estudiantes presentesn
+ Estudiantes presentes
diff --git a/SWADroid/res/xml/account_preferences.xml b/SWADroid/res/xml/account_preferences.xml
index 75f48c50..b2df6621 100644
--- a/SWADroid/res/xml/account_preferences.xml
+++ b/SWADroid/res/xml/account_preferences.xml
@@ -1,16 +1,16 @@
-
+
\ No newline at end of file
diff --git a/SWADroid/res/xml/authenticator.xml b/SWADroid/res/xml/authenticator.xml
index bd4d7880..ed422892 100644
--- a/SWADroid/res/xml/authenticator.xml
+++ b/SWADroid/res/xml/authenticator.xml
@@ -1,5 +1,6 @@
0) {
//Obtain a reference to the notification service
String ns = Context.NOTIFICATION_SERVICE;
@@ -293,7 +300,7 @@ public class Notifications extends Module {
//Send alert
notManager.notify(NOTIF_ALERT_ID, notif);
}
- }
+ }*/
/* (non-Javadoc)
* @see es.ugr.swad.swadroid.modules.Module#connect()
@@ -314,7 +321,7 @@ public class Notifications extends Module {
refreshScreen();
//Toast.makeText(this, R.string.notificationsDownloadedMsg, Toast.LENGTH_SHORT).show();
- alertNotif();
+ //alertNotif();
ProgressBar pb = (ProgressBar)this.findViewById(R.id.progress_refresh);
ImageButton updateButton = (ImageButton)this.findViewById(R.id.refresh);
diff --git a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java
index 4953d436..5f35ff00 100644
--- a/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java
+++ b/SWADroid/src/es/ugr/swad/swadroid/modules/notifications/NotificationsSyncAdapterService.java
@@ -19,12 +19,35 @@
package es.ugr.swad.swadroid.modules.notifications;
+import java.io.IOException;
+import java.security.MessageDigest;
+import java.security.NoSuchAlgorithmException;
+import java.util.Vector;
+
+import org.ksoap2.SoapEnvelope;
+import org.ksoap2.SoapFault;
+import org.ksoap2.serialization.SoapObject;
+import org.ksoap2.serialization.SoapSerializationEnvelope;
+import org.ksoap2.transport.KeepAliveHttpsTransportSE;
+import org.xmlpull.v1.XmlPullParserException;
+
+import com.android.dataframework.DataFramework;
+
+import es.ugr.swad.swadroid.Base64;
+import es.ugr.swad.swadroid.Global;
+import es.ugr.swad.swadroid.Preferences;
+import es.ugr.swad.swadroid.R;
+import es.ugr.swad.swadroid.model.DataBaseHelper;
+import es.ugr.swad.swadroid.model.SWADNotification;
+
import android.accounts.Account;
import android.accounts.OperationCanceledException;
+import android.app.Notification;
+import android.app.NotificationManager;
+import android.app.PendingIntent;
import android.app.Service;
import android.content.AbstractThreadedSyncAdapter;
import android.content.ContentProviderClient;
-import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.SyncResult;
diff --git a/SWADroid/src/es/ugr/swad/swadroid/sync/AccountAuthenticator.java b/SWADroid/src/es/ugr/swad/swadroid/sync/AccountAuthenticator.java
index 37758365..0050fde8 100644
--- a/SWADroid/src/es/ugr/swad/swadroid/sync/AccountAuthenticator.java
+++ b/SWADroid/src/es/ugr/swad/swadroid/sync/AccountAuthenticator.java
@@ -1,30 +1,46 @@
package es.ugr.swad.swadroid.sync;
import es.ugr.swad.swadroid.Preferences;
+import es.ugr.swad.swadroid.R;
import android.accounts.Account;
import android.accounts.AccountAuthenticatorActivity;
import android.accounts.AccountAuthenticatorResponse;
import android.accounts.AccountManager;
+import android.content.ContentResolver;
import android.os.Bundle;
public class AccountAuthenticator extends AccountAuthenticatorActivity {
+ /**
+ * Account type
+ */
+ private static String accountType = "es.ugr.swad.swadroid";
+ /**
+ * Synchronization authority
+ */
+ private static String authority = "es.ugr.swad.swadroid.content";
+
@Override
protected void onCreate(Bundle icicle) {
super.onCreate(icicle);
Preferences prefs = new Preferences();
prefs.getPreferences(getBaseContext());
- Account account = new Account(prefs.getUserID(), "es.ugr.swad.swadroid");
+ Account account = new Account(getString(R.string.app_name), accountType);
AccountManager am = AccountManager.get(this);
- boolean accountCreated = am.addAccountExplicitly(account, prefs.getUserPassword(), null);
+ boolean accountCreated = am.addAccountExplicitly(account, getString(R.string.app_name), null);
Bundle extras = getIntent().getExtras();
if (extras != null) {
if (accountCreated) { //Pass the new account back to the account manager
AccountAuthenticatorResponse response = extras.getParcelable(AccountManager.KEY_ACCOUNT_AUTHENTICATOR_RESPONSE);
Bundle result = new Bundle();
- result.putString(AccountManager.KEY_ACCOUNT_NAME, prefs.getUserID());
- result.putString(AccountManager.KEY_ACCOUNT_TYPE, "es.ugr.swad.swadroid");
+ result.putString(AccountManager.KEY_ACCOUNT_NAME, account.name);
+ result.putString(AccountManager.KEY_ACCOUNT_TYPE, account.type);
response.onResult(result);
+
+ //Configure automatic synchronization
+ ContentResolver.setIsSyncable(account, authority, 1);
+ ContentResolver.setMasterSyncAutomatically(true);
+ ContentResolver.setSyncAutomatically(account, authority, true);
}
finish();
}