So, I trying to implement synchronization based on SyncAdapter of my content provider and server. Seems everything created and initializated well and I can see my account in Accounts&Sync and also see checkbox for sync my content provider.
But I got strange error in LogCat:
ERROR/AccountSettings(130): Provider needs a label for authority 'com.opussync.model.db.opuscontentprovider'
But I has set that label in manifest for sure!
And that's why I think when I try to check sync checkbox in Data&Synchronization of my account I get a message:
Sync is currently experiencing problems. It will be back shortly
Here is main parts of my manifest:
<!-- CONTENT PROVIDER -->
<provider
android:name=".model.db.OpusContentProvider"
android:label="BLABLABLA"
android:authorities=".model.db.opuscontentprovider"
></provider>
<!-- SERVICES -->
<service android:name=".service.OpusAccountsSyncService" android:exported="true" android:process=":zencoosync">
<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=".model.syncadapter.SyncService"
android:exported="true"
android:syncable="true"
>
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter" />
</service>
Package name is not automatically added to android:authorities.
So, either
change android:authorities=".model.db.opuscontentprovider" to android:authorities="com.opussync.model.db.opuscontentprovider" or
use content://.model.db.opuscontentprovider as the base URL for content provider in code.
Related
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
<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>
Sync_adater.xml
<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" />
The goal
I'm working on application that keeps own contacts in contacts database. I want to add my own field with my logo that leads to my application's edit form.
What I did already
Working with this tutorial: http://www.c99.org/2010/01/23/writing-an-android-sync-provider-part-2/
and a couple of other sources i have assembled something like this:
AndroidMainifest.xml:
<service android:enabled="true" android:exported="true" android:name="com.MySyncAdapterService" android:process=":contacts">
<intent-filter android:icon="#drawable/icon">
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data android:name="android.provider.CONTACTS_STRUCTURE" android:resource="#xml/contacts" />
<meta-data android:name="android.content.SyncAdapter" android:resource="#xml/sync_contacts" />
</service>
Contacts.xml:
<ContactsAccountType xmlns:android="http://schemas.android.com/apk/res/android">
<ContactsDataKind
android:icon="#drawable/icon"
android:smallIcon="#drawable/icon"
android:mimeType="vnd.android.cursor.item/vnd.my.contact"
android:summaryColumn="data2"
android:detailColumn="data3"
android:detailSocialSummary="true" >
</ContactsDataKind>
</ContactsAccountType>
The problem
As can be seen on first image my custom field is displayed with icon properly in Android 4.3. Unfortunatetly Android 6.0.1 does display my field but without the icon.
Any help will be appreciated, I'm running out of hair on my head ;)
I think i resolved my problem. Android 6.0 seems to ignore ContactsDataKind icon property. In order to provide icon for custom field you need to provide action hadndling it. It will use intent filter's icon if it's provided. If not it will use your application's icon.
<activity android:name=".ContactActivity">
<intent-filter android:icon="#drawable/icon">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="vnd.android.cursor.item/vnd.my.contact" />
</intent-filter>
</activity>
I've got an application that has two search suggestion providers that both extend SearchRecentSuggestionsProvider, and I've set it up correctly in the manifest file with the following Intent filter and meta-data:
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable_tv" />
The searcable resource includes android:includeInGlobalSearch="true", so that should be fine.
And I've obviously got a provider there as well:
<provider
android:name="com.miz.contentprovider.TvShowContentProvider"
android:authorities="com.miz.contentprovider.TvShowContentProvider"
android:exported="true" />
This all worked just fine in Android 4.3 using the Google search application, but I've just updated all my devices to Android 4.4 and I am no longer able to search content within my application. Same thing goes for other applications that worked before the OS update, i.e. Google Play Music.
I've found a thread on XDA developers that mentions this as well, if it helps: http://forum.xda-developers.com/showthread.php?p=47472102
Does anyone have any idea what's happening or how it can be fixed?
Update: I can confirm that it only occurs on devices with Android 4.4. I've tested on an Android 4.3 device using the latest Google Search update, and it works as expected. Looks like it's a bug in Google's update.
I found this commit in AOSP, which might be related:
https://android.googlesource.com/platform/packages/apps/QuickSearchBox/+/ecf356c15143ab0583c64682de16d94a57f7dd1c
The commit message tells us that this feature was removed due to performance reasons (which might or might not be true, given that it references an internal ticket id and I didn't find a related issue about this on the official bugtracker).
I checked with contacts at Google, and App Indexing is replacing this. The documentation will be updated to show this as deprecated, and there is no way to get this feature to work on Kit Kat without system level permissions (as iDev showed above).
Google Chrome appears now as a searchable app since its last update (v31).
System Application:
Have try like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.android.globalsearch" android:sharedUserId="android.uid.shared">
<uses-permission android:name="android.permission.GLOBAL_SEARCH" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.SET_PREFERRED_APPLICATIONS" />
<application android:label="#string/global_search" android:process="android.process.acore">
<activity android:name=".GlobalSearch" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" android:stateNotNeeded="true" android:theme="#android:style/Theme.NoDisplay" android:excludeFromRecents="true">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<!-- This must be higher than the default priority (0), which
is what GoogleSearch uses. -->
<intent-filter android:priority="500">
<action android:name="android.search.action.GLOBAL_SEARCH" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data android:name="android.app.searchable" android:resource="#xml/searchable" />
</activity>
<activity android:name=".SearchSettings" android:label="#string/search_settings">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
</intent-filter>
<intent-filter>
<action android:name="android.search.action.SEARCH_SETTINGS" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<provider android:name=".SuggestionProvider" android:authorities="com.android.globalsearch.SuggestionProvider" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<provider android:name=".StatsProvider" android:authorities="com.android.globalsearch.stats" android:permission="android.permission.GLOBAL_SEARCH_CONTROL" />
<meta-data android:name="android.app.default_searchable" android:value=".GlobalSearch" />
</application>
</manifest>
i want to add the MiniMob Ads in my android application. I have read the full documentation from the http://www.minimob.com/integration-guide.html for minimob sdk, but i still dont get it.
Now i have two queries:
We have to give the app url either of the android market or some other when we create new app using the MiniMob sdk. So how can we give that url like 1st upload the app without that minimob integration and get the url of the app and then again upload with the minimob integration.
And the 2nd thing is we have to just give that app id, app key and package name in the manifest and add the jar file in lib. and rest some code which i shown below in that activity where we want to show these Ads. Am i wright ??
<!-- MiniMob Manifest declaration start -->
<activity android:exported="false"
android:name="com.minimob.android.OptinActivity"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent" />
<activity
android:taskAffinity=""
android:name="com.minimob.android.PushAds"
android:configChanges="orientation|keyboardHidden"
android:theme="\#android:style/Theme.Translucent.NoTitleBar"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="com.minimob.android.DeliveryReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.MessageReceiver"
android:exported="false"/>
<receiver android:name="com.minimob.android.BootReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<category android:name="android.intent.category.HOME" />
</intent-filter>
</receiver>
<meta-data android:name="MINIMOB_APPID" android:value="id:$appid" />
<meta-data android:name="MINIMOB_APPKEY" android:value="key:$appkey" />
<meta-data android:name="MINIMOB_APPHOST"
android:value="http://mpm.minimob.com/mobile/serve.asp" />
<meta-data
android:name="MINIMOB_ACTION" android:value="com.minimob.android.PushService$appid" />
<service android:name="com.minimob.android.PushService" android:exported="false">
<intent-filter>
<action android:name="com.minimob.android.PushService$appid" />
</intent-filter>
</service>
<!-- MiniMob Manifest declaration end -->
Regarding the app URL, it is there so we can have access to an app for a number of reasons (e.g. troubleshooting). If your app is not publicly available yet you can temporarily enter a random URL and update with the correct URL later when the app has been accepted in Google Play or another app store.
About your second query, please do the things below everytime you want to integrate the Minimob SDK in an app, as it is custom built for each app and instructions will slightly differ.
Go to the Applications page in Minimob and register your app
Click on the "Download SDK" button next to your app
Open the "Instructions.txt" file
The steps are pretty much the ones you have mentioned (copy the .jar file, copy-paste the permissions and declarations in the manifest, add call in your main activity that starts the Minimob SDK).
When I change the namespace of my widget provider, the widget goes blank and doesn't work until I delete it and add it again.
How would one change the namespace and the receiver name for a widget without breaking already placed widgets.
Before rename:
<receiver android:name="com.creativitality.labs.timezoneswidget.WidgetProvider" android:label="#string/widget" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_info_large" />
</receiver>
After moving and renaming provider:
<receiver android:name="com.creativitality.labs.timezoneswidget.widget.WidgetLarge" android:label="#string/widget_4x1" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_info_large" />
</receiver>
For activities, you can create an <activity-alias> element in your manifest that points to the new name of the <activity>.
There is no solution for receivers. <receiver-alias> does not exist. Your receiver must keep its original name forever or it will break.