Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all 91519 articles
Browse latest View live

How to activate and authorize geolocation

$
0
0

Hello,
I am trying to create a cross-plateform implementation consists of a webView.
This is the webview

This site requires access to GPS when you click on the button at the top left.
I already create the same application native android, so I know it must both add permission in the manifest and authorization in the app settings in the following screenshot:

Part that I never managed to do by code, by the way.
I activated it and under Xamarin I added this in the AndroidManifest.xml:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-feature android:name="android.hardware.location" android:required="false" />
<uses-feature android:name="android.hardware.location.gps" android:required="false" />
<uses-feature android:name="android.hardware.location.network" android:required="false" />

And the following code into AssemblyInfo.cs:

[assembly: UsesPermission(Android.Manifest.Permission.AccessCoarseLocation)]
[assembly: UsesPermission(Android.Manifest.Permission.AccessFineLocation)]
[assembly: UsesFeature("android.hardware.location", Required = false)]
[assembly: UsesFeature("android.hardware.location.gps", Required = false)]
[assembly: UsesFeature("android.hardware.location.network", Required = false)]

So when you click on the button you must have this :

But the geolocation not working. I must be missing something but I don't know what. Can someone help me?


Tree View in Xamarin forms.

$
0
0

Hello guys,
Is there any way to implement Tree View in Xamarin forms ? If yes then please let me know how ?

Thank you.

Is it possible for MediaPlayer setDataSource to play incomming stream?

$
0
0
I was wondering, if it would be possible for the setDataSource to play incomming stream of parts of music each time in a loop, and not a whole file?

how to use two models in mvvm constructor with ID to fetch data ?

$
0
0

in my xamarin forms project, i have two models. the first model contains the information relating to a document (ID, Title, number, date, description), and the second model **contains the types of documents (Id, type of document).** When entering information on the form, the second model is used as a spinner which displays the document types. what i want is to be able to save the type of document selected in the sqlite database and be able to retrieve it in the info update interface****

arm64-v8a architecture not supported

$
0
0

Ooops, I started getting this error when I try to publish my APK to Google Play from VS 2019 on Windows.
It's always worked, and these are the only options I have:

The log says that for every architecture:

Is there a solution to this? What am I supposed to do? Thanks

how can i update a listview with a button?

$
0
0

I am making a clone of a social network and in a list of comments.
I want to register one and instantly the list is updated and the record I made appears.

Can usage of Command where T : new() lead to hard to detect bugs?

$
0
0

Let's say I have a property on my ViewModel of type Command<Order> and a custom control in a View binds to it. On some event, the custom control executes the command and passes Order object to it.

At some time, the custom control is refactored, and now it executes the command with RefactoredOrder object. My ViewModel Command<Order> would execute only if Order type is passed to it and I would have a bug which is only detectable in run-time.

To make the bug more obvious in run-time, should we avoid usingCommand<T> where T : new(), and use Command<object>, check the if the object is of expected type and throw exception if it's not.

If we do the latter, we would crash the app and the QA would clearly notice the issue.
If we use Command<T> where T : new(), the QA might think that the behaviour where command didn't execute is expected and might not notice it.

Wierd entry effect on Android upon Forms 4.4

$
0
0

Hi,
After upgrading forms from 4.3 to 4.4 all android entries now show me an ugly fading indicator upon page appearing. In different projects, different layouts and pages, with or without any custom renderer, the only thing that made that happend was forms 4.4, on 4.3 it's all fine,
I just can't track where it comes from, in theory would need to compare renderers between 4.3 and 4.4, but if someone could direct me on where this effect could come from that would be awesome.


Can I get Alarm Notifications in Xamarin.UWP ??

$
0
0

I want to implement Alarm based Notification in Xamarin.UWP . I have implemented the same alarm notification feature for Xamarin Android and iOS using ILocalNotificationService . But , I am finding it difficult to implement it in UWP platform. My aim is to run the same code on all 3 platforms. So, that I can receive reminders for the meetings.

Is there any method through which it can be implemented ??? Please let me know.

Thanks.

FFImageLoading Android Distortion Problem

$
0
0

I'm having an odd issue with FFImageLoading images in XF Android. The first time the image is displayed, everything is perfect. But then for all subsequent displays (anywhere in the app), the image is oddly distorted.

If I simply re-layout the content, there is no problem. It only happens when there is a new instance with the same image being displayed. The problem does not happen at all on iOS.

I am using 2.4.4.859.

Any ideas? Thanks in advance!

puedo usar imagenes de los recursos mipmap?como llamo las imagenes de las carpetas mipm desde xaml?

$
0
0

ver archivo adjunto...
puedo usar imagenes de los recursos mipmap?como llamo las imagenes de las carpetas mipmap desde xaml?

how to implement fingerprint scaning in login form.

$
0
0

I am trying to implement fingerprint in xamarin .

` var cancellation = new System.Threading.CancellationToken();

        var auth = await CrossFingerprint.Current.AuthenticateAsync("Please place your finger",cancellation); `

in second line, cannot convert from 'string' to 'Plugin.Fingerprint.Abstractions.AuthenticationRequestConfiguration' this error is occuring.

In MainActivity.cs

CrossFingerprint.SetCurrentActivityResolver(() => CrossCurrentActivity.Current.Activity); in this line error occurs.
CrossFingerprint does not contain definition for SetCurrentActivityResolver.

How can i implement fingerprint scanning .please help

Google Login doesn't redirect back to app

$
0
0

Well, First then nothing, I don't speak english very well..

My problem is the next, I'm trying to implement a Google Login in my app, with next two references:
1. https://jorgediegocrespo.wordpress.com/2018/12/19/login-en-google-desde-xamarin-forms/
2. timothelariviere.com/2017/09/01/authenticate-users-through-google-with-xamarin-auth/

Well, when I select a google account the next page that appear "google.com", and I dontn't knows why.

First: OPEN THE NATIVE BROSER

Seccond: com.companyname.Auth, is my package android name in the AndroidManifest.xml

Next, When I select an account appear this page with a label "Espera un momento ~ Wait a moment"

And for last appear the Google homepage and don't return to my App :(

When I close the Navigation native Browser appear this Message

In Google Developer Console my OAth Consent Screem is this:

When I call the OAth2 Constructor the redirect URL than i use is this:
com.companyname.Auth:/oauth2redirec

My Source is the same than the first url reference:

I used in one moment the video tutorial of Houssem Dellai...

https://youtube.com/watch?v=AgFIsVr26zg

In his tutorial he uses a webview in the shared code, but i readed that google don't admit this solution now, and when i run the webview i have another error from Google.

I don't understand what is my problem.. i have several days trying this :( please help!!

Xamarin Essentials Sensors Reading

$
0
0

I'm trying to use XamarinEssentials to get sensors reading at the highest speed possible.
Trying to use SensorSpeed.Fastest, I'm still getting all the events on the Main/UI thread (which is for sure not the fastest way).
I hoped to find a way to get the events on other threads so I can collect more samples from the sendors.

Any sensor that we start with SensorSpeed.Fastest is claimed to "Get the sensor data as fast as possible (not guaranteed to return on UI thread)."

Tried the following code on multiple devices (and different sensors). Always same results (all notifications are always in the main/ui thread).
Am I doing anything wrong?

Note:

  • I'm using Xamarin Forms
  • Tested on Android devices

Here is a code snippet that demonstrated my issue:

Magnetometer.ReadingChanged += Magnetometer_ReadingChanged;
Magnetometer.Start(SensorSpeed.Fastest)
...

void Magnetometer_ReadingChanged(object sender, MagnetometerChangedEventArgs e)
{
** // This always received on ThreadId=1 (Main/UI Thread)...**
Console.WriteLine($"Thread: {Thread.CurrentThread.ManagedThreadId},. Reading: {data.MagneticField.}");
}

How to display a custom back button instead of navigation bar in Tabbed page

$
0
0

I need to change the back navigation bar to button on the tabbed page. How can I do this functionality?


Custom Renderer JustificationMode Error !

$
0
0

Hi everyone!

I implemented a custom renderer to use justification mode in the labels in my Xamarin forms project. There was no problem with the emulator. But when I try on a real android device I get an error like this. How can i solved ?

CustomLabelRenderer.cs (Android)

using System;
using Android.Content;
using Android.Text;
using GulaylarMenuDesign.Droid.Renderer;
using Xamarin.Forms;
using Xamarin.Forms.Platform.Android;

[assembly:ExportRenderer(typeof(GulaylarMenuDesign.Behaviors.CustomLabel),typeof(CustomLabelRenderer))]
namespace GulaylarMenuDesign.Droid.Renderer
{
    public class CustomLabelRenderer:LabelRenderer
    {
        public CustomLabelRenderer(Context context):base(context)
        {

        }

        protected override void OnElementChanged(ElementChangedEventArgs<Label> e)
        {
            base.OnElementChanged(e);
            if (Control != null)
            {
                Control.JustificationMode = JustificationMode.InterWord;
            }
        }
    }
}

A Xamarin Chatbot that doesn't use Bot Framework

$
0
0

Hello, I'm creating an app in Xamarin.Forms and I'd like it to have a chatbot feature. After searching online I've seen a lot of solutions that use Microsoft Bot Framework or Azure Bot Services but I do not want to use these due to not having a paid account. I'd like to know if there's any alternative way to create a chatbot with Xamarin?

Not able to update SupportPieChartExtended piechart center text from viewmodel

$
0
0

<chart:SupportPieChartExtended BackgroundColor="Red" CenterText="{Binding SelectedCategoryTotalAmount}" x:Name="pieChart" RotateEnabled="False" HeightRequest="180" WidthRequest="180" ExtraTopOffset="0" ExtraBottomOffset="0" TransparentCircleRadiusPercent="0" HighLightPerTapEnabled="False" HorizontalOptions="FillAndExpand"

                                           ChartData="{Binding SalaryData}" VerticalOptions="FillAndExpand"  />

I am able to Set ChartData from ViewModel (from SalaryData list from ViewModel).. which is showing the piechart data as expected but CenterText (SelectedCategoryTotalAmount variable in viewModel) but nothing is updated.

class ViewModel {
public string CenterTextDescription { get => _centerTextDescription; set { SetProperty(ref _centerTextDescription , value); } }
}

I am using prism framework with https://github.com/bulubuloa/Ultimate-Xamarin-Forms-KIT library.

Crash after iOS app launch

$
0
0

Hello devs...I'm running into an issue where my app launches and then immediately crashes. The app will run fine in dev and even if I push a release version directly to the phone - no errors or crashes. Only crashes with an appstore build. Looking at the Device Log, this is the only instance of an error with the app? Using VS 2019 for Mac with latest updates and packages.

Error (72) / assertiond: SyscallError: setpriority(PRIO_DARWIN_ROLE, 10656, 3): No such process

Something to do with load arguments? Just difficult to troubleshoot since this only happens with the appstore.

Any suggestions or help would be greatly appreciated.

Android : Picker displays 0 when it's empty

$
0
0

Hi,

I works on a Xamarin Forms app and I'm facing a strange behaviour.
When there is no value in list, Pickers display "0" (Android).
How can I hide this or perhaps change default text ?

Regards,

Viewing all 91519 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>