xamarin.android

Is it possible to embed xamarin part into an existing native app?

随声附和 提交于 2019-12-30 22:26:21
问题 I have existing iOS and Android native apps. Is it possible to extend the apps with Xamarin coded part ? 回答1: Both Xamarin.iOS and Xamarin.Android are currently setup to take control of your application, so you need to make your main program be written in C# and then call into the existing code. The way that you would do this is to bind your existing Objective-C or Java code as C# libraries, and then consume those libraries from C#. The binding technology is precisely what drives both the

Xamarin - Convert image to byte array

不问归期 提交于 2019-12-30 13:29:28
问题 I use a media plugin to take or pick a photo from either an Android device or iOS device. I then want to tweet that image using LINQtoTwitter. In order to do that the image needs to be in the format bytes[]. How would I convert my image to bytes in order to upload? Code for getting Image takePhoto.Clicked += async (sender, args) => { if (!CrossMedia.Current.IsCameraAvailable || !CrossMedia.Current.IsTakePhotoSupported) { await DisplayAlert("No Camera", ":( No camera avaialble.", "OK"); return

Xamarin Android : Change UI TextView text from Service or Receiver

妖精的绣舞 提交于 2019-12-30 11:35:12
问题 I have calling app using Twilio api, and i'm trying to change status TextView text after the service established, i searched to much but i didn't find any helpful solution, i want change the text from the service or broadcast receiver . My service code below : [Service] class CallService : IntentService { public static MonkeyPhone phone ; protected override void OnHandleIntent(Intent intent) { throw new NotImplementedException(); } public override StartCommandResult OnStartCommand(Intent

Unable to add Xamarin.Android and Xamarin.iOS to PCL

≯℡__Kan透↙ 提交于 2019-12-30 10:57:06
问题 I'm trying to workout a sample project using MvvmCross, but I'm stuck with the first step of adding the frameworks in VS2012. When I try to add Xamarin.Android and Xamarin.iOS framework in a PCL project, it is showing an error There is no available functionality that is portable between the frameworks you have selected I tried following the steps in this answer, but it didn't worked. Can someone shed some light on this issue. Thanks. 回答1: Recent (mainly good) changes from Microsoft mean that

Monodroid, Interop betwen Java and C#

怎甘沉沦 提交于 2019-12-30 10:37:26
问题 We have a big Java application under Android ("big" just means it's too much work to translate the application). We must access to an engine written in .Net (this engine is also too "big" ...). This engine is only calculation. We therefore seek a solution with monodroid. Our main problem is interop betwen monodroid and Java. At this time, we get : call a Java function in a .jar library from a Mono application But we can not call and start a Java activity. Is it possible ? The second problem

Xamarin forms Shadow on Frame in Android

那年仲夏 提交于 2019-12-30 08:28:33
问题 The Frame class in Xamarin Forms is quite limited, and can't allow me to get a shadow behind the Frame. I've made a custom renderer for iOS using this code: public class RatingInfoFrameRenderer : FrameRenderer { protected override void OnElementChanged(ElementChangedEventArgs<Frame> e) { base.OnElementChanged(e); Layer.BorderColor = UIColor.White.CGColor; Layer.CornerRadius = 10; Layer.MasksToBounds = false; Layer.ShadowOffset = new CGSize(-2, 2); Layer.ShadowRadius = 5; Layer.ShadowOpacity =

How to add System.Drawing in xamarin?

风格不统一 提交于 2019-12-30 08:19:05
问题 I am trying for some time now to add System.Drawing to the references in Visual Studio 2015. Nothing seems to work. When I go into the add reference pane, there is no System.Drawing in the list. I need the Bitmap class from System.Drawing not one from Android.Graphics 回答1: As @Cheesebaron quoted once if forum : If you look at http://docs.xamarin.com/guides/android/advanced_topics/assemblies you will see that System.Drawing is not a part of the Assemblies shipped with Xamarin.Android, the same

“Can not resolve reference: `System.Memory`” or “Could not find `System.Memory`” after update to Visual Studio 2017 version 15.8 Preview

假装没事ソ 提交于 2019-12-30 08:18:09
问题 In case it might help anyone else, I'll ask and answer this little question about an issue that can appear in Xamarin.Android and Xamarin.iOS projects after an update from Visual Studio 2017 version 15.7 to version 15.8 Preview. Example steps to demonstrate the issue Create a new blank Xamarin.Android or Xamarin.iOS project. Add the Microsoft.AspNetCore.SignalR.Client.Core version 1.0.0 NuGet package to the project. Use a type from the NuGet package in the project. For example, add the

Nested shapes in Android

孤街浪徒 提交于 2019-12-30 07:31:36
问题 I am trying to draw a shape that has three rectangular shapes: solid color gradient white line How do I do that? When I try this, it does not work. The layout has the parent color. <shape xmlns:android="http://schemas.android.com/apk/res/android" android:shape="rectangle" android:height="60px" > <shape android:shape="rectangle" android:height="30px" > <solid android:color="#ff297baf" /> </shape> <shape android:shape="rectangle" android:height="30px" > <gradient android:type="linear" android

How to debug: JNI DETECTED ERROR IN APPLICATION: use of invalid jobject

泄露秘密 提交于 2019-12-30 05:04:28
问题 I am working on a Xamarin Android project, and I get the following error (full log here) 11-07 08:28:09.067: A/art(7164): art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: use of invalid jobject 0xd4fd90e0 11-07 08:28:09.067: A/art(7164): art/runtime/java_vm_ext.cc:410] "Thread-1973" prio=10 tid=26 Runnable 11-07 08:28:09.067: A/art(7164): art/runtime/java_vm_ext.cc:410] | group="main" sCount=0 dsCount=0 obj=0x137270a0 self=0xc89d4900 11-07 08:28:09.067: A/art(7164): art