Flutter Android: Using Multiple ZygotePreloads in a single Android Project - android

I was writing a Flutter Plugin that implements a ZygotePreload so under the plugin sources, I already declared this class
#TargetApi(Build.VERSION_CODES.Q)
public class AppZygote implements android.app.ZygotePreload {
#Override
public void doPreload(#NonNull ApplicationInfo appInfo) {
System.loadLibrary("myjnilibrary");
}
}
and on the plugin's AndroidManifest.xml under the android directory
<manifest
package="..."
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" >
<application
android:allowBackup="false"
android:zygotePreloadName="my.plugin.package_id.AppZygote"
tools:ignore="AllowBackup"
tools:targetApi="q">
</application>
</manifest>
I had successfully integrated it on a normal Flutter project.
And then when I tried to integrate into an existing Flutter project that already uses it's own ZygotePreload implementation on it's Manifest where it looks like this
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="...">
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="28" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<!-- Notice the existing android:zygotePreloadName -->
<application
android:label="..."
android:icon="#mipmap/ic_launcher"
android:allowBackup="false"
android:fullBackupContent="false"
android:requestLegacyExternalStorage="true"
android:supportsRtl="true"
android:zygotePreloadName=".AppZygotePreload"
tools:targetApi="q"
<activity
android:name=".MainActivity"
android:launchMode="singleTask"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:exported="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
<!-- This is the service I'm going to import from my plugin -->
<service
android:name="my.plugin.package_id.RemoteService"
android:isolatedProcess="true"
android:useAppZygote="true" />
<!-- This is the service declared on the app's project itself -->
<service
android:name=".IsolatedService"
android:exported="false"
android:isolatedProcess="true"
android:useAppZygote="true" />
</application>
</manifest>
Building the project caused this Gradle error.
> Manifest merger failed : Attribute application#zygotePreloadName value=(.AppZygotePreload) from AndroidManifest.xml:24:9-54
is also present at [:my_plugin] AndroidManifest.xml:13:9-73 value=(my.plugin.package.AppZygote).
Suggestion: add 'tools:replace="android:zygotePreloadName"' to <application> element at AndroidManifest.xml:17:5-76:19 to override.
It seems like if I do use tools:replace statement, that means I'll ignore the existing ZygotePreload provided by my plugin instead. Is that how it works?
So the question is, is it possible to use more than one android:zygotePreloadName on a single Android App Project, specifically the ones that use Flutter and it's plugins?
Or do I have to make a way around by implementing the codes on the plugin into the app's existing code base and mix it in somehow, or vice versa, by moving the app's implementation into my plugin instead?
Additional Info:
I was using Flutter v2.10.3 stable and NDK version of 25.0.8775105, targeting Android SDK level 32.

Related

App database is not deleted on app uninstall Flutter

In my app I just realized that on Android Sembast db is not deleted when I uninstall the app, on iOS it does get deleted.
Looking at other answers here I saw that in order to prevent Android backup there is the flag android:allowBackup="false" to be set in AndroidManifest.xml. So I did for the Manifest in android/main/app. Nothing changed. Upon app uninstall and reinstall db is still there.
As my phone uses Android 7.0 API 24 I guess this flag will have affect on next installs, but I'll have to remove db manually. this time.
Did I add this flag correctly?
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.vinny.fixit_cloud_biking">
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<application
android:name="io.flutter.app.FlutterApplication"
android:label="fixit"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize"
android:allowBackup="false">
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationReceiver" />
<receiver android:name="com.dexterous.flutterlocalnotifications.ScheduledNotificationBootReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED"/>
<action android:name="android.intent.action.MY_PACKAGE_REPLACED"/>
</intent-filter>
</receiver>
<!-- Don't delete the meta-data below.
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java -->
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
I tried to look for the db folder in the phone directory Android/data/com.vinny.fixit_cloud_biking/files but there is only a Pictures folder. Where do I get to delete the old db? this is the path declared in the singleton final dbPath = join(appDocumentDir.path, 'device.db');
Try to add android:allowBackup="false" at the <application> level not the <activity> level
<application
android:name="io.flutter.app.FlutterApplication"
android:allowBackup="false"
try this
add this on the manifest tag
xmlns:tools="http://schemas.android.com/tools"<br>
tools:replace="allowBackup"<br>
android:allowBackup="false"<br>
<?xml version='1.0' encoding='utf-8'?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
tools:replace="allowBackup"
android:allowBackup="false"/>
Also can add
android:allowBackup="false" (on application tag)

why flutter has android.permission.REQUEST_INSTALL_PACKAGES

i upload my bundle to google play and show me this permissions which contain
android.permission.REQUEST_INSTALL_PACKAGES
and this is my AndroidManifest file content:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.flutter.application">
<!-- The INTERNET permission is required for development. Specifically,
flutter needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET"/>
<!-- io.flutter.app.FlutterApplication is an android.app.Application that
calls FlutterMain.startInitialization(this); in its onCreate method.
In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. -->
<application
android:name="io.flutter.app.FlutterApplication"
android:label="flutter"
android:icon="#mipmap/ic_launcher">
<activity
android:name=".MainActivity"
android:launchMode="singleTop"
android:theme="#style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<!-- This keeps the window background of the activity showing
until Flutter renders its first frame. It can be removed if
there is no splash screen (such as the default splash screen
defined in #style/LaunchTheme). -->
<meta-data
android:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
android:value="true" />
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
<intent-filter>
<action android:name="FLUTTER_NOTIFICATION_CLICK" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<activity
android:name="com.yalantis.ucrop.UCropActivity"
android:screenOrientation="portrait"
android:theme="#style/Theme.AppCompat.Light.NoActionBar"/>
</application>
what is this permission and how i can handle it or remove it from my package
and when i install my app on phone this permission not show?
ok i found why android.permission.REQUEST_INSTALL_PACKAGES permission added to package
this is because file_open package has this permission
and it added to project automatically
As like the answers above it could have been requested by many packages. It can be made to be removed from the final manifest.xml by add these in the Androidmanifest.xml
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" //Add this line
package="com.example.app">
<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" tools:node="remove"/> //Add this line
The tools:node='remove' will remove the permission from final manifest.xml
This technique can be used to remove other permissions also.
You could check the build/app/outputs/logs/manifest-merger-release-report.txt file. This is generated after you make a release build.
This file contains all information on how the final AndroidManifest.xml is created and where permissions might come from.
In my case, it came from open_file package.
I came across the same issue. In my case, it was because of the pakage open_file after going through many online threads about the same topic.
I used the open_file_safe package to resolve the issue.
open_file_safe is same as open_file, but .apk file type is not
supported. Thus, android.permission.REQUEST_INSTALL_PACKAGES
permission is removed.

Issue with AndroidManifest.xml in Android Studio 3.0 [duplicate]

This question already has answers here:
AAPT2 error: check logs for details: unknown element <action> found
(2 answers)
Closed 5 years ago.
I recently installed Android Studio 3.0 from the Canary channel. However, loading my old projects, this keeps on popping up in the AndroidManifest.xml file that's automatically generated depending on the build variant:
Error:(49) unknown element <uses-sdk> found
This also is displayed:
Error:/home/computername/AndroidStudioProjects/applicationname/app/build/intermediates/manifests/full/release/AndroidManifest.xml:49 unknown element <uses-sdk> found
Needless to say, this wasn't an issue in Android Studio 2.3. Any ideas on how to solve this? I've read a handful of similar issues here but none solved my problem. By the way - it doesn't matter if I set the build variant to debug or release, it says the same thing. Also, the "R" class doesn't work, and if I hover over the manifest xmlns:android="http://schemas.android.com/apk/res/android declaration, it says "URI is not registered".
Again, the project structure hasn't changed at all, I've only upgraded to Android Studio 3.0.
Thanks!
Here's the AndroidManifest.xml file that is under the /src/main folder, which works perfectly fine. The problem is with the generated AndroidManifest.xml files in the /app/build/intermediates/manifests/full folder - THESE are the ones that break my app.
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname">`
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme">
<activity android:name=".view.MainActivity"
android:noHistory="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".view.TabbedActivity"
android:label="#string/app_name"
android:theme="#style/AppTheme.NoActionBar"
android:screenOrientation="landscape"
android:configChanges="keyboardHidden|orientation|screenSize"
android:noHistory="true">
</activity>
</application>
<!-- PROTECTION_NORMAL permissions, automatically granted -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- DANGEROUS PERMISSIONS, must request -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
Here's the way the debug or release auto-generated Manifests that don't work look like:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname"
android:versionCode="1"
android:versionName="1.0" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="25" />
<!-- PROTECTION_NORMAL permissions, automatically granted -->
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<!-- DANGEROUS PERMISSIONS, must request -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<meta-data
android:name="android.support.VERSION"
android:value="25.3.1" />
<application
android:allowBackup="true"
android:debuggable="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:supportsRtl="true"
android:theme="#style/AppTheme" >
<activity
android:name="com.domain.appname.view.MainActivity"
android:noHistory="true" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name="com.domain.appname.view.TabbedActivity"
android:configChanges="keyboardHidden|orientation|screenSize"
android:label="#string/app_name"
android:noHistory="true"
android:screenOrientation="landscape"
android:theme="#style/AppTheme.NoActionBar" >
</activity>
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="25" />
</application>
</manifest>
Later edit
I've went back to Android Studio 2.3, and set the gradle plugin back to 2.3.2, and here's how the automatically generated AndroidManifest.xml looks like now:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.domain.appname.test" >
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="26" />
<instrumentation
android:name="android.support.test.runner.AndroidJUnitRunner"
android:functionalTest="false"
android:handleProfiling="false"
android:label="Tests for com.domain.appname"
android:targetPackage="com.domain.appname" />
<application>
<uses-library android:name="android.test.runner" />
</application>
</manifest>
Now everything works as usual, however, note the difference between the automatically generated Manifest file under gradle 3.0.0 and the one under gradle 2.3.2
I guess I'll have to wait until someone finds a solution to make this work under gradle 3.0.0 and in the meantime use the gradle plugin 2.3.2 in Android Studio 3.0 (which I'm doing right now and it works).
So the issue is with the new gradle 3.0.0-alpha9
You probably have a dependency library (aar) that has a <uses-sdk> inside the application tag in the manifest. So when that gets merged, your app will have the incorrect usage also.
This happened to me with an old local build of vlc for Android.
I had a category element in my Manifest file inside a regular activity which was causing build failure. removing it after updating to as3-rc1 and build tool 26+ my issue was resolved. Hope this helps someone.
<activity
android:name=".AboutUsActivity"
android:label="#string/title_activity_about_us"
android:parentActivityName=".MainActivity"
android:theme="#style/AppTheme.NoActionBar">
<category android:name="android.intent.category.DEFAULT" />
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.MainActivity" />
</activity>
if problem remains, please check this official tutorial on migrate to Gragle plugin v. 3.0.0.
Got the same error, in my case there was typo in meta_data instead of meta-data in the Manifest file preventing a build.

Android Wear: Watch face companion configuration activity issue when changing package name

I'm developing an Android Wear watch face along with its mobile companion configuration activity.
As a start I followed the documentation (https://developer.android.com/training/wearables/watch-faces/configuration.html#CompanionActivity) and used the available examples from Google (https://developer.android.com/samples/WatchFace/index.html), specifically the FitDistanceService.
If I use the actual code from the example it all works. The small gear icon - used to open the companion (phone) configuration activity - shows up in the Android Wear app on the phone and I can open the companion phone config activity by tapping on it.
But if I rename the package name from the default "com.example.android.wearable.watchface" to anything else (even to com.example.android.wearable.mycompany) the gear icon disappears from the Android Wear app on the phone and it becomes impossible to open the configuration activity.
I tried changing the package name in any possible way. I've tried using the Move, Copy, Rename functionalities in Android Studio (v. 2.2.3). I've tried to manually change the package name and all its occurrencies in all of the project files using Sublime Text, also renaming the related folders and changing any occurrence of the package name in the manifest.xml of wear and mobile apps.
After the renaming (moving, copying etc.) it all works perfectly. Not a warning, nothing. The watch face behaves as expected, but the gear icon simply disappears.
This is the MOBILE manifest.xml:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.android.wearable.watchface" >
<uses-sdk android:minSdkVersion="18"
android:targetSdkVersion="23" />
<!-- Permissions required by the wearable app -->
<uses-permission android:name="android.permission.WAKE_LOCK" />
<!-- Location permission used by FitDistanceWatchFaceService -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<!-- All intent-filters for config actions must include the categories
com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION and
android.intent.category.DEFAULT. -->
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name"
android:theme="#style/AppTheme" >
<!-- This activity is needed to allow the user to authorize Google Fit for the Fit Distance
WatchFace (required to view distance). -->
<activity
android:name=".ConfigActivity"
android:label="#string/app_name">
<intent-filter>
<action android:name="com.example.android.wearable.watchface.CONFIG_FIT_DISTANCE" />
<category android:name="com.google.android.wearable.watchface.category.COMPANION_CONFIGURATION" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version" />
</application>
</manifest>
And this is the WEARABLE one:
<?xml version="1.0" encoding="utf-8"?>
<manifest package="com.example.android.wearable.watchface"
xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="21"
android:targetSdkVersion="23"/>
<uses-feature android:name="android.hardware.type.watch"/>
<!-- Required to act as a custom watch face. -->
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<!-- Required for complications to receive complication data and open the provider chooser. -->
<uses-permission android:name="com.google.android.wearable.permission.RECEIVE_COMPLICATION_DATA"/>
<!-- Location permission used by FitDistanceWatchFaceService -->
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.BODY_SENSORS"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
<uses-permission android:name="android.permission.READ_PHONE_STATE"/>
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
<application
android:allowBackup="true"
android:icon="#drawable/ic_launcher"
android:label="#string/app_name">
<meta-data
android:name="com.google.android.gms.version"
android:value="#integer/google_play_services_version"/>
<uses-library
android:name="com.google.android.wearable"
android:required="false"/>
<activity android:name="android.support.wearable.complications.ComplicationHelperActivity"/>
<!--
All intent-filters for config actions must include the categories
com.google.android.wearable.watchface.category.WEARABLE_CONFIGURATION
and android.intent.category.DEFAULT.
-->
<service
android:name=".FitDistanceWatchFaceService"
android:label="#string/fit_distance_name"
android:permission="android.permission.BIND_WALLPAPER">
<meta-data
android:name="android.service.wallpaper"
android:resource="#xml/watch_face"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview"
android:resource="#drawable/preview_distance"/>
<meta-data
android:name="com.google.android.wearable.watchface.preview_circular"
android:resource="#drawable/preview_distance_circular"/>
<meta-data
android:name="com.google.android.wearable.watchface.companionConfigurationAction"
android:value="com.example.android.wearable.watchface.CONFIG_FIT_DISTANCE"/>
<intent-filter>
<action android:name="android.service.wallpaper.WallpaperService"/>
<category android:name="com.google.android.wearable.watchface.category.WATCH_FACE"/>
</intent-filter>
</service>
<activity
android:name=".FitDistanceWatchFacePermissionActivity"
android:label="#string/title_activity_fitdistance_watch_face_permission">
</activity>
<activity
android:name=".BodysensorsWatchFacePermissionActivity"
android:label="#string/title_activity_bodysensors_watch_face_permission">
</activity>
</application>
</manifest>
They both work perfectly, if you don't try to rename the package from "com.example.android.wearable.watchface" to something else.
Any clues? Of course I could go on with the "com.example.android.wearable.watchface" package name, but it seems implausible that it's not possible to change the package name.
Thank you!

Android Manifest: no default activity?

From an open source project I got this manifest file
<?xml version="1.0" encoding="utf-8"?>
<uses-sdk
android:minSdkVersion="14"
android:targetSdkVersion="20" />
<uses-permission android:name="android.permission.AUTHENTICATE_ACCOUNTS" />
<uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.GET_ACCOUNTS" />
<uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS" />
<application
android:allowBackup="true"
android:icon="#drawable/icon"
android:label="#string/app_name"
android:theme="#style/AppTheme">
<service
android:name="org.gege.caldavsyncadapter.syncadapter.SyncService"
android:exported="true">
<intent-filter>
<action android:name="android.content.SyncAdapter" />
</intent-filter>
<meta-data
android:name="android.content.SyncAdapter"
android:resource="#xml/syncadapter" />
</service>
<service
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticationService"
android:exported="true">
<intent-filter>
<action android:name="android.accounts.AccountAuthenticator" />
</intent-filter>
<meta-data
android:name="android.accounts.AccountAuthenticator"
android:resource="#xml/authenticator" />
</service>
<activity
android:name="org.gege.caldavsyncadapter.authenticator.AuthenticatorActivity"
android:label="#string/title_activity_authenticator"
android:windowSoftInputMode="adjustResize|stateVisible"/>
</application>
I am a bit puzzled about that manifest. It has two services and one activity. The activity is not marked as default activity. When I run the project on my phone it doesn't show any icon to start the app neither does the app start automatically.
Does a manifest like this make sense? What does the Android OS based on such a manifest?
Does a manifest like this make sense?
Yes, since it declares a sync adapter an an authenticator.
Generally, such manifests would also make sense in a library project. The app project that uses the library then provides the main launcher activity. The build process merges manifest files together so you get one manifest per APK.
What does the Android OS based on such a manifest?
As such, it has the entry points such as an activity and two services declared. Generally you invoke these entry points via an Intent. The services are declared as a sync adapter and an authenticator, so they can be invoked by the framework. The activity is probably invoked by the authenticator service for UI purposes.
Because there's no main launcher activity, no menu icon is visible.

Categories

Resources