by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
    Diego Ponce de León
    @xleon
    Hi all, I´m experiencing an issue after picking a file with the media plugin. Right after operation completes, MediaFile.Path exists. A while later, it just disappears from disc
    this is happening in iOS
    I´m not disposing the file
    Muralidharan Nandakumar
    @murali0009
    @jamesmontemagno Thanks for the awesome plugins. Is the Id field under device info plugin is unique for every device?
    Ryan Herman
    @ryanherman
    Hey all I finished integrating AWS SNS into my project and feel it would help the community making a NuGet plugin, anyone help me?
    HotTotem
    @tomh4
    Hey guys! Can anyone specify me what the desiredaccuracy`s units are ?
    Speaking of the Geolocator
    Fernando Tirolo Gomes
    @tirolo
    Tviljan
    @Tviljan
    Hi, any workaround for issue 280 : ConnectivityChanged not fired when switching between cellular and wifi?
    It only raises the event if connection goes from offline <-> online
    But if goes from wifi -> mobile data it does nothing
    Miguel Guajardo
    @Zekard92
    Hi, im using a Macbook pro to create Cross platform apps (principal for Android) the thing is that Media Plugins is giving me "System.NotImplementedException" error in this line: var archivo = await CrossMedia.Current.TakePhotoAsync(opcionesCamara);
    Seth Valdetero
    @valdetero
    Did you install the package in the platform specific project too?
    Miguel Guajardo
    @Zekard92
    yup (i'm using Xamarin Studio)
    Mads Laumann
    @Laumania
    So you installed the package twice right? The same exact nuget?
    Miguel Guajardo
    @Zekard92
    I installed once, and automatically xamarin studio installed it on every platform project
    Miguel Guajardo
    @Zekard92
    yes
    James Montemagno
    @jamesmontemagno
    just seems like you need to install it on each platform
    do you hae a screenshot?
    Ryan Herman
    @ryanherman
    @jamesmontemagno Is there way to call isconnected on an initializer for my internet class so every method I wrote I don't have to do a if(isConnected() == false) return null;
    Can't think of a way because of async does not work in the initializer
    Ryan Herman
    @ryanherman
    and can't return anything
    Ed
    @EdBrereton
    @ryanherman have you tried using the .Result of the task returned by your async method in the initializer? iirc that should give you the correct result without the need to use async/await
    Seth Valdetero
    @valdetero
    @ryanherman Why not use a single method to execute the request, put the connection check in there and have all of your service methods call that one. That's what I do.
    Seth Valdetero
    @valdetero
    I'm not sure what you mean by initializer, but I hope you don't mean the constructor. You should never put asynchronous code in the constructor - especially if you call it synchronously and block the thread.
    Miguel Guajardo
    @Zekard92
    Is there a way to deserialize a JSON from google directions API?
    Seth Valdetero
    @valdetero
    Have you tried JSON.NET?
    Miguel Guajardo
    @Zekard92
    nope let me try
    HotTotem
    @tomh4

    Anyone experiencing issues with the Geolocator plugin ? I recently get a error, way before the timeout time did expire. Not sure what goes wrong here, any ideas ? Unhandled Exception:

    System.Threading.Tasks.TaskCanceledException: A task was canceled.

    Eric Brunner
    @ericbrunner
    Post the sample there you get that exception.
    here is mine which works fine. Hope it helps:
        private async void OnGeoLocationStartTrackingClicked(object sender, EventArgs e)
        {
            var status = await CrossPermissions.Current.CheckPermissionStatusAsync(Permission.Location);
            if (status != PermissionStatus.Granted)
            {
                if (await CrossPermissions.Current.ShouldShowRequestPermissionRationaleAsync(Permission.Location))
                {
                    await DisplayAlert("Need location", "TruckerApp need that location", "OK");
                }
    
                var results = await CrossPermissions.Current.RequestPermissionsAsync(new[] {Permission.Location});
                status = results[Permission.Location];
            }
    
            if (status == PermissionStatus.Granted)
            {
                if (CrossGeolocator.Current.IsListening)
                    return;
    
                if (!CrossGeolocator.Current.IsGeolocationAvailable)
                {
                    await DisplayAlert("GPS Start", "GPS ist auf Ihrem Gerät nicht verfügbar.", "Ok");
    
                    return;
                }
    
                if (!CrossGeolocator.Current.IsGeolocationEnabled)
                {
                    await
                        DisplayAlert("GPS Start",
                            "GPS ist auf Ihrem Gerät nicht aktiviert. Prüfen Sie die Einstellungen am Phone.", "Ok");
                    return;
                }
    
                if (!CrossGeolocator.Current.SupportsHeading)
                {
                    //await DisplayAlert("GPS Start", "GPS Heading ist auf Ihrem Gerät nicht verfügbar.", "Ok");
                    //return;
                }
    
                GeoLocationInfoButton.Text = "Stop GPS";
                GeoLocationInfoButton.Clicked -= OnGeoLocationStartTrackingClicked;
                GeoLocationInfoButton.Clicked += OnGeoLocationStopTrackingClicked;
                GeoLocationPanel.IsVisible = true;
    
                CrossGeolocator.Current.DesiredAccuracy = 1;
                GeoLocationStatusLabel.Text = "Getting gps";
                CrossGeolocator.Current.PositionChanged += (o, args) =>
                {
                    var position = args.Position;
    
                    var geoLocalTime = GetGeoLocalUtcTime(position);
                    var speedInKmPerHour = GetSpeedInKilometerPerHour(position);
    
                    GeoLocationStatusLabel.Text =
                        $"Time: {geoLocalTime}\n" +
                        $"Lat: {position.Latitude}\n" +
                        $"Long: {position.Longitude}\n" +
                        $"Altitude: {position.Altitude} m\n" +
                        $"Altitude Accuracy: {position.AltitudeAccuracy} m\n" +
                        $"Accuracy: {position.Accuracy} m\n" +
                        $"Heading: {position.Heading} ° (Grad abweichend von Nord) \n" +
                        $"Speed: {speedInKmPerHour} km/h";
                };
    
                CrossGeolocator.Current.PositionError += async (o, args) =>
                {
                    var error = args?.Error;
    
                    await DisplayAlert("GPS Fehler", $"Fehler : {error}", "Ok");
                };
    
                //minTime in msec, minDistance in meter see https://blog.xamarin.com/geolocation-for-ios-android-and-windows-made-easy/
                bool result =
                    await CrossGeolocator.Current.StartListeningAsync(minTime: 1, minDistance: 1, includeHeading: true);
    
                if (!result)
                {
                    await DisplayAlert("GPS Start", "GPS Tracking konnte nicht gestarted werden", "Ok");
                    return;
                }
            }
            else
            {
                await DisplayAlert("GeoLocation Info", $"Geo Location nicht verfügbar. Status:{status}", "OK");
    
                if (Device.OS == TargetPlatform.iOS)
                {
                    //On iOS you may want to send your user to the settings screen.
                    CrossP
    HotTotem
    @tomh4
    well all i am basically doing is calling the basic function to get the location , like so
    var locator = CrossGeolocator.Current;
     locator.DesiredAccuracy = 50;
    
     var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000);
    Eric Brunner
    @ericbrunner
    You specify a timeout of 10 seconds. It is reasonable that a TaskCancellationExcepetion is thrown when those 10 seconds elapsed. I would increase the timeout or remove it . Does that make sense to you? If it really throws that exception prior to the elapsed specified timeout wrap your var position = await locator.GetPositionAsync (timeoutMilliseconds: 10000); in a try - catch block and post the got exception/innerexception for further investigation
       private async void OnGetGeoLocationTrackingClicked(object sender, EventArgs e)
        {
            var locator = CrossGeolocator.Current;
            locator.DesiredAccuracy = 1;
            GeoLocationStatusLabel.Text = "Getting gps";
    
            Plugin.Geolocator.Abstractions.Position position = null;
    
            try
            {
                position = await locator.GetPositionAsync(timeoutMilliseconds: 10000);
            }
            catch (Exception ex)
            {
                await DisplayAlert("GPS GetPositionAsync Fehler", ex.Message, "Ok");
                position = null;
            }
    
    
            if (position == null)
            {
                GeoLocationStatusLabel.Text = "Null gps :(";
                return;
            }
    
            GeoLocationStatusLabel.Text = 
                $"Time: {position.Timestamp}\n" +
                $"Lat: {position.Latitude}\n" +
                $"Long: {position.Longitude}\n" +
                $"Altitude: {position.Altitude}\n" +
                $"Altitude Accuracy: {position.AltitudeAccuracy}\n" +
                $"Accuracy: {position.Accuracy}\n" +
                $"Heading: {position.Heading}\n" +
                $"Speed: {position.Speed}";
        }
    }
    HotTotem
    @tomh4
    it makes sense, but firstly the timeout goes off way before 10 seconds, and secondly why should it take more than 10 seconds to be located...
    I tried to catch the error but i dont get much more info from it, except the System.Threading.Tasks.TaskCanceledException: A task was canceled.
    Eric Brunner
    @ericbrunner
    I am a user like you and just wanted to help you. For internal API details you have to consult @jamesmontemagno
    Ryan Herman
    @ryanherman
    I want to create a nuget package
    Ravinder Jangra
    @ravinderjangra
    @ryanherman me too
    Leoromero.Dev
    @Micnick
    hi everyone
    robinlevelapp
    @robinlevelapp
    hello everyone, just wanna ask anyone know how to activate flash on takephoto, I am trying to edit jamesmontemagno Media.Plugin
    Aritra Das
    @dev-aritra
    Anybody here used the speech to text ?
    mrakhra
    @mrakhra
    @jamesmontemagno
    how are you?
    SourabhSharma1991
    @SourabhSharma1991
    Please Add Xamiran Forms WhatsApp group.