xamarin.android

WebRequest not working with ssl on Xamarin.Forms, despite servicePointManager hack

白昼怎懂夜的黑 提交于 2019-12-23 17:04:08
问题 I am writing an application that needs to read from a REST api that is only available over https. I am running into the issue where the request fails in Mono.Security, with the message: "The authentication or decryption has failed." I did my research and found that Mono by default doesn't have any trusted certificates. All the sources I found said that I could use ServicePointManager.ServerCertificateValidationCallback += new RemoteCertificateValidationCallback((sender, certificate, chain,

Asynchronously Load Image from URL into ImageView in Xamarin Android

为君一笑 提交于 2019-12-23 16:34:07
问题 I have a ListView of multiple items and each item in the list should have an image associated with it. I have created an Array Adapter to hold each list item and have the url of the image I wish to load. I am trying to asynchronously load the image using a web request and have it set the image and update it in the view once it has been loaded but the view should render immediatly with a default image. Here is the method I am using to try to load the image private async Task<Bitmap>

VideoView callback end video

北战南征 提交于 2019-12-23 15:39:58
问题 I am using this piece of code in order to play a video: string videoUriString = "android.resource://" + this.PackageName + "/" + Resource.Raw.video; Android.Net.Uri videoURI = Android.Net.Uri.Parse(videoUriString); video.SetVideoURI(videoURI); video.Start(); But I am really frustrated because I don't understand how attach a callback for handle the end of the video, I have to use Monodroid, then C# 回答1: myVideoView.setOnCompletionListener(new OnCompletionListener() { @Override public void

xamarin support in Add Portable Class Library dialog

爱⌒轻易说出口 提交于 2019-12-23 12:24:07
问题 What are the steps required to make the two items available in the Add Portable Class Library dialog? 回答1: Please see my answer in Creating a PCL that targets Monodroid In the meantime, there are quite a few blog posts around on how to get PCLs working unofficially - eg.: http://blogs.endjin.com/2013/05/xamarin-platform-setup-gotchas/ http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html 来源: https://stackoverflow.com/questions/16678066/xamarin-support-in-add-portable

Xamarin Android 10 Install APK - No Activity found to handle Intent

℡╲_俬逩灬. 提交于 2019-12-23 10:13:48
问题 I want to install a 3rd party app from the filesystem from my xamarin android app. The code I used successfully before Android 10 was pretty straightforward and easy. Intent intent = new Intent(Intent.ActionView); Uri data = Uri.FromFile(file); intent.SetDataAndType(data, "application/vnd.android.package-archive"); context.StartActivity(intent); This code does not work on Android 10 because of ACTION_VIEW and ACTION_INSTALL_PACKAGE were deprecated in Android 10. Looks like we now need to use

Setting dialog button clicklistener in Android Xamarin

允我心安 提交于 2019-12-23 10:04:08
问题 I want to display a dialog alert in my Xamarin Android app (C#), and I want to do stuff to the dialog when I click on the buttons. From before, I use this code: AlertDialog.Builder builder = new AlertDialog.Builder(this) .SetTitle("Delete") .SetMessage("Are you sure you want to delete?) .SetPositiveButton("No", (senderAlert, args) => { }) .SetNegativeButton("Yes", (senderAlert, args) => { DatabaseHelper.Delete(item); }); builder.Create().Show(); To make a random example, lets say I want to

can I use adb shell to send commands to my application

我的未来我决定 提交于 2019-12-23 09:51:36
问题 I want to find a way to create commands that I can send to my application using the adb shell or similar. This way I can do some small changes to my program without having to reload my application every time I change anything. Is there a way to open the adb shell and send a command to a running application ? If that is not possible, then what is a possible way to send commands to my application so I can do things like (Move the UI Elements) or (Create a file from a URL) or a number of other

How to prevent Android app from getting uninstalled during deployment with Xamarin Studio?

十年热恋 提交于 2019-12-23 09:40:09
问题 Every time I deploy a new version of an Android app with Xamarin Studio the app gets uninstalled first and then installed again. This is causing some problems for me because I'm using XPrivacy on my devices. I wonder if there is a way to simply deploy the new version without uninstalling them in the first place (like when deploying with Android Studio or Eclipse)? 回答1: When building and deploying apps to your device, by default Xamarin will delete any existing application data/cache. This is

TextInputEditText: ArgumentNullException: missing source event info in MvxWeakEventSubscription

梦想与她 提交于 2019-12-23 09:30:25
问题 All of a sudden the binding for my TextInputEditText started failing, and it has something to do with the Linker. If I set the linker to "None", everything works as intended. Alot of other bindings im using still works just fine. Stack im getting: Exception thrown during the view binding ArgumentNullException: missing source event info in MvxWeakEventSubscription Parameter name: sourceEventInfo at MvvmCross.Platform.WeakSubscription.MvxWeakEventSubscription 2[TSource,TEventArgs]..ctor

How to convert dp to px in xamarin.android?

时间秒杀一切 提交于 2019-12-23 07:27:33
问题 I want to convert dp to px in my C# code in xamarin.android , but all I could find were java codes in android studio that have some problems in xamarin . I tried to use equivalent like using Resources instead of getResources() and I could solve some little problems, but there are some problems yet that I couldn't find any equivalent for them. here are original codes, my codes, and my codes problems in xamarin: First code (found from Programatically set height on LayoutParams as density