xamarin.android

Precision of C# decimal type division is different on Mono?

北慕城南 提交于 2020-01-04 04:10:13
问题 decimal d1 = 4.0m; decimal d2 = 40.0m; decimal d = d1 / d2; string repr = d.ToString(); On Windows, I get "0.1" for repr. On Mono (Xamarin Android), I get "0.1000000000000000000000000000" or so. What gives? Also, I've seen recommendations to divide by 1.0000000000000000000000000000m to get rid of unwanted trailing zeroes. That doesn't work either on Xamarin Android. Known bug? Or technically not a bug - is this allowed in conformance with the standard? To get rid of the zeroes, I'm converting

Binary XML file line #1: Error inflating class android.support.design.widget.AppBarLayout

那年仲夏 提交于 2020-01-03 19:37:13
问题 Hello Everyone There are many threads avilable in this case ... I was tried everything but no luck . I was new to android background..Iam c# guy,now iam work with xamarin droid...So can anyone explain what is the error.this solution not working only **PRE lolipop devices **. My layout <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.CoordinatorLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="

Xamarin: A geolocation error occured: Unauthorized

倖福魔咒の 提交于 2020-01-03 19:13:11
问题 I'm trying to get the current location, and helpfully is working on UWP and iOS but when running it on Andriod it's showing Unhandled Exception. Plugin.Geolocator.Abstractions.GeolocationException: A geolocation error occured: Unauthorized And I already added permissions to my android manifest and it's like this: AndroidManifest.xml <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses

Xamarin.Auth: Account data not persisted when app is updated

非 Y 不嫁゛ 提交于 2020-01-03 19:01:51
问题 I'm using Xamarin.Auth to authenticate with services like foursquare and so. I've gotten my authentication code working all good, the problem is that the account data is not persisted when I deploy a new version of my app - each time I deploy a test version on the phone, I've to re-authenticate. Here's how I store the account; /// <summary> /// Stores the account. /// </summary> private void StoreAccount(AuthenticatorCompletedEventArgs eventArgs) { if (!eventArgs.IsAuthenticated) // make sure

Xamarin.Auth: Account data not persisted when app is updated

 ̄綄美尐妖づ 提交于 2020-01-03 19:01:06
问题 I'm using Xamarin.Auth to authenticate with services like foursquare and so. I've gotten my authentication code working all good, the problem is that the account data is not persisted when I deploy a new version of my app - each time I deploy a test version on the phone, I've to re-authenticate. Here's how I store the account; /// <summary> /// Stores the account. /// </summary> private void StoreAccount(AuthenticatorCompletedEventArgs eventArgs) { if (!eventArgs.IsAuthenticated) // make sure

Splash screen too slow in Xamarin Android

半世苍凉 提交于 2020-01-03 18:59:30
问题 I'm creating an app that shows a splash screen and then creates the main activity. I'm following this tutorial that seems pretty straight forward: https://developer.xamarin.com/guides/android/user_interface/creating_a_splash_screen/ After implementing that I can successfully see the splash but there are some times (1 out of 20) that with an S5 I see the following screen: Followed by the (right) splash (taken from the Emulator but just to make my point): So my guess would be that sometimes

Xamarin.Android binding invalid opcode

给你一囗甜甜゛ 提交于 2020-01-03 18:42:08
问题 Recently received a new Android SDK (aar) to bind in Xamarin. When initially starting the binding I receive the error COMPILETODALVIK : Uncaught translation error : com.android.dx.cf.code.SimException: invalid opcode ba (invokedynamic requires --min-sdk-version >= 26) 回答1: This error is due to the SDK containing Java 8 (v1.8) byte code and it needs to be compatible with Java 7 (v1.7) to support lower API versions of Android. In your Android project (not the binding project), add the following

How to validated fields in an Xamarin/Android app

你离开我真会死。 提交于 2020-01-03 18:35:32
问题 Does any one know how to make a field required in Xamarin/Android app? I have this field and button in my Android Layout, and I'd like to make sure the info is entered before they go to the next activity. <TextView android:text="Zip Code:" android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="match_parent" android:layout_height="wrap_content" android:id="@+id/zipCodeLabel" android:textColor="#000000" android:textSize="20sp" /> <Button android:id="@+id/btnSearch"

How to dynamically change image in MvvmCross

你说的曾经没有我的故事 提交于 2020-01-03 17:56:25
问题 I have both images in the resources folder 1) ImgMsg_Normal.png 2) ImgMsg_Grey.png in Layout file: <ImageView android:id="@+id/imgMsg" android:src="@drawable/ImgMsg_Normal" android:layout_width="wrap_content" android:layout_height="wrap_content" android:maxHeight="80dp" android:maxWidth="80dp" android:layout_margin="20dp" android:scaleType="fitCenter" local:MvxBind =" " /> in code Behind: when this page is loaded, it first displays the said image : ImgMsg_Normal. 1) How to change the image

GetAllNetworkInterfaces() throws exception

假装没事ソ 提交于 2020-01-03 17:12:10
问题 In Mono for Android I'm trying to obtain all the IP addresses for my device within the local network. I don't mind loopbacks but I'm not interested in calling DNS. The best way seems to be calling... using System.Net.NetworkInformation; NetworkInterface[] adapters = NetworkInterface.GetAllNetworkInterfaces(); ...except it throws... System.EntryPointNotFoundException: getifaddrs Any suggestions? 回答1: Unfortunately this is a known bug in Mono for Android. The bug report is available here. 回答2: