I have used InputMethodService in my ImageKeyboard app to send Images from keyboard.
I have repeated the same thing with my second app : EmojiKeyboard app to send Emojis from keyboard.
Now, I have to combine both the app with single one. So, I found in manifest as below :
in my EMOJIKEYBOARD app :
<service
android:name=".EmojiKeyboardService"
android:label="#string/app_name"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="#xml/method" />
</service>
The another one is in my IMAGEKEYBOARD app :
<service
android:name=".service.ImageKeyboard"
android:permission="android.permission.BIND_INPUT_METHOD">
<intent-filter>
<action android:name="android.view.InputMethod" />
</intent-filter>
<meta-data
android:name="android.view.im"
android:resource="#xml/method" />
</service>
Now, here #xml/method for first app is like :
<input-method xmlns:android="http://schemas.android.com/apk/res/android" />
and for second is like :
<input-method xmlns:android="http://schemas.android.com/apk/res/android"
android:isDefault="false"
android:settingsActivity="com.myapp.MySettings"></input-method>
Here, it gives me :
Now, I have confused that, How can I switch between this two ?
Any idea ? Because, I have to open two different layouts for keyboard i.e. switching between two services.
Hope for the best solution.Thanks.
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 found several answers on this issue, but it's not working for me. If you click a phone number in an email or on a website, a default dialer popup comes up to select the dialer/skype etc.
I'm trying to get my app in that list - so I don't want to handle the actual call, but open the activity and show the number the user clicked on.
I've tried this:
<receiver android:name=".MyOutgoingCallHandler">
<intent-filter>
<action android:name="android.intent.action.ACTION_DIAL" />
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
But it's not showing in the list. What intent should I filter for?
If you want to add an Activity to the list of Activitys that will be shown to the user as possible phone dialers, you need to have an Activity and the <activity> definition must contain this intent-filter> in the manifest:
<activity ...>
<intent-filter>
<action android:name="android.intent.action.DIAL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
What you've got is a BroadcastReceiver that will receive the outgoing call Intent. That's something different.
The official Android Developers blog has covered this process. You can read all about it there.
Your intent filter looks like it has the correct action, so it may be that you have not requested the correct Android permission.
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
Here is how the Android Developers blog suggest you declare the broadcast receiver.
<manifest>
<uses-permission android:name="android.permission.PROCESS_OUTGOING_CALLS" />
<application>
...
<receiver android:name=MyOutgoingCallHandler">
<intent-filter>
<action android:name="android.intent.action.NEW_OUTGOING_CALL" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</receiver>
...
</application>
</manifest>
I want to add my application to the list of apps Android offers to launch when a digital camera is connected. I've added this to my manifest:
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/device_filter" />
</intent-filter>
And specified a filter (class 6 is digital camera, but I've tried empty filter as well):
<resources>
<usb-device class="6"/>
</resources>
It has no effect, my app is still not in that list. What else do I have to do?
Note that I'm not interested in the broadcast intent, all I need is to make it to the list of choices for handling the device user is presented with.
Found the problem. Manifest should be like this:
<intent-filter>
<action android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED" />
</intent-filter>
<meta-data
android:name="android.hardware.usb.action.USB_DEVICE_ATTACHED"
android:resource="#xml/device_filter" />
I. e. meta-data shouldn't be sub-element of intent-filter like I've put it.
I have two widgets and neither of them will show up in the app drawer. What's weird is that if I remove one from the manifest it won't show up either but I can't see what I am doing wrong. From all the other questions I searched it looks right. The app is not being installed on the SD card.
Anyone have any ideas?
AndroidManifest.xml
<receiver
android:name=".appwidgets.WidgetLarge"
android:label="#string/Widget_large"
android:icon="#drawable/icon" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<intent-filter>
<action android:name="com.groggs.action.CACHE_UPDATE_FINISHED" />
</intent-filter>
<intent-filter>
<action android:name="WIDGET_UPDATE" />
<data android:scheme="content" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_large_info" />
</receiver>
<receiver
android:name=".appwidgets.WidgetSmall"
android:label="#string/Widget_small"
android:icon="#drawable/icon" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<intent-filter>
<action android:name="com.groggs.action.CACHE_UPDATE_FINISHED" />
</intent-filter>
<intent-filter>
<action android:name="WIDGET_UPDATE" />
<data android:scheme="content" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/widget_small_info" />
</receiver>
widget_large_info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:maxWidth="450dp"
android:maxHeight="352dp"
android:updatePeriodMillis="0"
android:initialLayout="#layout/widget_layout_large"
android:configure="com.groggs.appwidgets.config.HubQuickViewWidgetConfig" >
</appwidget-provider>
widget_small_info.xml
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
android:maxWidth="450dp"
android:maxHeight="82dp"
android:updatePeriodMillis="0"
android:initialLayout="#layout/widget_layout_small"
android:configure="com.groggs.appwidgets.config.HubQuickViewWidgetConfig" >
</appwidget-provider>
Add "minHeight" and "minWidth" attributes to your appwidget-provider elements for each of your appwidgets and see if this does the trick for you.
If you check logcat when running it in the emulator, you should notice the launcher outputting a message about invalid dimensions and the name of your widget will be attached to this line.
I just had this issue and this is how I solved it (although I had one min and on max provided on accident). The logcat message said I had a dimension of (108, 0). This lead me into looking at all my dimensions since it was yelling at me for height being 0.
This was my post:
App Widget not displaying in ICS app drawer
If your app is only an appwidget, with no activities besides a configuration one, you need a dummy main activity to make your appwidget appear in the drawer.
See the original issue in Google Code: http://code.google.com/p/android/issues/detail?id=24208, this answer: Android 4.0: widgets not appearing? and also this interesting thread in Android Devs Google Group: https://groups.google.com/forum/?fromgroups#!topic/android-developers/bvlk3EOV6Xk (it's about Honeycomb, but applies to Android versions 3.x and greater)