Esempio n. 1
0
 protected override void OnActivityResult(int requestCode, Result resultCode, Android.Content.Intent data)
 {
     if (resultCode == Result.Ok)
     {
         var barcode = data.GetStringExtra("com.ebay.redlasersdk.barcode");
         var barcodeType = data.GetStringExtra("com.ebay.redlasersdk.barcodetype");
         Log.Debug("TESTApp", "BARCODE: " + barcode);
         new AlertDialog.Builder(this).SetTitle("Scan Result").SetMessage(barcodeType + ": " + barcode)
         .SetNegativeButton("OK", (Dialog, whichButton) => { }).Show();
     }
 }
Esempio n. 2
0
        protected override void OnHandleIntent(Android.Content.Intent intent)
        {
            StreamReader reader = null;
            string zipCode = intent.GetStringExtra ("lqe");
            try {

                var httpClient = new HttpClient ();
                // Construct the URL for the OpenWeatherMap query
                // Possible parameters are available at OWM's forecast API page, at
                // http://openweathermap.org/API#forecast
                Task<string> getJSON = httpClient.GetStringAsync ("http://api.openweathermap.org/data/2.5/forecast/daily?q=" + zipCode + ",us&mode=json&units=metric&cnt=7&APPID=83fde89b086ca4abec16cb2a8c245bb8");
                string JSON = getJSON.Result;

                getWeatherDataFromJson (JSON, zipCode);
            } catch (IOException e) {
                Log.WriteLine (LogPriority.Error, "PlaceholderFragment", "Error ", e);
                // If the code didn't successfully get the weather data, there's no point in attempting
                // to parse it.
            } finally {
                if (reader != null) {
                    try {
                        reader.Close ();
                    } catch (IOException e) {
                        Log.WriteLine (LogPriority.Error, "PlaceholderFragment", "Error closing stream", e);
                    }
                }

            }
        }
Esempio n. 3
0
        protected override void OnNewIntent(Android.Content.Intent intent)
        {
            base.OnNewIntent(intent);

            _selectedAlarm = JsonConvert.DeserializeObject<AlarmData>(intent.GetStringExtra(Constants.AlarmsData_Extra));
            _requestId = _selectedAlarm.RequestId;

            SupportActionBar.Title = _selectedAlarm.Name;
        }
Esempio n. 4
0
        private void handleDecodeData(Android.Content.Intent i)
        {
            // check the intent action is for us
            if (i.Action.Equals (ourIntentAction)) {
                String source = i.GetStringExtra(SOURCE_TAG);
                String data = i.GetStringExtra(DATA_STRING_TAG);

                //INSERT EN THREAD + PROGRESS
                //ShowProgressInsert (progress => AndHUD.Shared.Show (this, "Insertion ... " + progress + "%", progress, MaskType.Clear));
                Thread threadinsert = new Thread (() => GetPosData (data));
                threadinsert.Start ();

            }
        }