xamarin.android

Xamarin Show Keyboard and Focus on an Entry Field

a 夏天 提交于 2021-02-13 17:34:03
问题 I am using Xamarin.Android and I have a Dialog with Xamarin.Forms.Entry field in it. How do I show keyboard and give focus to this Entry field when dialog is displayed? I am using a device, not an emulator. 回答1: Can you try this, dialog.Appearing += (object sender, System.EventArgs e) => yourEntry.Focus (); When you focus to the entry, Keyboard will be shown by default Here is the sample, i have tried to show keyboard in button click <StackLayout> <Entry x:Name="entry" HeightRequest="50"

How to Design Hexagon In Xamarin Form Android Visual Studio 2019

不羁的心 提交于 2021-02-11 18:21:00
问题 i need to develop android application with xamarin android using visual studio 2019, my goal is create design hexagon in form xml. for detail ilustration like below : i have image like below: and then i wanna place that picture in the grid, with expectation like below : i try code like this : <?xml version="1.0" encoding="utf-8" ?> <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

Camera capture image rotate to portrait - Xamarin android

女生的网名这么多〃 提交于 2021-02-11 16:48:21
问题 I have a xamarin.android project which have a custom camera Preview. Whenever I initialize the camera , it will open as landscape default. So I changed the orientation from SurfaceChanged method like this. private int setCameraDisplayOrientation(Activity mContext, int v) { var degrees = 0; var orientation =0; Display display = mContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>().DefaultDisplay; Camera.CameraInfo info = new Camera.CameraInfo(); Camera.GetCameraInfo(v,

Camera capture image rotate to portrait - Xamarin android

混江龙づ霸主 提交于 2021-02-11 16:44:51
问题 I have a xamarin.android project which have a custom camera Preview. Whenever I initialize the camera , it will open as landscape default. So I changed the orientation from SurfaceChanged method like this. private int setCameraDisplayOrientation(Activity mContext, int v) { var degrees = 0; var orientation =0; Display display = mContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>().DefaultDisplay; Camera.CameraInfo info = new Camera.CameraInfo(); Camera.GetCameraInfo(v,

Camera capture image rotate to portrait - Xamarin android

天大地大妈咪最大 提交于 2021-02-11 16:44:44
问题 I have a xamarin.android project which have a custom camera Preview. Whenever I initialize the camera , it will open as landscape default. So I changed the orientation from SurfaceChanged method like this. private int setCameraDisplayOrientation(Activity mContext, int v) { var degrees = 0; var orientation =0; Display display = mContext.GetSystemService(Context.WindowService).JavaCast<IWindowManager>().DefaultDisplay; Camera.CameraInfo info = new Camera.CameraInfo(); Camera.GetCameraInfo(v,

Returning to previous activity in Xamarin Android

本秂侑毒 提交于 2021-02-11 15:02:59
问题 I have two activities: MainActivity and Activity2 : public class MainActivity : AppCompatActivity { DateTime time = DateTime.Now; protected override void OnCreate(Bundle savedInstanceState) { base.OnCreate(savedInstanceState); Xamarin.Essentials.Platform.Init(this, savedInstanceState); SetContentView(Resource.Layout.activity_main); var button = FindViewById<Button>(Resource.Id.button); button.Text = "Button created at " + time.ToString(); button.Click += (s, e) => { Intent intent = new Intent

android - Alarm stops firing after some time

非 Y 不嫁゛ 提交于 2021-02-11 14:24:35
问题 I have an alarm that fires every hour and executes code in specific conditions It works smoothly, but when I leave my app unopened (the alarm initialization is on app startup) it stops after some time, these are the logs: 8/2/2020 6:27 AM Initializing Alarm, next alarm will fire at 8/2/2020 3:27 AM 8/2/2020 6:27 AM Application starting. 8/2/2020 6:28 AM Application stopped. 8/2/2020 6:28 AM Reports alarm received. 8/2/2020 7:28 AM Reports alarm received. 8/2/2020 8:28 AM Reports alarm

How to extract temperature decimal value from a Bluetooth LE (SIG) hex value

扶醉桌前 提交于 2021-02-11 13:58:57
问题 I'm developing a xamarin android app to connect to a bluetooth low energy thermometer. I can already connect and read its value. My problem is that it's in hexadecimal format and i haven't found a way to extract its value in a decimal (celsius) format. Here's some sample readings: For 36.0 celsius i got 06-68-01-00-FF-E2-07-03-0A-15-34-00-02 For 36.2 celsius i got 06-6A-01-00-FF-E2-07-03-0A-14-14-00-02 For 36.8 celsius i got 06-70-01-00-FF-E2-07-03-0A-14-1B-00-02 For 34.6 celsius i got 06-5A

How to extract temperature decimal value from a Bluetooth LE (SIG) hex value

*爱你&永不变心* 提交于 2021-02-11 13:58:56
问题 I'm developing a xamarin android app to connect to a bluetooth low energy thermometer. I can already connect and read its value. My problem is that it's in hexadecimal format and i haven't found a way to extract its value in a decimal (celsius) format. Here's some sample readings: For 36.0 celsius i got 06-68-01-00-FF-E2-07-03-0A-15-34-00-02 For 36.2 celsius i got 06-6A-01-00-FF-E2-07-03-0A-14-14-00-02 For 36.8 celsius i got 06-70-01-00-FF-E2-07-03-0A-14-1B-00-02 For 34.6 celsius i got 06-5A

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=