xamarin.android

Xamarin HttpClient.GetStringAsync not working on Xamarin.Droid

江枫思渺然 提交于 2019-12-12 17:15:51
问题 I'm really new in Xamarin development, and I just tried Xamarin.Forms to Develop Android & iOS App with shared Code, and what I'm trying to do here is to get data from API with Plugin.RestClient NuGet package. Here's my MainViewModel. public MainViewModel(){ InitializeDataAsync(); } public async Task InitializeDataAsync(){ var employeeServices = new EmployeeServices(); EmployeesList = await employeeServices.getEmployeesAsync(); } And here's my Services public async Task<List<Employee>>

Xamarin Forms PopAsync crash

会有一股神秘感。 提交于 2019-12-12 16:10:26
问题 I have built a Xamarin forms app with PCL. The application crashes sometimes on await Navigation.PopAsync(); I have found this https://forums.xamarin.com/discussion/62414/app-resuming-results-in-crash-with-formsappcompatactivity, but it's doesn't help It appears only on android 5.0 and above. I'm using Xamarin.Forms 2.3.3 Here is crash log: Xamarin caused by: android.runtime.JavaProxyThrowable: System.AggregateException: A Task's exception(s) were not observed either by Waiting on the Task or

Invalid certificate received from server xamarin.android

…衆ロ難τιáo~ 提交于 2019-12-12 16:01:00
问题 So this is driving me crazy for 1 day now. I'm trying to talk to a REST API on xamarin.android but for some reason I get this error: InnerException {Mono.Security.Protocol.Tls.TlsException: Invalid certificate received from server. Error code: 0xffffffff800b010a at Mono.Security.Protocol.Tls.Handshake.Client.TlsServerCertificate.RemoteValidation (Mono.Security.Protocol.Tls.ClientContext context, AlertDescription description) [0x00000] in :0 at Mono.Security.Protocol.Tls.Handshake.Client

Title cutoff in tabbed page in Xamarin.Forms

梦想与她 提交于 2019-12-12 13:25:15
问题 Tabbed page title cut off in tabbed page in Android but working fine in iOS Device i am using this code public Tabbar() { //this.BarTextColor = Color.Maroon; // New Feed var navigationNewFeed = new NavigationPage(new NewFeedView()); navigationNewFeed.Title = "News Feed"; navigationNewFeed.Icon = "news"; Children.Add(navigationNewFeed); // Volunteer View var navigationPageVolunteer = new NavigationPage(new VolunteerView()); navigationPageVolunteer.Icon = "Volunteer"; navigationPageVolunteer

Xamarin.Forms with Prism not building in Visual Studio 2017 15.7.2

有些话、适合烂在心里 提交于 2019-12-12 13:13:41
问题 I have a Xamarin.Forms with Prism MVVM, having build problem in Visual Studio 2017 15.7.2. This project was created in Visual Studio 2017 15.6.2, with Prism template, and was working perfectly. I decided to update my IDE from 15.6.2 to 15.7.2, and my project stops working, getting the error below: Severity Code Description Project File Line Suppression State Error Your project is not referencing the "MonoAndroid,Version=v8.1" framework. Add a reference to "MonoAndroid,Version=v8.1" in the

IDE0006 Error running Xamarin Android project in Visual Studio

流过昼夜 提交于 2019-12-12 12:58:44
问题 I had just created a new Visual Studio for Cross-Platform project. Clean the solution, rebuild solution, run the Android project and it took forever to compile and finally the emulator shows up. And after awhile I get that "Warning IDE0006..." error. I've clicked the IDE0006 link and points me to the same place with no recommendation to solve or debug it. 回答1: This one took me 75 days of blood, sweat, and tears to puzzle through. Right-click on the Solution (at the very top of the Solution

Xamarin.Android How to set the ripple effect programmatically on any view?

我怕爱的太早我们不能终老 提交于 2019-12-12 12:44:21
问题 First time asking a question here so lets see... I'm having trouble with setting the ripple effect programmatically onto a CardView. (But i hope to find a way that works basically on any kind of view) The thing is, my cards are made programmatically like this : ... //make cardview CardView result = new CardView(Activity); //set layout LinearLayout.LayoutParams layoutParams = new LinearLayout.LayoutParams(0, 100, 1f); layoutParams.SetMargins(10, 10, 10, 10); result.LayoutParameters =

System.Net.WebException: Error: NameResolutionFailure when Calling WCF Services throwing exception in mono android application

ε祈祈猫儿з 提交于 2019-12-12 12:41:09
问题 I am working on Mono Android Mobile applicaiton. I am calling my WCF Services in my applicaiton, I added wcf services using ->Add WebRefernce option of Project Menu. My Problem is I am getting exception when i am running the calling the wcf services on the device. Exception : {System.Net.WebException: Error: NameResolutionFailure at System.Net.HttpWebRequest.EndGetRequestStream (IAsyncResult asyncResult) [0x00000] in :0 at System.Net.HttpWebRequest.GetRequestStream () [0x00000] in :0 at

How do I access/read from/write to Documents folder in Internal Storage on Android devices?

依然范特西╮ 提交于 2019-12-12 12:25:14
问题 How do I access public Documents folder on an Android phone's internal storage? I need to read and write publicly-accessible files into the Documents folder. 回答1: don't forget to add permission to androidmanifest.xml <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/> sample of writing // write on SD card file data in the text box try { File myFile = new File("/sdcard/mysdfile.txt"); myFile

OnTokenRefresh never called in Xamarin Android

柔情痞子 提交于 2019-12-12 12:19:02
问题 I'm trying to implement remote notifications in my Xamarin Android project. I followed step-by-step directions found in various guides but the OnTokenRefresh method is never called, even the first time, so it looks like my app does not receive any kind of token or even does not make any type of firebase registration. I have added Firebase to my Android app and downloaded google-services.json I included google-services.json in my Xamarin Android Project and set the Build Action to