1

I implemented a simple syncadapter that works fine on a Moto G but on a Nexus 7 it doesn´t (onPerformSync never gets called)

For testing I start the sync manually like this:

Bundle settingsBundle = new Bundle();
        settingsBundle.putBoolean(
                ContentResolver.SYNC_EXTRAS_MANUAL, true);
        settingsBundle.putBoolean(
                ContentResolver.SYNC_EXTRAS_EXPEDITED, true);
    /*
     * Request the sync for the default account, authority, and
     * manual sync settings
     */
     ContentResolver.requestSync(mAccount, DbContract.AUTHORITY, settingsBundle);

and my manifest.xml looks like that:

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.com.jeldrik.teacherslittlehelper" >
<uses-permission android:name="android.permission.CALL_PHONE"/>
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS"/>
<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
<application
    android:allowBackup="true"
    android:icon="@drawable/ic_launcher"
    android:label="@string/app_name"
    android:theme="@style/AppTheme" >
    <activity
        android:name=".MainActivity"
        android:label="@string/app_name" >
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </activity>
    <provider
        android:authorities="app.com.jeldrik.teacherslittlehelper.data"
        android:name="app.com.jeldrik.teacherslittlehelper.data.ClassContentProvider">
        </provider>

    <service
        android:name="app.com.jeldrik.teacherslittlehelper.DataTransfer.AuthenticatorService">
        <intent-filter>
            <action android:name="android.accounts.AccountAuthenticator"/>
        </intent-filter>
        <meta-data
            android:name="android.accounts.AccountAuthenticator"
            android:resource="@xml/authenticator" />
    </service>

    <service
        android:name="app.com.jeldrik.teacherslittlehelper.DataTransfer.SyncService"
        android:exported="true"
        android:process=":sync">
        <intent-filter>
            <action android:name="android.content.SyncAdapter"/>
        </intent-filter>
        <meta-data
            android:name="android.content.SyncAdapter"
            android:resource="@xml/syncadapter" />
    </service>

</application>

1 Answers1

2

Well, stupid error with easy solution: Android was issuing a warning that my tablets memory is almost full. It seems that in this case all syncing is automatically disabled. Deleted some stuff and now syncing works :P

  • Is there a way to give a notification to the user that the system storage is almost full and syncing will not function?? – KJEjava48 Mar 07 '17 at 05:57
  • Perfect!! Removing a few unwanted apps does the trick. However, problem is inevitable. Have you looked for the solution? – SKP Jun 13 '17 at 05:10