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
47
votes
1 answer

Adding a button to the title bar Xamarin Forms

Haven't been able to find quite the right answer for this yet. I want to add a button into the navigation / title bar at the top of a Xamarin Forms Navigation Page. Note that I need to know a method that will work on android, I'm not interested in…
Jobalisk
  • 728
  • 1
  • 6
  • 17
47
votes
11 answers

Warning major version 52 is newer than 51, the highest major version supported by this compiler

Basicly I'm super newbie and started internship in IT company. I installed VS with Xamarin. The problem that I'm facing is very frustrating. So even when i create empty project I can't compile it and get error like this : Severity Code Description…
T.Gelev
  • 499
  • 1
  • 4
  • 4
47
votes
3 answers

Whats the difference between Java.Net.Uri and Android.Net.Uri

I am trying to get a Uri from a file object like so: File file = new File("/sdcard/MyFolder/MyFile.txt"); var androidUri = Android.Net.Uri.FromFile(file).ToString(); var javaUri = file.ToURI().ToString(); this returns the following…
JKennedy
  • 18,150
  • 17
  • 114
  • 198
46
votes
2 answers

Use a local database in Xamarin

I have started using the Xamarin plugin for Visual Studio to create an Android app. I have a local SQL database, and I want to call it to display data. I don't see how I can do this. Is it possible?
user2631662
  • 855
  • 5
  • 12
  • 21
46
votes
1 answer

How do I launch multiple instances of Xamarin Studio on the Mac (Visual Studio for Mac)?

I'd like to have multiple copies of Xamarin Studio running simultaneously. Once one copy is running, double-clicking the Xamarin Studio icon in /Applications or clicking the currently-running Dock icon simply brings the current one to the…
patridge
  • 26,385
  • 18
  • 89
  • 135
45
votes
6 answers

Xamarin.Android Proguard - Unsupported class version number 52.0

I'm trying to use Proguard in my Xamarin.Android project, yet the compilation fails with the error Unsupported class version number [52.0] (maximum 51.0, Java 1.7) I saw from those two questions that it may be a mismatch between Java 7 and Java 8,…
Eino Gourdin
  • 4,169
  • 3
  • 39
  • 67
44
votes
3 answers

Is it possible to run Xamarin Mono on Linux?

I want to know if it is possible to run Xamarin on Ubuntu. I don't like java, so I want to make Android apps with C#. Is a package for Ubuntu, because I haven't seen one so far? Or... Can I run Xamarin on Ubuntu using Wine? Or... Is there an…
rqmok
  • 834
  • 2
  • 9
  • 20
43
votes
1 answer

Xamarin forms android Application not getting DeviceToken Parse SDK

I'm developing xamarin forms application for both android and iOS. I'm implementing the PushNotifications for the same using Parse SDK. I've added Parse.Android dll in references of .Droid project and Parse.iOS dll in references of .iOS project. My…
Amrut
  • 2,655
  • 3
  • 24
  • 44
43
votes
8 answers

Add elevation/shadow on toolbar for pre-lollipop devices

I updated my android app to the new material design, but I also wanted to add some shadow or elevation to the Toolbar. There seem to be some (hacky) ways of doing it via images/9-patches, but I wonder if it can be done via the support libraries.…
avb
  • 1,558
  • 1
  • 14
  • 37
42
votes
9 answers

Setting the Color of a TextView Drawable

Im trying to change the color of a TextView Drawable in Xamarin. In Java you can do it like this: @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); TextView txt = (TextView)…
CDrosos
  • 2,418
  • 4
  • 26
  • 49
42
votes
2 answers

Global Exception Handling in Xamarin Cross platform

Can you please let me know how to handle the global exception(without App crash) in Xamarin Cross platform project.
41
votes
9 answers

"aapt.exe" exited with code 1 when building Mono for Android project

I put together a fairly simple Mono for Android application that does nothing more than play an "AndroidResource" MP3 in a background service (copied from Greg Shackles latest Visual Studio Magazine article on Background Services in MfA). I put the…
patridge
  • 26,385
  • 18
  • 89
  • 135
40
votes
2 answers

How to add a horizontal 1px line above image view in a relative layout?

How do I add a horizontal 1px white line above image view in a relative layout?
dropsOfJupiter
  • 6,763
  • 12
  • 47
  • 59
40
votes
5 answers

Get current Activity - Xamarin Android

I am developing an portable App for Android and iOS. My current function is taking a Screenshot and use that image in the code. Therefor I have an Interface in the portable library. public interface IFileSystemService { string…
Lexu
  • 579
  • 1
  • 5
  • 14
38
votes
12 answers

Mono.Linker.MarkException: Error processing method: 'System.Void AndroidX.RecyclerView.Widget.RecyclerView/LayoutManager

I am trying to debug my Xamarin project. Framework and all packages are up to date. In iOS it works, but in Android NOT. How can I solve this problem: Mono.Linker.MarkException: Error processing method: 'System.Void…