Category : xamarin.android

I’m struggling with an app I’m developing in Xamarin Android. I need to capture the audio output from the device to do some fancy stuff with the audio stream. But when the app ask for the user permission Manifest.Permission.CaptureAudioOutput no pop-up is shown and the permission returns denied. The question is just shown fine for ..

Read more

I use ExoPlayer in my Xamarin project. And I cant play music from http link in my app. This is my code: SimpleExoPlayer _player; void InitPlayer() { var mediaUri = Android.Net.Uri.Parse("http://server5.radio-streams.net:8065/index.html?sid=1"); DefaultTrackSelector trackSelector = new DefaultTrackSelector(Platform.CurrentActivity); trackSelector.SetParameters(trackSelector.BuildUponParameters().SetMaxVideoSizeSd()); DefaultRenderersFactory renderersFactory = new DefaultRenderersFactory(Platform.CurrentActivity); IMediaSource mediaSource = BuildMediaSource(mediaUri); _player = new SimpleExoPlayer.Builder(Platform.CurrentActivity, renderersFactory).SetTrackSelector(trackSelector).Build(); _player.Prepare(mediaSource, false, false); } ..

Read more

How to save photo in gallery folder? I am using ImageCropper.Forms.Fix.v2 and Xam.Media.Plugin code is working fine, but it saving in location: /data/user/0/com.companyname.projectname/cache/cropped3243.png i want to save it in gallery folder. how can i do this? protected async void TapGestureRecognizerCommand(object sender, EventArgs e) { await CrossMedia.Current.Initialize(); ImageSource TempimageFile = null; new ImageCropper() { PageTitle = ..

Read more

I cannot get a basic webview sample to work. I created an empty android mobile app with VS 2019, added the folowing code to mainpage.xaml. Which gives me an empty page in the app, doesn’t matter what url I’m using. <?xml version="1.0" encoding="utf-8" ?> <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" x:Class="App3.MainPage"> <WebView x:FieldModifier="webview" x:Uid="webview" x:Name="webView" Source="https://www.skysports.com"></WebView> </ContentPage> I ..

Read more

I have a requirement to access the directory where the Android APK Expansion (.OBB) files are stored via the shared Xamarin.Forms project. As per this documentation, it can be seen that the .OBB files are stored in the directory specified by the Android.OS.Environment.ExternalStorageDirectory property exclusive to Xamarin.Android projects, but I cannot find its counterpart in ..

Read more

I have several lines of code that look similar to the below line: activity.Window.DecorView.SystemUiVisibility = (StatusBarVisibility)(SystemUiFlags.LayoutStable | SystemUiFlags.LayoutHideNavigation | SystemUiFlags.LayoutFullscreen); It looks like Android R deprecates SystemUiVisibility. What is the right way to set the above flags going forward in Xamarin Android? Source: Android..

Read more