xamarin.android

How to get the Resource.Id from Value?

瘦欲@ 提交于 2019-12-21 21:36:41
问题 I have a image called(my_image.png) in my Drawable-mdpi folder. my android application interacts with a webservice. It might send back "my_image". My android application should load up this image. I am using Monodroid and I tried this int abc = Resources.GetIdentifier("my_image","drawable",null); Yet the result is always "0" . When it should be(from the resource file) // aapt resource value: 0x7f020000 public const int my_image = 2130837504; Looking around and the android way seems to be

Xamarin Android: Shared MonoRuntime error

旧巷老猫 提交于 2019-12-21 21:27:53
问题 I am developing an android app with Xamarin. I tested in successfully through emulator and in test cloud manually but when I am trying to run it through VSTS, I am getting: Mono Shared Runtime is not supported. This can be resolved by changing the project configuration or using a Release build. I checked my android project file, shared mono runtime is turned off. Can anyone tell me what could cause this issue and how to resolve it? 回答1: Right click to your Android Project -> Properties

How to add Xamarin Forms content as a subview in Xamarin.Android and Xamarin.iOS

别等时光非礼了梦想. 提交于 2019-12-21 20:48:53
问题 We have a "legacy" Xamarin.Android and Xamarin.iOS project. We would like to inject a Xamarin Forms component as a subview into a "native" Android and iOS view. The component is only available as a Xamarin Forms component and it is too expensive rewrite the entire app to Xamarin.Forms. The main question is how can we add complex Xamarin.Forms layouts as a subview in a "native" Xamarin.Android or Xamarin.iOS view? We have done some proof of concept work, and have successfully injected a XF

how to set the seek bar thumb with a layout or with a TextView?

本秂侑毒 提交于 2019-12-21 20:47:09
问题 i want my seek bar to look like this... the TextView should move with the thumb of seek bar... i tried with seek_needle.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" > <TextView android:layout_width="match_parent" android:layout_height="wrap_content" android:text="" /> <ImageView android:layout_width="25dp" android:layout

Monodroid JavaScript Interface

≡放荡痞女 提交于 2019-12-21 19:27:13
问题 Monodroid does not yet natively support JavaScriptInterface with WebView. I'm looking for an example .java file that can be used with this workaround. IntPtr JavaScriptInterface_Class = JNIEnv.FindClass ("the/package/for/JavaScriptInterface"); IntPtr JavaScriptInterface_ctor = JNIEnv.GetMethodID (JavaScriptInterface_Class, "<init>", "()V"); IntPtr instance = JNIEnv.NewObject (JavaScriptInterface_Class, JavaScriptInterface_ctor); appView.AddJavascriptInterface (new Java.Lang.Object (instance),

Mono for droid app size

隐身守侯 提交于 2019-12-21 18:01:50
问题 what would be typical app size made with mono droid? I'm talking about "hello world" type of app. 回答1: With full linking enabled, currently the Hello World sample app is around 4MB in size. I say currently because I know the team is always working on improving the linker to bring app size down even more, so it's likely to go down even further in the future. You can read about the linker here. 来源: https://stackoverflow.com/questions/8294346/mono-for-droid-app-size

Using AIDL with Mono for Android

て烟熏妆下的殇ゞ 提交于 2019-12-21 18:00:33
问题 Not being patient enough for the Mono for Android book I started going through the Android programming constructs and translate them to the Mono infrastructure. Seems like most the time the good folks at Xamarin and I think along similar lines so progress has been relatively pain free but on the AIDL issue I'm stuck. Was AIDL implemented? If so, how can I use it? If not, what is the recommended way to use IPC? 回答1: AIDL is, lamentably, something that isn't readily supported at this time. It

How to use Android AutoCompleteTextView on Xamarin.Forms

不打扰是莪最后的温柔 提交于 2019-12-21 12:40:22
问题 I'm working on a Xamarin.forms project but i need to use Android.Widget.AutoCompleteTextView how can i apply that? When i am trying to add AutoCompleteTextView UserNameAutoComplete; to ContentPage i get the following error: Content = new StackLayout { VerticalOptions = LayoutOptions.Center, Padding = new Thickness(25), Children = { UserNameAutoComplete, passwordEditor, } }; cannot convert from 'Android.Widget.AutoCompleteTextView' to 'Xamarin.Forms.View' 回答1: Android.Widget

Portable Class Library assembly reference problems in MonoDroid and MonoTouch

我只是一个虾纸丫 提交于 2019-12-21 12:32:00
问题 I have problem in my project where I have PCL for .Net 4.5, Windows Phone 8, WinRT, MonoTouch and MonoDroid, when I try to build MonoDroid or MonoTouch project that have reference to that PCL errors are following: *Error 1 The type 'System.Object' is defined in an assembly that is not referenced. You must add a reference to assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Error 2 The type 'System.Enum' is defined in an assembly that is not

Android App is too large and Linking disables functionality

﹥>﹥吖頭↗ 提交于 2019-12-21 10:48:03
问题 I'm done with my app and now I'm trying to build the .apk and test it on my phone (without debug, in release mode). Setting the Linking to " None " everything works fine. The Problem here is, that the App is too large - its 20MB and thats rubbish. I read that article about Linking: Click Here So I tried " Sdk Assemblies Only " and " Sdk and User Assemblies ". The second option (Both Assemblies) failed directly, I wasn't even able to see the first screen (Login) of my App. With Linking set to