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)
Related
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.
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>
My simple widget application installs and works perfectly when signed as a debug app, but as soon as I try to sign it ready for the market, I experience strange behaviour: it doesn't show up in the widget list until I uninstall the app when it appears as the standard Android 'I don't have this' robot icon.
Attempting to drag this 'missing' widget to a screen results in a Launcher crash.
To investigate this, I added a MAIN/LAUNCH intent to one of the Activities, and that shows up as expected on install and vanishes when I uninstall.
What's super-creepy is that if I re-install, while the Launcher is displaying the 'I don't have this' robot icon, my widget briefly replaces that icon, and then vanishes from the list.
I don't see any error messages or issued intents in the log, beyond the normal 'I'm un/installing this'.
Is there something stupid and obvious I'm missing, like a 'signed apps must register their widgets specially', that isn't necessary under debug mode?
Here're my manifest and widget properties:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:versionCode="1"
package="uk.org.baverstock.appghoul">
<uses-sdk
android:minSdkVersion="4"
android:targetSdkVersion="9"/>
<application android:icon="#drawable/icon" android:label="#string/app_name">
<receiver android:name="uk.org.baverstock.appghoul.AppGhoulWidgetProvider">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/appwidget_provider"/>
</receiver>
<activity android:name=".Configure"
android:excludeFromRecents="true"
>
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE"/>
</intent-filter>
<intent-filter>
<!-- Why does this show up, when the widget doesn't? -->
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity android:name=".ControlsChoiceActivity"
android:theme="#android:style/Theme.Dialog"
android:excludeFromRecents="true"
/>
<activity android:name=".ReconfigureWidget"
android:theme="#android:style/Theme.Dialog"
android:excludeFromRecents="true"
/>
<receiver
android:name=".WidgetRescanner"
android:label="WidgetRescanner"
>
<intent-filter>
<action android:name="android.intent.action.PACKAGE_ADDED"/>
<action android:name="android.intent.action.PACKAGE_CHANGED"/>
<action android:name="android.intent.action.PACKAGE_REPLACED"/>
<action android:name="android.intent.action.PACKAGE_REMOVED"/>
<data android:scheme="package"/>
</intent-filter>
</receiver>
</application>
</manifest>
and the widget properties:
<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider
xmlns:android="http://schemas.android.com/apk/res/android"
android:minWidth="72dp"
android:minHeight="72dp"
android:updatePeriodMillis="86400000"
android:initialLayout="#layout/widget"
android:configure="uk.org.baverstock.appghoul.Configure"
android:previewImage="#drawable/icon"
android:widgetCategory="home_screen">
<!--
android:resizeMode="horizontal|vertical"
android:initialKeyguardLayout="#layout/example_keyguard"
-->
</appwidget-provider>
I thought it might relate to some problem with the release signing key being too long, but various experiments show this happens even with a 2048 key.
It also happens when I use Gradle to build http://javatechig.com/android/app-widgets-example-in-android/ so it doesn't seem to be my code.
I can't think anything I do should be able to crash the launcher after my app is uninstalled, so it seems to me this has to be an Android bug: I've reported it at https://code.google.com/p/android/issues/detail?id=61387
I'm building a time logging application and i have created the main layout.
I tried to debug my application on my phone Samsung Galaxy S and it starts fine, but if i close it and want to run it again it's not in my app drawer. It shows up in Settings->Programs->Manage and in Recent when holding down the home button.
Here is the manifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.doweb.timelog" android:versionCode="1">
<application android:icon="#drawable/icon" android:label="#string/app_name" android:theme="#android:style/Theme.NoTitleBar">
<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">
</category></action></intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="8">
</uses-sdk>
</manifest>
I think your closing </action> tag in the intent-filter is in the wrong position.
Should look like:
<intent-filter>
<action android:name="android.intent.action.MAIN" > </action>
<category android:name="android.intent.category.LAUNCHER"> </category>
</intent-filter>
That filter is a signal to the system that this activity should be visible in the app-drawer. When it's not correct or present, the activity won't be visible.
Usually it's best to use closed empty elements to prevent this error:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
You're also missing a . in front of your activitys class. This always relates to your apps package name. It will internally be joined to packagename + classname. Therefore the dot, otherwise it would result in com.doweb.timelogMainActivity, which is obviously not the correct reference. So it should be android:name=".MainActivity".
your activity's name like this android:name=".MainActivity", you can have a try