Program with widget - android

I want to develop a application with widget. Now i only can find the applicaion in widget but cannot find the application in "all programs"
Thank you
my AndroidMainfest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="test.testing_v1_0" android:versionCode="1"
android:versionName="1.0">
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".MyActivity" android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<receiver android:name=".testing123" android:label="#string/app_name">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:resource="#xml/widget_provider_full"
android:name="android.appwidget.provider">
</meta-data>
</receiver>
<service android:name=".testing123$UpdateService" />
<activity android:name=".MyActivity">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
<meta-data android:resource="#xml/widget_provider_full" android:name="android.appwidget.provider">
</meta-data>
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="7" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
</manifest>

Ok you must have inside your Manifest.xml
<application android:icon="#drawable/icon" android:label="#string/app_name">
<activity android:name=".GrupoReformaNews"
android:label="#string/app_name"
android:screenOrientation="portrait">
this in intent filter for your application
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
this in intent filter for your Widget
<receiver android:name="GR_Widget">
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
...
...
...
</application>
if you still having problems, post your manifest.xml

Related

Android studio unable to recognize default activity after changing it in manifest file

I've an android app where LoginActivity was main activity. I created a SplashScreen activty, then changed AndroidManifest as given below
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.dell.inventoryplay">
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
<application
android:name=".InventoryPlayApp"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true">
<provider
android:name="android.support.v4.content.FileProvider"
android:authorities="com.dell.inventoryplay.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths" />
</provider>
<activity
android:name=".main.SplashActivity"
android:configChanges="orientation|screenSize"
android:exported="false"
android:label="#string/app_name"
android:launchMode="singleTop"
android:theme="#style/DellTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<activity
android:name=".main.MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:exported="false"
android:label="#string/app_name"
android:launchMode="singleTop"
android:theme="#style/DellTheme.NoActionBar"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.SEARCH" />
</intent-filter>
<meta-data
android:name="android.app.searchable"
android:resource="#xml/searchable" />
</activity>
<activity
android:name=".main.LoginActivity"
android:configChanges="orientation|keyboardHidden|screenSize"
android:label="#string/app_name"
android:screenOrientation="portrait"
android:theme="#style/DellThemeFullscreen" />
<receiver
android:name=".alarm.AlarmReceiver"
android:exported="false">
<intent-filter>
<action android:name="android.intent.action.NOTIFY" />
</intent-filter>
</receiver>
<receiver
android:name=".alarm.BootReceiver"
android:enabled="false">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
<service android:name=".AirWatchSDKContextService"/>
<service android:name=".AirWatchSDKIntentService"/>
</application>
</manifest>
When I try to run modified android app, it shows error as given below:
Error running app: Default activity not found.
I've added
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<action android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
to SplashActivity. But it isn't recognizing that as default activity. How can I fix it?
This should be category instead of action so use this
<category android:name="android.intent.category.LAUNCHER"/>
instead of
<action android:name="android.intent.category.LAUNCHER"/>
<activity
android:name=".main.SplashActivity"
android:configChanges="orientation|screenSize"
android:exported="false"
android:label="#string/app_name"
android:launchMode="singleTop"
android:theme="#style/DellTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>

Android signed apk build error : The <service> element must be a direct child of the <application> element

My AndroidManifest.xml :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.amedya.amedyaeu">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="eu.amedya.amedyaeu.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</manifest>
Firebase Cloud Messaging and Android WebView project.
Error:(14) Error: The element must be a direct child of the element [WrongManifestParent]
Thank you in advance for your help.
Thank you for your reply.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.amedya.amedyaeu">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="eu.amedya.amedyaeu.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>
Checkout official doc https://developer.android.com/guide/topics/manifest/manifest-intro.html
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.amedya.amedyaeu">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="eu.amedya.amedyaeu.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
Replace your mentifest file with these :
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.amedya.amedyaeu">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="eu.amedya.amedyaeu.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>
</manifest>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
Put this lines inside your application tag
Happy Coding!!
Put these tag insid your application tag as follows
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="eu.amedya.amedyaeu">
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity
android:name="eu.amedya.amedyaeu.MainActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MesajServisi" >
<intent-filter>
<action
android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".IDServisi" >
<intent-filter>
<action
android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
</application>
</manifest>

receiver tag in the manifest twice

I am trying create app widget according the tutorial on this website http://www.developer.com/ws/android/programming/Creating-a-Home-Screen-App-Widget-on-Android-3833306.htm
but I am confused why there are two almost the same receiver tags in the manifest. Could somebody explain the reason please?
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mamlambo.imageswidget"
android:versionCode="1"
android:versionName="1.0">
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:debuggable="true">
<activity
android:name=".ImagesWidgetConfiguration"
android:label="#string/app_name">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action
android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver
android:name="ImagesWidgetProvider">
<intent-filter>
<action
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
<receiver
android:name="ImagesWidgetProvider">
<intent-filter>
<action
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<data android:scheme="images_widget" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
</application>
<uses-sdk
android:minSdkVersion="3" />
</manifest>
May be your correct codes :
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mamlambo.imageswidget"
android:versionCode="1"
android:versionName="1.0">
<application
android:icon="#drawable/icon"
android:label="#string/app_name"
android:debuggable="true">
<activity
android:name=".ImagesWidgetConfiguration"
android:label="#string/app_name">
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<intent-filter>
<action
android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</activity>
<receiver
android:name="ImagesWidgetProvider">
<intent-filter>
<action
android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<data android:scheme="images_widget" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
</application>
<uses-sdk
android:minSdkVersion="3" />
</manifest>
It will be worked. hopefully

Eclipse showing No launcher Activity found

This is my android Manifest.xml.
<?xml version="1.0" encoding="utf-8"?>
<manifest
xmlns:android="http://schemas.android.com/apk/res/android"
package="uk.co.halfninja.wallpaper.parallax">
<uses-sdk android:minSdkVersion="7" />
<uses-feature android:name="android.software.live_wallpaper" />
<application
android:label="#string/app_name"
android:icon="#drawable/icon">
<service
android:label="#string/app_name"
android:name=".ParallaxWallpaper"
android:permission="android.permission.BIND_WALLPAPER">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
<meta-data android:name="android.service.wallpaper" android:resource="#xml/wallpaper" />
</service>
<activity
android:label="#string/wallpaper_settings"
android:name=".ParallaxWallpaperSettings"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:exported="true">
</activity>
</application>
</manifest>
Still Eclipse showing the result
ParallaxWallpaper] No Launcher activity found!
ParallaxWallpaper] The launch will only sync the application package on the device!
ParallaxWallpaper] Performing sync
ParallaxWallpaper] Automatic Target Mode: Unable to detect device compatibility. Please select a target device.
Please let me Know where am i doing the mistake, and what would be the solution...???
Move the intent-filter tag from service to activity
These lines should be in Activity tag
<application
android:label="#string/app_name"
android:icon="#drawable/icon">
<activity
android:label="#string/wallpaper_settings"
android:name=".ParallaxWallpaperSettings"
android:theme="#android:style/Theme.Black.NoTitleBar" android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:label="#string/app_name"
android:name=".ParallaxWallpaper"
android:permission="android.permission.BIND_WALLPAPER">
</service>
<meta-data android:name="android.service.wallpaper" android:resource="#xml/wallpaper" />
</application>
make activity as launcher you have made service as launcher. like that
<activity
android:label="#string/wallpaper_settings"
android:name=".ParallaxWallpaperSettings"
android:theme="#android:style/Theme.Black.NoTitleBar"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

Android Widget does not show in list untill second run

I am trying to run a widget and i have seen this problem has been discussed in many questions here and every one suggest that a activity should be started so then the app can be shown. I have even started a activity but when i finish the activity , still the widget is not shown.
Here is my manifest . Any help would be appreciated.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.mamlambo.imageswidget"
android:installLocation="internalOnly"
android:versionCode="2"
android:versionName="1.0.2" >
<application
android:debuggable="true"
android:icon="#drawable/icon"
android:label="#string/app_name" >
<receiver android:name=".ImagesWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
<activity
android:name=".ImagesWidgetConfiguration"
android:label="#string/app_name" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name=".Recycle" >
</activity>
<activity android:name=".Search" >
</activity>
<activity android:name=".TabingActivity" >
<intent-filter>
<action android:name="android.intent.action.MEDIA_MOUNTED" />
<data android:scheme="file" />
</intent-filter>
</activity>
<activity android:name=".MainActivity" >
</activity>
<receiver android:name=".ImagesWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_UPDATE" />
<data android:scheme="images_widget" />
</intent-filter>
<meta-data
android:name="android.appwidget.provider"
android:resource="#xml/imageswidget_info" />
</receiver>
<receiver android:name=".ImagesWidgetProvider" >
<intent-filter>
<action android:name="android.appwidget.action.APPWIDGET_CONFIGURE" />
</intent-filter>
</receiver>
<receiver
android:name=".CustomReceiver"
android:enabled="true" >
<intent-filter>
<action android:name="android.intent.action.DELETE" />
</intent-filter>
</receiver>
</application>
<uses-sdk android:minSdkVersion="3" />
</manifest>

Categories

Resources