Example #1
0
        public override void AppendBuildRequirements(AN_AndroidBuildRequirements buildRequirements)
        {
            var AlarmNotificationService = new AMM_PropertyTemplate("service");

            AlarmNotificationService.SetValue("android:name", "com.stansassets.android.app.notifications.AN_AlarmNotificationService");
            AlarmNotificationService.SetValue("android:process", ":externalProcess");
            buildRequirements.AddApplicationProperty(AlarmNotificationService);


            var LocalNotificationReceiver = new AMM_PropertyTemplate("receiver");

            LocalNotificationReceiver.SetValue("android:name", "com.stansassets.android.app.notifications.AN_AlarmNotificationTriggerReceiver");
            LocalNotificationReceiver.SetValue("android:enabled", "true");
            LocalNotificationReceiver.SetValue("android:exported", "true");

            var ReceiverIntentFilter = LocalNotificationReceiver.GetOrCreateIntentFilterWithName("com.androidnative.local.intent.OPEN");

            ReceiverIntentFilter.GetOrCreatePropertyWithName("action", "android.intent.action.BOOT_COMPLETED");
            ReceiverIntentFilter.GetOrCreatePropertyWithName("category", "android.intent.category.DEFAULT");
            buildRequirements.AddApplicationProperty(LocalNotificationReceiver);


            var notificationLaunchActivity = new AMM_ActivityTemplate(false, "com.stansassets.android.app.notifications.AN_NotificationLaunchActivity");

            notificationLaunchActivity.SetValue("android:launchMode", "singleTask");
            //  notificationLaunchActivity.SetValue("android:label", "@string/app_name");
            notificationLaunchActivity.SetValue("android:configChanges", "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen");
            notificationLaunchActivity.SetValue("android:theme", "@android:style/Theme.Translucent.NoTitleBar");
            buildRequirements.AddActivity(notificationLaunchActivity);



            buildRequirements.AddPermission(AMM_ManifestPermission.WAKE_LOCK);
            buildRequirements.AddBinaryDependency(AN_BinaryDependency.AndroidX);
        }
Example #2
0
        public override void AppendBuildRequirements(AN_AndroidBuildRequirements buildRequirements)
        {
            buildRequirements.AddBinaryDependency(AN_BinaryDependency.PlayServicesAuth);
            buildRequirements.AddBinaryDependency(AN_BinaryDependency.AndroidX);
            buildRequirements.AddInternalLib("an_gms.aar");

            var games_APP_ID = new AMM_PropertyTemplate("meta-data");

            games_APP_ID.SetValue("android:name", "com.google.android.gms.games.APP_ID");
            games_APP_ID.SetValue("android:value", "@string/app_id");
            buildRequirements.AddApplicationProperty(games_APP_ID);


            if (AN_Settings.Instance.GooglePlayGamesAPI)
            {
                buildRequirements.AddBinaryDependency(AN_BinaryDependency.PlayServicesGames);
            }
        }
Example #3
0
        public override void AppendBuildRequirements(AN_AndroidBuildRequirements buildRequirements)
        {
            //Always required

            var proxyActivity = new AMM_ActivityTemplate(false, "com.stansassets.core.utility.AN_ProxyActivity");

            proxyActivity.SetValue("android:launchMode", "singleTask");
            proxyActivity.SetValue("android:configChanges", "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen");
            proxyActivity.SetValue("android:theme", "@android:style/Theme.Translucent.NoTitleBar");

            buildRequirements.AddActivity(proxyActivity);

            var usesSdk = new AMM_PropertyTemplate("uses-sdk");

            usesSdk.SetValue("android:minSdkVersion", "4");
            buildRequirements.AddMenifestProperty(usesSdk);



            var permissionsProxyActivity = new AMM_ActivityTemplate(false, "com.stansassets.android.app.permissions.AN_PermissionsProxyActivity");

            permissionsProxyActivity.SetValue("android:launchMode", "singleTask");
            permissionsProxyActivity.SetValue("android:configChanges", "fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen");
            permissionsProxyActivity.SetValue("android:theme", "@android:style/Theme.Translucent.NoTitleBar");
            buildRequirements.AddActivity(permissionsProxyActivity);


            buildRequirements.AddBinaryDependency(AN_BinaryDependency.GSON);



            buildRequirements.AddBinaryDependency(AN_BinaryDependency.SupportV4CoreUtils);
            var provider = new AMM_PropertyTemplate("provider");

            provider.SetValue("android:name", "android.support.v4.content.FileProvider");
            provider.SetValue("android:authorities", Application.identifier + ".fileprovider");
            provider.SetValue("android:exported", "false");
            provider.SetValue("android:grantUriPermissions", "true");

            var meta = new AMM_PropertyTemplate("meta-data");

            meta.SetValue("android:name", "android.support.FILE_PROVIDER_PATHS");
            meta.SetValue("android:resource", "@xml/file_paths");

            provider.AddProperty(meta);


            buildRequirements.AddApplicationProperty(provider);


            //Optional
            if (AN_Settings.Instance.SkipPermissionsDialog)
            {
                //it was removed, and starting from 2018.3 permission dialog will never be asked on start up
                //so no point to use SkipPermissionsDialog meta

#if !UNITY_2018_3_OR_NEWER
                var SkipPermissionsDialog = new AMM_PropertyTemplate("meta-data");
                SkipPermissionsDialog.SetValue("android:name", "unityplayer.SkipPermissionsDialog");
                SkipPermissionsDialog.SetValue("android:value", "true");
                buildRequirements.AddApplicationProperty(SkipPermissionsDialog);
#endif
            }

            if (AN_Settings.Instance.MediaPlayer)
            {
                var videoPlayerActivity = new AMM_ActivityTemplate(false, "com.stansassets.android.media.AN_VideoPlayerActivity");
                videoPlayerActivity.SetValue("android:launchMode", "singleTask");
                videoPlayerActivity.SetValue("android:configChanges", "orientation|screenSize");
                videoPlayerActivity.SetValue("android:theme", "@android:style/Theme.NoTitleBar.Fullscreen");

                buildRequirements.AddActivity(videoPlayerActivity);
            }
        }