xamarin.android

Xamarin.Forms Android AOT support

那年仲夏 提交于 2019-12-24 09:10:02
问题 does anyone know how to use AOT compilation instead of JIT for Xamarin.Forms Android project? Im simply unhappy with the boot times of Android app while iOS starts like it should (since iOS is forced to use AOT). Also in which file specifically should I enable XAMLC? Right now im doing it inside Android project and iOS project AssemblyInfo files. Thanks! 回答1: Within the Release configuration PropertyGroup in your Xamarin.Android 's .csproj file, add a AotAssemblies element that is set to true

StatusBar overlaps NavigationPage on Android from Xamarin.Forms 2.3.4

走远了吗. 提交于 2019-12-24 07:49:14
问题 As shown in the image, when updating Xamarin forms from the latest 2.3.3 version to the first 2.3.4 version, the statusbar overlaps the navigation bar. This behaviour ist still there in current version 2.4.0.38779. No code was changed between those both images despite the Xamarin.Forms update. I use a MasterDetailPage, where the detail part contains a navigation page with a ContentPage inside. No custom stuff, just the default pages. I cannot find any issues relating this nor any breaking

How to use netstandard 2.1 with xamarin Android?

偶尔善良 提交于 2019-12-24 07:35:28
问题 I am running Visual Studio 2019 preview and I have the Android preview sdk installed (9.0.99) But when I try to build a xamarin forms project with a library set to netstandard 2.1. I still het a compatibiliteit error with monodroid. What am I missing? Been searching quite a bit and found something about a mono 2019-06 I believe, but no info on how to get it. 回答1: This github document shows that Xamarin Android support NS2.1 since version 10: So if you use lastest nightly version, you should

How to call a .NET class from a Java class in Mono from Android?

ぐ巨炮叔叔 提交于 2019-12-24 06:45:30
问题 I have implemented a Java activity that displays a Google map view, and would like to use an existing .NET framework class to that returns locations, from a web service, to display on the map. Is this possible or should I just consume the web service in Java? 回答1: You can do this implementing ACW,but i think that it is to difficult and better to use some android framework for this purpose. Also why you can't implement this activity using managed code? 来源: https://stackoverflow.com/questions

In Xamarin.Forms, how can I copy a file from the isolated storage to the Downloads folder?

时间秒杀一切 提交于 2019-12-24 06:35:42
问题 I'm trying to copy my database file from the isolated storage to the Download folder (or any folder that the user can access). Currently my database is stored in: /data/user/0/com.companyname.appname/files/Databases/MyDatabase.db I tried to use this code: public string GetCustomFilePath(string folder, string filename) { var docFolder = System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); var libFolder = Path.Combine(docFolder, folder); if (!Directory.Exists(libFolder))

Enabling PROGUARD - Xamarin.Android

狂风中的少年 提交于 2019-12-24 06:34:23
问题 In the release mode, when i enable only multi dex , my app size is 33.30MB which is quite large. After series of research, i realized PROGUARD shrinks the apk size. Enabling proguard in my solution, i get this error. What could i be missing in my solution for PROGUARD to work (shrink my app size)? PROGUARD : warning : com.facebook.ads.internal.adapters.n$1: can't find superclass or interface com.flurry.android.ads.FlurryAdNativeListener PROGUARD : warning : com.facebook.ads.internal.adapters

Xamarin Android CoordinatorLayout hide/show another layout than toolbar

扶醉桌前 提交于 2019-12-24 06:29:03
问题 I need a help with CoordinatorLayout... I need hide/show toolbar when scrolling and together with this hiding behavior I need make smaller text and hide another layout in my AppBarLayout... My layout looks like this: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:local="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinatorLayout" android:layout_width="match_parent" android

Xamarin forms: Toast Notification in Android & IOS

半城伤御伤魂 提交于 2019-12-24 05:54:16
问题 Hi I am creating an app in xamarin forms using PCL project. I want to implement Toast notification on twice back press only for android and ios. For android I tried - long doublePressInterval_ms = 300; DateTime lastPressTime = DateTime.MinValue; DateTime pressTime = DateTime.Now; if ((pressTime - lastPressTime).TotalMilliseconds <= doublePressInterval_ms) { if(Device.OS == TargetPlatform.Android) { Java.Lang.JavaSystem.Exit(0); } } else { Android.Widget.Toast.MakeText(this, string_name,

Use Mono for android on with Mono

佐手、 提交于 2019-12-24 04:37:11
问题 It looks really easy to switch MonoDevelop's compiler to Mono tools instead of .NET – you just need to pick a different framework under settings of the IDE. However, after switching to Mono and getting the project compiling by Mono tools, Mono for android no longer seems to be an available framework (i.e. the reference to it in the Android project turns red). Obviously, the build fails with tons of errors like Android.XXX.YYY is not a class or namespace name, etc. Is there a way to install

Failed to resolve Android.App.fragment with link SDK assemblies only enabled

余生长醉 提交于 2019-12-24 03:55:29
问题 I'm getting the following error after adding Google Play Services to my application. I have Link SDK Assms Only enabled and it is critical to keep it enabled. Sample here: https://dl.dropboxusercontent.com/u/19503836/so_googlemaptest.droid.zip C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Common.targets(5,5): Error MSB4018: The "LinkAssemblies" task failed unexpectedly. Mono.Cecil.ResolutionException: Failed to resolve Android.App.Fragment at Mono.Linker.Steps.MarkStep