Android Two Libraries with Sync Adapters only one called -
i'm puzzled one. think issue stems library applications manifests merging.
i have 2 sync adapters, 2 different libraries. keep playing code, can either first or second sync adapter work.
case one, template files named same, libone's sync adapter launched. rename xml file referenced in android:resource="@xml/filenamehere" both files unique , not default. result, libtwo's sync activated? that's odd.
my solution make third sync adapter in actual application , handle both of these adapters in 1 file, hate not understanding why happened. note changed package names libone libtwo.
these libraries same university, part of same project same author. difference path names, adapters name, authority , account type. literal copy , paste mirror images. have tried making these items same, no change. thing thats made difference cant seem control renaming files. tried changing allow parallel flag. i'm guessing os doesn't launching of dual adapters.
i looking @ logcat, have notification create services annoying appear in logcat of different thread app.
how launch services
if(!ismyservicerunning(libone.data_sync.syncservice.class, context)){ android.util.log.d(tag, "starting service confirmtrips...."); intent intent = new intent(context, libone.syncservice.class); context.startservice(intent); } if(!ismyservicerunning(libtwo.smap.syncservice.class, context)){ android.util.log.d(tag, "starting service sendtripdata...."); intent intent = new intent(context, libtwo.smap.syncservice.class); context.startservice(intent); } contentresolver.setissyncable(maccount, libtwo_authority, 1); contentresolver.setsyncautomatically(maccount, libtwo_authority, true); contentresolver.addperiodicsync(maccount, libtwo_authority, new bundle(), sync_interval); contentresolver.setissyncable(maccount, libone_authority, 1); contentresolver.setsyncautomatically(maccount, libone_authority, true); contentresolver.addperiodicsync(maccount, libone_authority, new bundle(), sync_interval);
files service
<service android:name="libone.data_sync.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/libonesyncadapter" /> </service> <provider android:name="libone.data_sync.stubcontentprovider" android:authorities="libone.provider" android:exported="false" android:syncable="true" /> <?xml version="1.0" encoding="utf-8"?> <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" android:accounttype="accounttypeone.org" android:icon="@drawable/ic_launcher" android:smallicon="@drawable/ic_launcher" android:label="@string/app_name"/> <?xml version="1.0" encoding="utf-8"?> // adapter <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" android:contentauthority="libone.provider" android:accounttype="liboneaccounttype" android:uservisible="false" android:supportsuploading="true" android:allowparallelsyncs="false" android:isalwayssyncable="true"/> ////libtwo <service android:name="libtwo.smap.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/libtwosyncadapter" /> </service> <provider android:name="libtwo.smap.stubcontentprovider" android:authorities="libtwo.provider" android:exported="false" android:syncable="true"/> <?xml version="1.0" encoding="utf-8"?> <account-authenticator xmlns:android="http://schemas.android.com/apk/res/android" android:accounttype="accounttypetwo.org" android:icon="@drawable/ic_launcher" android:smallicon="@drawable/ic_launcher" android:label="@string/app_name"/> <?xml version="1.0" encoding="utf-8"?> <sync-adapter xmlns:android="http://schemas.android.com/apk/res/android" android:contentauthority="libtwo.provider" android:accounttype="libtwo.org" android:uservisible="false" android:supportsuploading="true" android:allowparallelsyncs="false" android:isalwayssyncable="true"/>
logcat
08-16 14:37:48.458 1535-956/? d/[wingtip_noti]parsealgorithm﹕ piece=syncing libtwoadapter aug 16, 2015 2:37:48 pm id:16908415 name:text 08-16 14:37:48.458 1535-956/? d/[wingtip_noti]parsealgorithm﹕ body : syncing libtwoadapter aug 16, 2015 2:37:48 pm 08-16 14:37:48.458 1535-956/? d/[wingtip_noti]parsealgorithm﹕ line 2 = syncing libtwoadapter cfc aug 16, 2015 2:37:48 pm 08-16 14:37:48.458 1535-956/? d/[wingtip_noti]wingtipnotificationlistenerservice﹕ line 1 = study, line2 = syncing libtwoadapter aug 16, 2015 2:37:48 pm 08-16 14:37:48.488 1535-1535/? i/[wingtip_noti]notificationadapter﹕ notificaiton onreceived 08-16 14:37:48.498 1535-1535/? i/[wingtip_noti]notificationadapter﹕ servicepackages.action_notification_received 08-16 14:37:48.498 1535-1535/? i/[wingtip_noti]notificationadapter﹕ index : 10202 packagename : time : 1439757468418 title : study textmessage : syncing libtwoadapter aug 16, 2015 2:37:48 pm addresstext : isvibrate : false 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ transfer() 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ ================================================================= 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ message id : 10202 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ package name : 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ sender : study 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ address : 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ title : 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ body : syncing libtwoadapter aug 16, 2015 2:37:48 pm 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ message time : 1439757468418 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ isvibrate : false 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ ================================================================= 08-16 14:37:48.498 1535-1535/? v/[wingtip_noti]notificationadapter﹕ disable notification generalnotification packagenamae :
i had accounttype set x first library , second accounttype y. matches nightmare i've had getting security exception when trying or create explicitly account. generate accounts 1 of libraries, error calling missmatched id.
my bigger issue, didn't change account type in 1 of fields when tried make uniform.
Comments
Post a Comment