Xamarin

Xamarin: Android Widget with timer, stops when app killed

感情迁移 提交于 2021-02-11 14:21:49
问题 I have this code: public class MyWidgetProvider : AppWidgetProvider { public override void OnUpdate(Context context, AppWidgetManager appWidgetManager, int[] appWidgetIds) { Log.Debug("WIDGET", "Updating the widget"); // Open app on click RemoteViews views = new RemoteViews(context.PackageName, Resource.Layout.MyWidget); Intent launchAppIntent = new Intent(context, typeof(MainActivity)); PendingIntent launchAppPendingIntent = PendingIntent.GetActivity(context, 0, launchAppIntent,

Xamarin Forms: How to Change the textcolor of Collectionview SelectedItem?

对着背影说爱祢 提交于 2021-02-11 13:59:50
问题 I have a CarouselPage having 5 children and every child has a horizontal collection view. When selecting an item in Collectionview or swiping the pages, I need to give a different text color and need to add an underline for the selected item. I have tried like below: CarouselHomePage.cs public partial class CarouselHomePage : CarouselPage { public List<Activity> activityList { get; set; } public CarouselHomePage() { InitializeComponent(); activityList = new List<Activity>(); AddActivities();

Xamarin Forms: How to Change the textcolor of Collectionview SelectedItem?

怎甘沉沦 提交于 2021-02-11 13:57:40
问题 I have a CarouselPage having 5 children and every child has a horizontal collection view. When selecting an item in Collectionview or swiping the pages, I need to give a different text color and need to add an underline for the selected item. I have tried like below: CarouselHomePage.cs public partial class CarouselHomePage : CarouselPage { public List<Activity> activityList { get; set; } public CarouselHomePage() { InitializeComponent(); activityList = new List<Activity>(); AddActivities();

Xamarin.Forms using Firebase Cloud Message to send notification [duplicate]

我的未来我决定 提交于 2021-02-11 13:49:16
问题 This question already has an answer here : How to setup FCM in Xamarin forms (1 answer) Closed 1 year ago . I'm need to send my Web API notification when user order something on my app, but i dont know how to send Notification to Firebase on Xamarin.Forms. Does anyone have some sample or source code to follow ? 回答1: You need to set up the Notification in specific Xamarin.Android project and Xamarin.iOS project. For Xamarin.Android : You can have a look at official document here and Remote

Webview Video fullscreen

走远了吗. 提交于 2021-02-11 13:48:09
问题 I am loading a YouTube video in my app using web-view. But the full screen option is not working. How can i achieve the full screen. My Code <ContentPage xmlns="http://xamarin.com/schemas/2014/forms" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" x:Class="Player.MainPage"> <StackLayout> <Label Text="Hello"/> <WebView x:Name="browser" Source=

After archiving xamarin forms app to apk, it does not work

江枫思渺然 提交于 2021-02-11 13:47:48
问题 I have my xamarin app, when i start it form VS2019 in Release or Debug mode it works great. If i archive it with visual studio, sign and install to mine or other android phone, it crashes. 回答1: APK can't get SQLite table, because i truncated that at start. Logcat helped me understand what the problem is. 来源: https://stackoverflow.com/questions/61630822/after-archiving-xamarin-forms-app-to-apk-it-does-not-work

SpecialFolder.Personal existing sqlite database

别说谁变了你拦得住时间么 提交于 2021-02-11 13:28:55
问题 On my Xamarin android application i create db path using the "System.Environment.SpecialFolder.Personal". I have an existing sqlite database. Where in the project and with what properties must i include the database to be used in the peronal folder? 回答1: You can use Xamarin.Essentials to access your read-only bundle/asset resource and copy it without have to use native platform code or if you are coding within an Xamarin.Android project, you can directly use Android.Content 's Assets So

Rename a recorded file every time I save a record in xamarin

别等时光非礼了梦想. 提交于 2021-02-11 13:26:04
问题 I am saving my records using this code: string path = Android.OS.Environment.ExternalStorageDirectory.AbsolutePath; public string fileName { get; set; } fileName = Path.Combine(path, "sample.wav"); if (!recorder.IsRecording) { recorder.StopRecordingOnSilence = TimeoutSwitch.IsToggled; //Start recording var audioRecordTask = await recorder.StartRecording(); BtnDoneRec.IsEnabled = false; await audioRecordTask; RecEditor.IsEnabled = true; BtnDoneRec.IsEnabled = false; PlayButton.IsEnabled = true

How to load a Picker in Xamarin forms with data received from the Web Api?

≯℡__Kan透↙ 提交于 2021-02-11 12:46:08
问题 So, this is my Model Class "Usuario" This class has the Foreign key "IdTipoUsuario" that was declared in my database from SQL Server Management Studio. So I placed it here with the "IList" property: namespace APPiGarbage.Models { public class Usuario { public int IdUsuario { get; set; } public string Nome { get; set; } public string Foto { get; set; } public string Descricao { get; set; } public string Email { get; set; } public string Senha { get; set; } public IList<TipoUsuario>

How to load a Picker in Xamarin forms with data received from the Web Api?

百般思念 提交于 2021-02-11 12:45:24
问题 So, this is my Model Class "Usuario" This class has the Foreign key "IdTipoUsuario" that was declared in my database from SQL Server Management Studio. So I placed it here with the "IList" property: namespace APPiGarbage.Models { public class Usuario { public int IdUsuario { get; set; } public string Nome { get; set; } public string Foto { get; set; } public string Descricao { get; set; } public string Email { get; set; } public string Senha { get; set; } public IList<TipoUsuario>