Questions tagged [xamarin.android]

Xamarin.Android (previously known as Mono for Android) is an implementation of Mono that runs on the Android platform, allowing you to write Android applications in C# using native Android libraries as well as using the .NET BCL (Base Class Libraries). Use this tag for issues that only occur when using Xamarin.Android, or when using Android-specific features.

Xamarin.Android (previously known as Mono for Android) is an implementation of Mono that runs on the Android platform, allowing you to write Android applications in C# using native Android libraries.

###Links:

18757 questions
22
votes
5 answers

Xamarin : Android : System.UnauthorizedAccessException: Access to the path is denied

So I'm trying to create a file and I'm getting System.UnauthorizedAccessException: Access to the path "/DownloadJitters" is denied. I'm not sure if it's a permissions thing (I've tried a write to external storage in case but that didn't work) or…
Euan Hollidge
  • 587
  • 2
  • 5
  • 21
22
votes
1 answer

AndroidGameWindow.SetDisplayOrientation NullReferenceException

I developed a game for Android using MonoGame & Xamarin. I incorporated BugSense into it and quickly started getting the following exception stack trace: System.NullReferenceException: Object reference not set to an instance of an object at…
user123
  • 632
  • 1
  • 6
  • 22
21
votes
1 answer

Keep wifi active in foreground service after phone goes to sleep

I want to receive packets from wifi when my phone is locked. The problem is that when I lock my screen, my foreground service stops receiving packets. I'm using Foreground Service like this: public override StartCommandResult OnStartCommand(Intent…
FCin
  • 3,804
  • 4
  • 20
  • 49
21
votes
1 answer

Ambiguous reference intellisense error from Resource.Designer.cs

I am running into a peculiar bug when developing on Visual Studio 2017 that I have been able to ignore for a while, but is now beginning to really bug me. I refer to this issue as a bug rather than an error because I am still able to build my…
ding
  • 327
  • 2
  • 8
21
votes
5 answers

Xamarin-System.UnauthorizedAccessException: Access to the path is denied

I'm trying to download a file and I'm getting System.UnauthorizedAccessException: Access to the path "/storage/emulated/0/Download/test.pdf" is denied. I have set required permission in Android Manifest file.
Melody
  • 1,203
  • 2
  • 17
  • 28
21
votes
9 answers

Failure [INSTALL_CANCELED_BY_USER] on Xiaomi device

I bought a Xiaomi Redmi 4x yesterday and I can't debug my apps in this device. I already enabled the Developer Options in the device, switch on to USB Debugging, install the USB Drivers and accepted the RSA debugging fingerprint pop that appears…
21
votes
5 answers

Name cannot begin with the '$' character, hexadecimal value 0x24

I have this warning that never goes away and I don't know how to get it fixed: Warning Name cannot begin with the '$' character, hexadecimal value 0x24. .Android C:\Program Files (x86)\Microsoft Visual…
E. Bourque
  • 373
  • 3
  • 10
21
votes
1 answer

Slow app build - Xamarin for Visual Studio

The build/deploy of my Xamarin.Android app is painfully slow these days. I cannot remember it being this slow before. I have enabled: Use shared runtime Fast deployment Enabling or disabling these settings doesn't make any difference. In both…
avb
  • 1,558
  • 1
  • 14
  • 37
21
votes
2 answers

Do I need to create a new SQLite database every time an application is updated?

I have a Xamarin Forms application I would like to develop. It will have a SQLite database and I wish to make this available on iOS and Android. The database will be populated with data from a SQL Server database on the cloud with initial seed…
Alan2
  • 23,493
  • 79
  • 256
  • 450
20
votes
1 answer

How to update Google Play Developer API to version 3 on Xamarin Forms App?

While uploading new APK to GooglePlay of a very simple APP which using only webview using Visual Studio 2019 Xamarin.Forms i am getting the following error on Google Play console: "We’ve detected that your app is using an old version of the…
Omtechguy
  • 3,321
  • 7
  • 37
  • 71
20
votes
3 answers

How to set shadow effect on ImageView

I'm tryin' to set shadow on an Image view on Xamarin.Forms (targeting the Android platform) and I got some examples on the internet. The PCL code is quite simple, and the platform seemed pretty easy too. The recipe available at the official xamarin…
Diego Rafael Souza
  • 5,241
  • 3
  • 23
  • 62
20
votes
2 answers

The "Xamarin.Build.Download.XamarinBuildAndroidAarProguardConfigs" task could not be loaded from the assembly

So I enabled proguard on one of my application. I had some problems with it but I solved them all ( had to update proguard, make a symlink of android sdk without spaces ) Now I enabled pro guard on another application and i'm constantly getting this…
Jordy Dieltjens
  • 1,528
  • 11
  • 29
20
votes
3 answers

Connect to paired bluetooth device from Xamarin on Android

We need our application to be able to connect to a paired bluetooth device automatically when an application starts via A2DP or Hands Free Profile. We are working in Xamarin (monodroid), for Android platform. I've found this stackoverflow question:…
Maxim V. Pavlov
  • 10,303
  • 17
  • 74
  • 174
19
votes
8 answers

Type cast from Java.Lang.Object to native CLR type in MonoDroid

How to cast Java.Lang.Object to some native type? Example: ListView adapter contains instances of native type Message. When i am trying to get SelectedItem from ListView it returns instance of Message type casted to Java.Lang.Object, but I can't…
mironych
  • 2,938
  • 2
  • 28
  • 37
19
votes
7 answers

Android Webview cannot render the pdf sometimes and shows blank/white page instead

Open the pdf in the webview using google docs Open the same pdf or different pdf again and again. Sometimes it will show the blank/white page in the android untill we refresh the webpage again for 1 or 2 times. I have made the sample on the pdf.…
Gopal Awasthi
  • 423
  • 1
  • 6
  • 15