Пример #1
0
        public static void CreateDWProfile(Context context)
        {
            sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_CREATE_PROFILE, PROFILE_NAME);

            //  Requires DataWedge 6.4

            //  Now configure that created profile to apply to our application
            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", PROFILE_NAME);
            profileConfig.PutString("PROFILE_ENABLED", "true"); //  Seems these are all strings
            profileConfig.PutString("CONFIG_MODE", "UPDATE");

            Bundle barcodeConfig = new Bundle();

            barcodeConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodeConfig.PutString("RESET_CONFIG", "true");
            Bundle barcodeProps = new Bundle();

            barcodeProps.PutString("configure_all_scanners", "true");
            barcodeProps.PutString("scanner_input_enabled", "true");
            barcodeConfig.PutBundle("PARAM_LIST", barcodeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig);
            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", context.PackageName);      //  Associate the profile with this app
            appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig });
            sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig);

            //  You can only configure one plugin at a time, we have done the barcode input, now do the intent output
            profileConfig.Remove("PLUGIN_CONFIG");
            Bundle intentConfig = new Bundle();

            intentConfig.PutString("PLUGIN_NAME", "INTENT");
            intentConfig.PutString("RESET_CONFIG", "true");
            Bundle intentProps = new Bundle();

            intentProps.PutString("intent_output_enabled", "true");
            intentProps.PutString("intent_action", context.Resources.GetString(Resource.String.activity_intent_filter_action));
            intentProps.PutString("intent_delivery", "0");  //  StartActivity
            intentConfig.PutBundle("PARAM_LIST", intentProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig);
            sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig);

            //  Disable keyboard output
            profileConfig.Remove("PLUGIN_CONFIG");
            Bundle keystrokeConfig = new Bundle();

            keystrokeConfig.PutString("PLUGIN_NAME", "KEYSTROKE");
            keystrokeConfig.PutString("RESET_CONFIG", "true");
            Bundle keystrokeProps = new Bundle();

            keystrokeProps.PutString("keystroke_output_enabled", "false");
            keystrokeConfig.PutBundle("PARAM_LIST", keystrokeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", keystrokeConfig);
            sendDataWedgeIntentWithExtra(context, ACTION_DATAWEDGE, EXTRA_SET_CONFIG, profileConfig);
        }
Пример #2
0
        private void UpdateProfile()
        {
            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", PROFILE_NAME);
            profileConfig.PutString("PROFILE_ENABLED", "true"); //  Seems these are all strings
            profileConfig.PutString("CONFIG_MODE", "UPDATE");
            Bundle barcodeConfig = new Bundle();

            barcodeConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodeConfig.PutString("RESET_CONFIG", "true"); //  This is the default but never hurts to specify

            // QUI SI IMPOSTANO LE PROPRIETA' DELLO SCANNER
            Bundle barcodeProps = new Bundle();

            barcodeProps.PutString("scanner_input_enabled", "true");
            barcodeProps.PutString("scanner_selection", "auto"); //  Could also specify a number here, the id returned from ENUMERATE_SCANNERS.
                                                                 //  Do NOT use "Auto" here (with a capital 'A'), it must be lower case.
            barcodeProps.PutString("decoder_ean8", "true");
            barcodeProps.PutString("decoder_ean13", "true");
            barcodeProps.PutString("decoder_code39", "true");
            barcodeProps.PutString("decoder_code128", "true");
            barcodeProps.PutString("decoder_upca", "true");
            barcodeProps.PutString("decoder_upce0", "true");
            barcodeProps.PutString("decoder_upce1", "true");
            barcodeProps.PutString("decoder_d2of5", "true");
            barcodeProps.PutString("decoder_i2of5", "true");
            barcodeProps.PutString("decoder_aztec", "true");
            barcodeProps.PutString("decoder_pdf417", "true");
            barcodeProps.PutString("decoder_qrcode", "true");

            barcodeConfig.PutBundle("PARAM_LIST", barcodeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig);

            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", this.PackageName);      //  Associate the profile with this app
            appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig });
            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, EXTRA_SET_CONFIG, profileConfig);
            //  You can only configure one plugin at a time, we have done the barcode input, now do the intent output
            profileConfig.Remove("PLUGIN_CONFIG");
            Bundle intentConfig = new Bundle();

            intentConfig.PutString("PLUGIN_NAME", "INTENT");
            intentConfig.PutString("RESET_CONFIG", "true");
            Bundle intentProps = new Bundle();

            intentProps.PutString("intent_output_enabled", "true");
            //  intentProps.PutString("intent_action", DataWedgeReceiver.IntentAction); // We can use this when we're going to define the DataWedgeReceiver class
            intentProps.PutString("intent_action", "barcodescanner.RECVR");
            intentProps.PutString("intent_delivery", "2");
            intentConfig.PutBundle("PARAM_LIST", intentProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig);
            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, EXTRA_SET_CONFIG, profileConfig);
        }
        private void CreateProfile()
        {
            String profileName = PROFILE_NAME;

            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, CREATE_PROFILE, profileName);


            //  Now configure that created profile to apply to our application
            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", PROFILE_NAME);
            profileConfig.PutString("PROFILE_ENABLED", "true"); //  Seems these are all strings
            profileConfig.PutString("CONFIG_MODE", "UPDATE");

            Bundle barcodeConfig = new Bundle();

            barcodeConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodeConfig.PutString("RESET_CONFIG", "true"); //  This is the default but never hurts to specify

            Bundle barcodeProps = new Bundle();

            barcodeConfig.PutBundle("PARAM_LIST", barcodeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig);

            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", Android.App.Application.Context.PackageName);      //  Associate the profile with this app
            appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig });
            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig);
            //  You can only configure one plugin at a time, we have done the barcode input, now do the intent output
            profileConfig.Remove("PLUGIN_CONFIG");


            Bundle intentConfig = new Bundle();

            intentConfig.PutString("PLUGIN_NAME", "INTENT");
            intentConfig.PutString("RESET_CONFIG", "true");

            Bundle intentProps = new Bundle();

            intentProps.PutString("intent_output_enabled", "true");
            intentProps.PutString("intent_action", DataWedgeReceiver.IntentAction);
            intentProps.PutString("intent_delivery", "2");
            intentConfig.PutBundle("PARAM_LIST", intentProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig);
            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig);
        }
Пример #4
0
        private Dictionary <string, Type> CreateFragmentTypesDictionary(Bundle outState)
        {
            IMvxSavedStateConverter savedStateConverter;

            if (!Mvx.TryResolve(out savedStateConverter))
            {
                return(null);
            }

            var typesForKeys = new Dictionary <string, Type>();

            foreach (var item in _lookup)
            {
                var fragment = item.Value.CachedFragment as IMvxFragmentView;
                if (fragment == null)
                {
                    continue;
                }

                var mvxBundle = fragment.CreateSaveStateBundle();
                var bundle    = new Bundle();
                savedStateConverter.Write(bundle, mvxBundle);
                outState.PutBundle(item.Key, bundle);

                typesForKeys.Add(item.Key, item.Value.ViewModelType);
            }

            return(typesForKeys);
        }
Пример #5
0
        private Dictionary <string, Type> CreateFragmentTypesDictionary(Bundle outState)
        {
            IMvxSavedStateConverter savedStateConverter;

            if (!Mvx.TryResolve(out savedStateConverter))
            {
                return(null);
            }

            var typesForKeys = new Dictionary <string, Type>();

            var currentFragsInfo = GetCurrentCacheableFragmentsInfo();

            foreach (var info in currentFragsInfo)
            {
                var fragment = info.CachedFragment as IMvxFragmentView;
                if (fragment == null)
                {
                    continue;
                }

                var mvxBundle = fragment.CreateSaveStateBundle();
                var bundle    = new Bundle();
                savedStateConverter.Write(bundle, mvxBundle);
                outState.PutBundle(info.Tag, bundle);

                if (!typesForKeys.ContainsKey(info.Tag))
                {
                    typesForKeys.Add(info.Tag, info.ViewModelType);
                }
            }

            return(typesForKeys);
        }
        public virtual void OnSaveInstanceState(Bundle outState, Action <Bundle> baseOnSaveInstanceState)
        {
            if (_state != null)
            {
                outState.PutBundle(nameof(State), _state);
            }
            lock (ContextCache)
                ContextCache[_id] = DataContext;
            outState.PutString(IdKey, _id.ToString());
            var viewModel = DataContext as IViewModel;

            if (viewModel != null)
            {
                viewModel.Disposed += ClearCacheOnDisposeDelegate;
                outState.PutString(ViewModelTypeNameKey, viewModel.GetType().AssemblyQualifiedName);

                bool saved = false;
                bool data;
                if (!viewModel.IsDisposed && (!viewModel.Settings.Metadata.TryGetData(ViewModelConstants.StateNotNeeded, out data) || !data))
                {
                    PreserveViewModel(viewModel, outState);
                    saved = true;
                }
                if (!saved)
                {
                    outState.PutString(IgnoreStateKey, null);
                }
            }
            baseOnSaveInstanceState(outState);
        }
Пример #7
0
 protected override void OnSaveInstanceState(Bundle outState)
 {
     base.OnSaveInstanceState(outState);
     if (BigBundle != null)
     {
         outState.PutBundle(ALL_VALUES, BigBundle);
     }
 }
 ///<inehritdoc/>
 public bool Save(string key, IList <ClarifiedError <int> > entity, Bundle bundle)
 {
     if (string.IsNullOrWhiteSpace(key) || entity == null || bundle == null)
     {
         return(false);
     }
     bundle.PutBundle(key, InnerCreateBundle(key, entity));
     return(true);
 }
Пример #9
0
 ///<inheritdoc/>
 public bool Save(string key, IQuestViewModel entity, Bundle bundle)
 {
     if (bundle != null && !string.IsNullOrWhiteSpace(key) && entity != null)
     {
         Bundle viewModelBundle = CreateViewModelBundle(entity);
         bundle.PutBundle(key, viewModelBundle);
         return(true);
     }
     return(false);
 }
        public static Bundle ToBundle(this FCMNotification notification)
        {
            var bundle = new Bundle();

            bundle.PutString(BundleKeyBody, notification.Body);
            bundle.PutString(BundleKeyTitle, notification.Title);
            bundle.PutString(BundleKeyImageUrl, notification.ImageUrl);
            bundle.PutBundle(BundleKeyData, notification.Data?.ToBundle());
            return(bundle);
        }
Пример #11
0
        internal static void PutState(this Bundle bundle, string key, IBundle?state)
        {
            var stateNativeBundleOwner = (INativeBundleOwner?)state;
            var stateNativeBundle      = stateNativeBundleOwner?.ExportNativeBundle();

            if (stateNativeBundle != null)
            {
                bundle.PutBundle(key, stateNativeBundle);
            }
        }
Пример #12
0
        protected override void OnSaveInstanceState(Bundle outState)
        {
            // TODO MKTAXI-3708

            var mapViewSaveState = new Bundle(outState);

            _touchMap.OnSaveInstanceState(mapViewSaveState);
            outState.PutBundle("mapViewSaveState", mapViewSaveState);
            base.OnSaveInstanceState(outState);
            //_touchMap.OnSaveInstanceState(outState);
        }
Пример #13
0
 public override void OnSaveInstanceState(Bundle outState)
 {
     var focusedChild = quizView.FocusedChild;
     var viewGroup = focusedChild as ViewGroup;
     if (viewGroup != null) {
         var currentView = viewGroup.GetChildAt (0);
         var qView = currentView as AbsQuizView;
         if (qView != null)
             outState.PutBundle (KeyUserInput, qView.UserInput);
     }
     base.OnSaveInstanceState (outState);
 }
Пример #14
0
        public override void OnSaveInstanceState(Bundle outState, PersistableBundle outPersistentState)
        {
            base.OnSaveInstanceState(outState, outPersistentState);
            Bundle mapViewBundle = outState.GetBundle("MapViewBundleKey");

            if (mapViewBundle == null)
            {
                mapViewBundle = new Bundle();
                outState.PutBundle("MapViewBundleKey", mapViewBundle);
            }
            mapView.OnSaveInstanceState(mapViewBundle);
        }
        public override void OnSaveInstanceState(Bundle outState)
        {
            base.OnSaveInstanceState(outState);

            PreferenceScreen preferenceScreen = PreferenceScreen;

            if (preferenceScreen != null)
            {
                Bundle container = new Bundle();
                preferenceScreen.SaveHierarchyState(container);
                outState.PutBundle(PREFERENCES_TAG, container);
            }
        }
Пример #16
0
        /**
         * Only if you need to restore open/close state when the orientation is changed.
         * Call this method in {@link android.app.Activity#onSaveInstanceState(Bundle)}
         */
        public void saveStates(Bundle outState)
        {
            if (outState == null)
            {
                return;
            }

            Bundle statesBundle = new Bundle();

            foreach (var item in mapStates)
            {
                statesBundle.PutInt(item.Key, item.Value);
            }

            outState.PutBundle(BUNDLE_MAP_KEY, statesBundle);
        }
        public override void OnSaveInstanceState(Bundle outState)
        {
            var focusedChild = quizView.FocusedChild;
            var viewGroup    = focusedChild as ViewGroup;

            if (viewGroup != null)
            {
                var currentView = viewGroup.GetChildAt(0);
                var qView       = currentView as AbsQuizView;
                if (qView != null)
                {
                    outState.PutBundle(KeyUserInput, qView.UserInput);
                }
            }
            base.OnSaveInstanceState(outState);
        }
Пример #18
0
        /// <summary>
        /// Puts view model parameters to the bundle.
        /// </summary>
        /// <typeparam name="TParameters">The type of the view model parameters.</typeparam>
        /// <param name="bundle">The bundle to put view model parameters.</param>
        /// <param name="parameters">The view model parameters. Can be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException"><paramref name="bundle"/> is <c>null</c>.</exception>
        public static void PutParameters <TParameters>(this Bundle bundle, TParameters?parameters)
            where TParameters : Parameters
        {
            if (bundle == null)
            {
                throw new ArgumentNullException(nameof(bundle));
            }

            var parametersNativeBundleOwner = (INativeBundleOwner?)parameters?.ExportBundle();
            var parametersNativeBundle      = parametersNativeBundleOwner?.ExportNativeBundle();

            if (parametersNativeBundle != null)
            {
                bundle.PutBundle(ParametersKey, parametersNativeBundle);
            }
        }
Пример #19
0
        /// <summary>
        /// Puts view model result to the bundle.
        /// </summary>
        /// <typeparam name="TResult">The type of the view model result.</typeparam>
        /// <param name="bundle">The bundle to put view model result.</param>
        /// <param name="result">The view model result. Can be <c>null</c>.</param>
        /// <exception cref="ArgumentNullException"><paramref name="bundle"/> is <c>null</c>.</exception>
        public static void PutResult <TResult>(this Bundle bundle, TResult?result)
            where TResult : Result
        {
            if (bundle == null)
            {
                throw new ArgumentNullException(nameof(bundle));
            }

            var resultNativeBundleOwner = (INativeBundleOwner?)result?.ExportBundle();
            var resultNativeBundle      = resultNativeBundleOwner?.ExportNativeBundle();

            if (resultNativeBundle != null)
            {
                bundle.PutBundle(ResultKey, resultNativeBundle);
            }
        }
        protected override void OnSaveInstanceState(Bundle outState)
        {
            outState.PutString(KEY_EXHIBIT_ID, exhibit.Id);
            outState.PutInt(KEY_CURRENT_PAGE_INDEX, currentPageIndex);
            outState.PutBoolean(KEY_AUDIO_PLAYING, isAudioPlaying);
            outState.PutBoolean(KEY_AUDIO_TOOLBAR_HIDDEN, isAudioToolbarHidden);
            outState.PutBoolean(KEY_CAPTION_SHOWN, isCaptionShown);
            outState.PutBoolean(KEY__HELP_DIALOG_SHOWN, isHelpDialogShown);
            outState.PutBoolean(KEY_PAGE_SWITCH_BASED_ON_SETTINGS, isSwitchToNextPageAutomatically);
            outState.PutBundle(KEY_EXTRAS, extras);
            if (captionDialog != null)
            {
                outState.PutInt(KEY_CURRENT_CAPTION_TAB, captionDialog.CurrentTab);
                outState.PutInt(KEY_CURRENT_SOURCE, captionDialog.CurrentSource);
            }

            base.OnSaveInstanceState(outState);
        }
        public void SetConfig(IEMDKScannerConfig cnf)
        {
            ZebraScannerConfig config = (ZebraScannerConfig)cnf;

            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", PROFILE_NAME);
            profileConfig.PutString("PROFILE_ENABLED", m_bRegistered ? "true" : "false"); //  Seems these are all strings
            profileConfig.PutString("CONFIG_MODE", "UPDATE");

            Bundle barcodeConfig = new Bundle();

            barcodeConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodeConfig.PutString("RESET_CONFIG", "false"); //  This is the default but never hurts to specify

            Bundle barcodeProps = new Bundle();

            barcodeProps.PutString("scanner_input_enabled", "true");
            barcodeProps.PutString("scanner_selection", "auto"); //  Could also specify a number here, the id returned from ENUMERATE_SCANNERS.
                                                                 //  Do NOT use "Auto" here (with a capital 'A'), it must be lower case.
            barcodeProps.PutString("decoder_ean8", config.IsEAN8 ? "true" : "false");
            barcodeProps.PutString("decoder_ean13", config.IsEAN13 ? "true" : "false");
            barcodeProps.PutString("decoder_code39", config.IsCode39 ? "true" : "false");
            barcodeProps.PutString("decoder_code128", config.IsCode128 ? "true" : "false");
            barcodeProps.PutString("decoder_upca", config.IsUPCA ? "true" : "false");
            barcodeProps.PutString("decoder_upce0", config.IsUPCE0 ? "true" : "false");
            barcodeProps.PutString("decoder_upce1", config.IsUPCE1 ? "true" : "false");
            barcodeProps.PutString("decoder_d2of5", config.IsD2of5 ? "true" : "false");
            barcodeProps.PutString("decoder_i2of5", config.IsI2of5 ? "true" : "false");
            barcodeProps.PutString("decoder_aztec", config.IsAztec ? "true" : "false");
            barcodeProps.PutString("decoder_pdf417", config.IsPDF417 ? "true" : "false");
            barcodeProps.PutString("decoder_qrcode", config.IsQRCode ? "true" : "false");

            barcodeConfig.PutBundle("PARAM_LIST", barcodeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig);
            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", Android.App.Application.Context.PackageName);      //  Associate the profile with this app
            appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig });
            SendDataWedgeIntentWithExtra(ACTION_DATAWEDGE_FROM_6_2, SET_CONFIG, profileConfig);
        }
Пример #22
0
        private void SetProfileConfig(DWProfileSetConfigSettings settings)
        {
            // (Re)Configuration du profil via l'intent SET_PROFILE
            // NB : on peut envoyer cet intent sans soucis même si le profil est déjà configuré
            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", settings.ProfileName);
            profileConfig.PutString("PROFILE_ENABLED", "true");
            profileConfig.PutString("CONFIG_MODE", "UPDATE");

            // Configuration des applications du profil
            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", mContext.PackageName);
            appConfig.PutStringArray("ACTIVITY_LIST", new String[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new Bundle[] { appConfig });

            // Configuration des différents plugins
            List <IParcelable> pluginConfigs = new List <IParcelable>();

            // Configuration du plugin BARCODE
            Bundle barcodePluginConfig = new Bundle();

            barcodePluginConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodePluginConfig.PutString("RESET_CONFIG", "true");

            Bundle barcodeProps = new Bundle();

            barcodeProps.PutString("aim_mode", "on");
            barcodeProps.PutString("lcd_mode", "3");

            // Use this for Datawedge < 6.7
            //barcodeProps.putString("scanner_selection", "auto");

            // Use this for Datawedge >= 6.7
            barcodeProps.PutString("scanner_selection_by_identifier", "INTERNAL_IMAGER");

            if (settings.AggressiveMode)
            {
                // Super aggressive continuous mode without beam timer and no timeouts
                barcodeProps.PutString("aim_type", "5");
                barcodeProps.PutInt("beam_timer", 0);
                barcodeProps.PutString("different_barcode_timeout", "0");
                barcodeProps.PutString("same_barcode_timeout", "0");
            }
            else
            {
                // Standard mode with beam timer and same/different timeout
                barcodeProps.PutString("aim_type", "3");
                barcodeProps.PutInt("beam_timer", 5000);
                barcodeProps.PutString("different_barcode_timeout", "500");
                barcodeProps.PutString("same_barcode_timeout", "500");
            }
            barcodePluginConfig.PutBundle("PARAM_LIST", barcodeProps);
            pluginConfigs.Add(barcodePluginConfig);


            // Configuration du plugin KEYSTROKE
            Bundle keystrokePluginConfig = new Bundle();

            keystrokePluginConfig.PutString("PLUGIN_NAME", "KEYSTROKE");
            keystrokePluginConfig.PutString("RESET_CONFIG", "true");
            Bundle keystrokeProps = new Bundle();

            keystrokeProps.PutString("keystroke_output_enabled", "false");
            keystrokePluginConfig.PutBundle("PARAM_LIST", keystrokeProps);
            pluginConfigs.Add(keystrokePluginConfig);

            // Configuration du plugin INTENT
            Bundle intentPluginConfig = new Bundle();

            intentPluginConfig.PutString("PLUGIN_NAME", "INTENT");
            intentPluginConfig.PutString("RESET_CONFIG", "true");
            Bundle intentProps = new Bundle();

            intentProps.PutString("intent_output_enabled", "true");
            intentProps.PutString("intent_action", settings.IntentAction);
            intentProps.PutString("intent_category", settings.IntentCategory);
            intentProps.PutString("intent_delivery", "2");
            intentPluginConfig.PutBundle("PARAM_LIST", intentProps);
            pluginConfigs.Add(intentPluginConfig);

            // Envoi d'intent de configuration du profil
            profileConfig.PutParcelableArrayList("PLUGIN_CONFIG", pluginConfigs);

            SendDataWedgeIntentWithExtraRequestResult(DataWedgeConstants.ACTION_DATAWEDGE_FROM_6_2,
                                                      DataWedgeConstants.EXTRA_SET_CONFIG,
                                                      profileConfig);
        }
		public override void OnSaveInstanceState (Bundle outState)
		{
			base.OnSaveInstanceState (outState);

			PreferenceScreen preferenceScreen = PreferenceScreen;
			if (preferenceScreen != null) {
				Bundle container = new Bundle ();
				preferenceScreen.SaveHierarchyState (container);
				outState.PutBundle (PREFERENCES_TAG, container);
			}
		}
Пример #24
0
        private void CreateDataWedgeProfile()
        {
            //Create profile if doesn't exit and update the required settings
            const string ACTION     = "com.symbol.datawedge.api.ACTION";
            const string SET_CONFIG = "com.symbol.datawedge.api.SET_CONFIG";
            //        final String CREATE_PROFILE = "com.symbol.datawedge.api.CREATE_PROFILE";
            //        final String SWITCH = "com.symbol.datawedge.api.SWITCH_TO_PROFILE";
            string packageName = PackageName;
            string profileName = GetString(Resource.String.app_name) + "App";
            {
                Bundle bConfig      = new Bundle();
                Bundle bParams      = new Bundle();
                Bundle configBundle = new Bundle();
                Bundle bundleApp1   = new Bundle();

                bParams.PutString("scanner_selection", "auto");
                bParams.PutString("intent_output_enabled", "true");
                bParams.PutString("intent_action", packageName + ".SCAN");
                bParams.PutString("intent_category", Intent.CategoryDefault);
                bParams.PutString("intent_delivery", "2");

                configBundle.PutString("PROFILE_NAME", profileName);
                configBundle.PutString("PROFILE_ENABLED", "true");
                configBundle.PutString("CONFIG_MODE", "CREATE_IF_NOT_EXIST");

                bundleApp1.PutString("PACKAGE_NAME", packageName);
                bundleApp1.PutStringArray("ACTIVITY_LIST", new String[] { packageName + ".SCAN" });

                configBundle.PutParcelableArray("APP_LIST", new Bundle[] { bundleApp1 });

                bConfig.PutString("PLUGIN_NAME", "INTENT");
                bConfig.PutString("RESET_CONFIG", "false");

                bConfig.PutBundle("PARAM_LIST", bParams);
                configBundle.PutBundle("PLUGIN_CONFIG", bConfig);

                Intent i = new Intent();
                i.SetAction(ACTION);
                i.PutExtra(SET_CONFIG, configBundle);
                this.SendBroadcast(i);
            }

            //TO recieve the scanned via intent, the keystroke must disabled.
            {
                Bundle bConfig      = new Bundle();
                Bundle bParams      = new Bundle();
                Bundle configBundle = new Bundle();

                bParams.PutString("keystroke_output_enabled", "false");

                configBundle.PutString("PROFILE_NAME", profileName);
                configBundle.PutString("PROFILE_ENABLED", "true");
                configBundle.PutString("CONFIG_MODE", "UPDATE");

                bConfig.PutString("PLUGIN_NAME", "KEYSTROKE");
                bConfig.PutString("RESET_CONFIG", "false");

                bConfig.PutBundle("PARAM_LIST", bParams);
                configBundle.PutBundle("PLUGIN_CONFIG", bConfig);

                Intent i = new Intent();
                i.SetAction(ACTION);
                i.PutExtra(SET_CONFIG, configBundle);
                this.SendBroadcast(i);
            }
        }
        private Dictionary<string, Type> CreateFragmentTypesDictionary(Bundle outState)
        {
            IMvxSavedStateConverter savedStateConverter;
            if (!Mvx.TryResolve(out savedStateConverter))
            {
                return null;
            }

            var typesForKeys = new Dictionary<string, Type>();

            var currentFragsInfo = GetCurrentCacheableFragmentsInfo();
            foreach (var info in currentFragsInfo)
            {
                var fragment = info.CachedFragment as IMvxFragmentView;
                if (fragment == null)
                    continue;

                var mvxBundle = fragment.CreateSaveStateBundle();
                var bundle = new Bundle();
                savedStateConverter.Write(bundle, mvxBundle);
                outState.PutBundle(info.Tag, bundle);

                if(!typesForKeys.ContainsKey(info.Tag))
                    typesForKeys.Add(info.Tag, info.ViewModelType);
            }

            return typesForKeys;
        }
Пример #26
0
		protected override void OnSaveInstanceState (Bundle outState)
		{
			//Store the game state
			outState.PutBundle (ICICLE_KEY, snake_view.SaveState ());
		}
Пример #27
0
 public override void OnSaveInstanceState(Bundle outState)
 {
     base.OnSaveInstanceState(outState);
     WizardFlow.PersistFlow(outState);
     outState.PutBundle(STATE_WIZARD_CONTEXT, StateManager.ContextBundle);
 }
Пример #28
0
 protected override void OnSaveInstanceState(Bundle outState)
 {
     //Store the game state
     outState.PutBundle(ICICLE_KEY, snake_view.SaveState());
 }
Пример #29
0
 public override void OnSaveInstanceState(Bundle outState)
 {
     base.OnSaveInstanceState(outState);
     WizardFlow.PersistFlow(outState);
     outState.PutBundle(STATE_WIZARD_CONTEXT, StateManager.ContextBundle);
 }
Пример #30
0
 /// <summary>
 /// Save current state to bundle outState.
 /// </summary>
 /// <param name="outState">Out state.</param>
 /// <param name="key">Key.</param>
 public void SaveStatesToKey(Bundle outState, string key)
 {
     outState.PutBundle(key, CreateBundle());
 }
Пример #31
0
        /// <summary>
        /// Creates DataWedge Profile used by Zebra device to trap incoming hardware actions such as barcode and ring scanner scan
        /// </summary>
        private void CreateProfile()
        {
            String profileName = ExtraProfileName;

            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, ExtraCreateProfile, profileName);

            //  Now configure that created profile to apply to our application
            Bundle profileConfig = new Bundle();

            profileConfig.PutString("PROFILE_NAME", ExtraProfileName);
            profileConfig.PutString("PROFILE_ENABLED", "true"); //  Seems these are all strings
            profileConfig.PutString("CONFIG_MODE", "UPDATE");

            Bundle barcodeConfig = new Bundle();

            barcodeConfig.PutString("PLUGIN_NAME", "BARCODE");
            barcodeConfig.PutString("RESET_CONFIG", "true"); //  This is the default but never hurts to specify

            Bundle barcodeProps = new Bundle();

            barcodeConfig.PutBundle("PARAM_LIST", barcodeProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", barcodeConfig);

            Bundle appConfig = new Bundle();

            appConfig.PutString("PACKAGE_NAME", PackageName);      //  Associate the profile with this app
            appConfig.PutStringArray("ACTIVITY_LIST", new[] { "*" });
            profileConfig.PutParcelableArray("APP_LIST", new IParcelable[] { appConfig });
            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, ExtraSetConfig, profileConfig);

            //  You can only configure one plugin at a time, we have done the barcode input, now do the intent output
            profileConfig.Remove("PLUGIN_CONFIG");
            Bundle intentConfig = new Bundle();

            intentConfig.PutString("PLUGIN_NAME", "INTENT");
            intentConfig.PutString("RESET_CONFIG", "true");

            Bundle intentProps = new Bundle();

            intentProps.PutString("intent_output_enabled", "true");
            intentProps.PutString("intent_action", DataWedgeReceiver.IntentAction);
            intentProps.PutString("intent_delivery", "2");
            intentConfig.PutBundle("PARAM_LIST", intentProps);
            profileConfig.PutBundle("PLUGIN_CONFIG", intentConfig);

            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, ExtraSetConfig, profileConfig);

            //NEW - 2/18: Register for notifications - PROFILE_SWITCH

            Bundle notificationRegisterBundle = new Bundle();

            notificationRegisterBundle.PutString("com.symbol.datawedge.api.APPLICATION_NAME", "com.sample.dw");
            notificationRegisterBundle.PutString("com.symbol.datawedge.api.NOTIFICATION_TYPE", "PROFILE_SWITCH");
            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, "com.symbol.datawedge.api.REGISTER_FOR_NOTIFICATION", notificationRegisterBundle);

            //NEW - 2/18: UnRegister for notifications - PROFILE_SWITCH

            Bundle notificationUnRegisterBundle = new Bundle();

            notificationUnRegisterBundle.PutString("com.symbol.datawedge.api.APPLICATION_NAME", "com.sample.dw");
            notificationUnRegisterBundle.PutString("com.symbol.datawedge.api.NOTIFICATION_TYPE", "PROFILE_SWITCH");
            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, "com.symbol.datawedge.api.UNREGISTER_FOR_NOTIFICATION", notificationUnRegisterBundle);

            //NEW - 2/18: Register for notifications - Scanner_Status

            Bundle ScannerStatusRegisterBundle = new Bundle();

            ScannerStatusRegisterBundle.PutString("com.symbol.datawedge.api.APPLICATION_NAME", "com.sample.dw");
            ScannerStatusRegisterBundle.PutString("com.symbol.datawedge.api.NOTIFICATION_TYPE", "SCANNER_STATUS");
            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, "com.symbol.datawedge.api.REGISTER_FOR_NOTIFICATION", ScannerStatusRegisterBundle);


            //NEW - 2/18: UnRegister for notifications - Scanner_status

            Bundle ScannerStatusUnRegisterBundle = new Bundle();

            ScannerStatusUnRegisterBundle.PutString("com.symbol.datawedge.api.APPLICATION_NAME", "com.sample.dw");
            ScannerStatusUnRegisterBundle.PutString("com.symbol.datawedge.api.NOTIFICATION_TYPE", "SCANNER_STATUS");
            SendDataWedgeIntentWithExtra(ActionDataWedgeFrom62, "com.symbol.datawedge.api.UNREGISTER_FOR_NOTIFICATION", ScannerStatusUnRegisterBundle);

            _broadcastReceiver.RegisterBroadcastReceiverforNotificationActions();
        }