oakley 0 Posted May 3, 2022 Hi everyone, I am trying to deploy the crossplatform notification demo on android 12 according to the readme.md file coming along in the same folder as the project file. As soon as I hit the "start service" button, the service is not started and the app closes. I already tried to get some substantial info by starting monitor.bat but without success. Rgds Mirko Share this post Link to post
Dave Nottage 557 Posted May 3, 2022 22 minutes ago, oakley said: I am trying to deploy the crossplatform notification demo on android 12 If you're referring to this demo: https://github.com/Embarcadero/RADStudio11Demos/tree/main/Object Pascal/Multi-Device Samples/Device Sensors and Services/AndroidNotificationServiceDemo There seems to be some missing information in the project file because it does not even add the service to the manifest, and the service jar is not listed under the Libraries node of the Android platform in Project Manager. What I did to rectify this was to: Right-click the Android platform node in Project Manager Click Remove Android Services Select the checkbox next to the service in the list Click Next Click Finish Right-click the Android platform node in Project Manager again Click Add Android Service Click Next Select the path to the service, i.e. AndroidNotificationServiceDemo\NotificationService Click Select Folder Click Next Click Finish Then recompile/deploy/run After you click Start Service, a notification should appear soon after in the system status bar. Opening the notification and tapping on it should open the app and the notification info should appear in the memo Share this post Link to post
oakley 0 Posted May 4, 2022 Hello Dave, thanks for the advice but this is not working for me. The manifest is a good point and I took a look at it. Even after re-adding the service I do not see it in the manifest.xml of the main app. <?xml version="1.0" encoding="utf-8"?> <!-- BEGIN_INCLUDE(manifest) --> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.embarcadero.NotificationApp" android:versionCode="1" android:versionName="1.0.0" android:installLocation="auto"> <uses-sdk android:minSdkVersion="23" android:targetSdkVersion="30" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.CALL_PHONE" /> <uses-permission android:name="android.permission.CAMERA" /> <uses-permission android:name="android.permission.FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.INSTANT_APP_FOREGROUND_SERVICE" /> <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.KILL_BACKGROUND_PROCESSES" /> <uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.SET_WALLPAPER_HINTS" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-feature android:glEsVersion="0x00020000" android:required="true"/> <queries> </queries> <application android:persistent="False" android:restoreAnyVersion="False" android:label="NotificationApp" android:debuggable="true" android:largeHeap="False" android:icon="@drawable/ic_launcher" android:theme="@style/AppTheme" android:hardwareAccelerated="true" android:resizeableActivity="false" android:requestLegacyExternalStorage="true"> <service android:name="com.embarcadero.services.NotificationService" android:exported="false" /> <!-- Our activity is a subclass of the built-in NativeActivity framework class. This will take care of integrating with our NDK code. --> <activity android:name="com.embarcadero.firemonkey.FMXNativeActivity" android:label="NotificationApp" android:configChanges="orientation|keyboard|keyboardHidden|screenSize" android:launchMode="singleTask"> <!-- Tell NativeActivity the name of our .so --> <meta-data android:name="android.app.lib_name" android:value="NotificationApp" /> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> <receiver android:name="com.embarcadero.rtl.notifications.NotificationAlarm" /> </application> </manifest> <!-- END_INCLUDE(manifest) --> Share this post Link to post
Dave Nottage 557 Posted May 4, 2022 10 hours ago, oakley said: <service android:name="com.embarcadero.services.NotificationService" android:exported="false" /> You don't see this part? 😉 Share this post Link to post
oakley 0 Posted May 6, 2022 Oh dear... yes i see it now. I'am sorry. But still, the app closes on starting the service. Share this post Link to post
oakley 0 Posted May 16, 2022 If anyone is having the same issue, here is the solution: https://github.com/DelphiWorlds/HowTo/tree/main/Solutions/AndroidServiceDelphi111 Rgds Mirko Share this post Link to post