Odoo-mobile / framework

Odoo Mobile Framework
https://play.google.com/store/apps/dev?id=8607973775002477408
Other
327 stars 374 forks source link

How application run multiple bound services with same authorities and same account type using Sync Adapter class? #316

Closed 1Androider closed 7 years ago

1Androider commented 7 years ago

I have customized Odoo Android SDK. https://github.com/Odoo-mobile/framework In the sdk only one Customer service is working using Syncadapter. I have implemented messaging service also. but app can not work both service at a time.I can get either messaging data or customers data.

When i run the application it is running only one service at a time. How can i run MessagingSyncService and CustomerSyncService Services at a time ? can any one help me it would be appriciated. thanks in advance

Manifest file


<provider
           android:name="com.odoo.addons.messaging.providers.MessagingSyncProvider"
                android:authorities="${applicationId}.core.provider.content.sync.res_partner"
                android:label="@string/sync_label_messaging"
                android:multiprocess="true" />

        <service
            android:name="com.odoo.addons.messaging.services.MessagingSyncService"
            android:exported="true"
            android:process=":sync_messaging">
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>

            <meta-data
                android:name="android.content.SyncAdapter"
                android:resource="@xml/messaging_sync_adapter" />
        </service>

  <provider
            android:name="com.odoo.addons.customers.providers.CustomersSyncProvider"
            android:authorities="${applicationId}.core.provider.content.sync.res_partner"
            android:label="@string/sync_label_customers"
            android:multiprocess="true" />

        <service
            android:name="com.odoo.addons.customers.services.CustomerSyncService"
            android:exported="true"
            android:process=":sync_customer">
            <intent-filter>
                <action android:name="android.content.SyncAdapter" />
            </intent-filter>
            <meta-data
                android:name="android.content.SyncAdapter"
                android:resource="@xml/customer_sync_adapter" />
        </service>

Layout File


<sync-adapter xmlns:android="http://schemas.android.com/apk/res/android"
    android:accountType="com.odoo.auth"
    android:contentAuthority="com.odoo.core.provider.content.sync.res_partner"
    android:supportsUploading="true"
    android:allowParallelSyncs="true"
    android:userVisible="true" />
adam-nadar commented 7 years ago

@kunjaninextrix http://mobile.odoo.co.in/v2/getting-started/working-with-odoo-mobile/components/base-classes.html#osyncservice-java

check this out... for syncing multiple table back-to-back....

caution:Otherwise, your service will go in infinite loop.....

1Androider commented 7 years ago

thanks sir you have save my time here i stuck again with below error can you please help me to resolve ? https://github.com/Odoo-mobile/framework/issues/318

umang6891 commented 6 years ago

How do I do this for SyncAdapter in Android library?