Xamarin

Xamarin Async method usage OnStart()

北慕城南 提交于 2021-02-20 14:50:33
问题 Is it considered a good practice to call an Async method that does some heavy lifting with server connections and data exchange during OnStart() event of the application given that this method does not touch the UI thread? Are all the components of the application properly initialized at the time of this event firing for the Async method to be able to execute? protected override async void OnStart() { sendHttpRequestAsync(); } private async void sendHttpRequestAsync() { await ... } 回答1: Avoid

Xamarin C# Android Call Logs

徘徊边缘 提交于 2021-02-20 04:34:42
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

Xamarin C# Android Call Logs

邮差的信 提交于 2021-02-20 04:34:13
问题 Im having trouble with this call logs of the device. The code is not returning the logs at all, It's giving false data. Code: public void ReadCalls() { try { Android.Content.Context myContext = Android.App.Application.Context; string myDateToCheck = myServiceRef.myTimeToCheck("CallLog"); if (myDateToCheck==null || myDateToCheck=="") {myDateToCheck = "0";} ICursor cursor = myContext.ContentResolver.Query( Android.Net.Uri.Parse ("content://call_log/calls"), null, "Date > ?", new string[]

NuGet package from PCL

廉价感情. 提交于 2021-02-20 03:42:26
问题 I have a PCL library I want to distribute as NuGet package. Screenshot of the PCL application library properties page: csproj file: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Steps to reproduce my problem: Clone both repos from: NuGet package Console application + PCL library Build the NugetPackage project +

NuGet package from PCL

流过昼夜 提交于 2021-02-20 03:40:38
问题 I have a PCL library I want to distribute as NuGet package. Screenshot of the PCL application library properties page: csproj file: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Steps to reproduce my problem: Clone both repos from: NuGet package Console application + PCL library Build the NugetPackage project +

NuGet package from PCL

拜拜、爱过 提交于 2021-02-20 03:40:26
问题 I have a PCL library I want to distribute as NuGet package. Screenshot of the PCL application library properties page: csproj file: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Steps to reproduce my problem: Clone both repos from: NuGet package Console application + PCL library Build the NugetPackage project +

NuGet package from PCL

别来无恙 提交于 2021-02-20 03:39:12
问题 I have a PCL library I want to distribute as NuGet package. Screenshot of the PCL application library properties page: csproj file: <TargetFrameworkVersion>v4.5</TargetFrameworkVersion> <TargetFrameworkProfile>Profile111</TargetFrameworkProfile> <ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> Steps to reproduce my problem: Clone both repos from: NuGet package Console application + PCL library Build the NugetPackage project +

Xamarin.Android, AndroidManifest.xml, AndroidManifestMerger, xmlns:tools schema, replace always manually

烂漫一生 提交于 2021-02-19 07:49:05
问题 When compile my Xamarin Forms Android application, visual studio, show me an error's list of AndroidManifest.xml conflict, for example: /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: is also present at AndroidManifest.xml:14:9-41 value=(@string/app_name). (AMM0000) /Library/Frameworks/Mono.framework/External/xbuild/Xamarin/Android/Xamarin.Android.Common.targets(3,3): Error AMM0000: Suggestion: add 'tools:replace="android

Xamarin.Forms: Platform-indepenent application menu

為{幸葍}努か 提交于 2021-02-19 04:39:27
问题 I'm writing a Xamarin.Forms desktop application, and I'll ultimately want to target MacOS and Windows. Does Xamarin.Forms have any platform independent mechanisms which you can use to build the application menu (i.e. the one where you find "File", "Edit", "View", etc; and which appears in the MacOS menu bar at the top of the screen)? The most I've found is the Xamarin.Forms.Menu and Xamarin.Forms.MenuItem classes, but I'm not clear on what they actually do or how to use them. 回答1: Although