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

Check default sim setting of voice call

$
0
0

Hi i want to check sim setting for voice call such as Always Ask, SIM1 or SIM 2.

If it is always ask i want to give alert to user. Please set either sim 1 or sim 2

Is it possible to check in xamarin?


MediaElement in xamarin forms

$
0
0

Can MediaElement be used to play only audio in background ?

FreshMVVM - Tabbed Navigation ViewIsAppearing not getting fired on initial tab click

$
0
0

I have implemented tabbed navigation using FreshMVVM. When my app launches, I could notice that the 'ViewIsAppearing' method is getting invoked for all the tabs. If I switch to one tab, the 'ViewIsAppearing' in its ViewModel is not getting called. But if go to some other tab and switch back to this same tab, then it works. i.e. 'ViewIsAppearing' is not getting invoked in the initial tab change click. How do I make it invoke in the first attempt itself.
I have come across a github issue similar to this. Just adding for reference
github.com/xamarin/Xamarin.Forms/issues/3855

Unable to make voice call from LTE sim

$
0
0

Unable to make voice call from LTE sim

Is there any issue with LTE and xamarin.

Xamarin Forms on Android System.DllNotFoundException: libmono-native.so

$
0
0

I am seeing the following error on Huawei Android 5.x devices :

Fatal Exception: android.runtime.JavaProxyThrowable: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.TypeInitializationException: The type initializer for 'PanCardView.Droid.CardsViewRenderer' threw an exception. ---> System.TypeInitializationException: The type initializer for 'System.Random' threw an exception. ---> System.DllNotFoundException: libmono-native.so assembly: type: member:(null)
at (wrapper managed-to-native) Interop+Sys.GetNonCryptographicallySecureRandomBytes(byte,int)
at Interop.GetRandomBytes (System.Byte
buffer, System.Int32 length) <0x7f5d43abf0 + 0x0001b> in <9258a17081f54463bdbab7a6f2ecfd9c>:0
at System.Random.GenerateGlobalSeed () <0x7f5d4b1cd0 + 0x00017> in <9258a17081f54463bdbab7a6f2ecfd9c>:0
at System.Random..cctor () <0x7f5d4b1f70 + 0x0000b> in <9258a17081f54463bdbab7a6f2ecfd9c>:0
--- End of inner exception stack trace ---
at PanCardView.Droid.CardsViewRenderer..cctor () <0x7f58f7fe20 + 0x00020> in <2c8a147a111949b3bd5c382644efebe0>:0

The project (release build) is targeting Android 10 (Q) and .NET Standard 2.0.
Anyone has had something similar? A solution?

Thanks,
Tod

CollectionView background color not highting when add the items to the list

$
0
0

Hi, i am using collectionview for selecting multile items. when select the items, background color is coming.but my problem is when add the items to the list , now not getting the background color for iOS . working fine in android .i used in two ways but no luck.

  1. in ViewMode
    var items= ListOfScanTest.Where(x => x.ScanTestsName == SendAppointmentData.Rscantest).ToList();
    SelectedListOfScanTest = items;

  2. in .cs
    collectionList.SelectedItems = SelectedListOfScanTest .Cast < object > ().ToList();

in XAML

please any one help me out from this issue

Xamarin forms how to get Device Token

Push Notification Plugin for Xamarin iOS and Android not working on IOS

$
0
0

Hello i am using https://github.com/CrossGeeks/PushNotificationPlugin with firebase clould massagees work fine on android but i cant get it work with ios if so oi move to use https://github.com/xamarin/GoogleApisForiOSComponents/blob/master/docs/Firebase/CloudMessaging/GettingStarted.md#add-firebase-to-your-app but still cant get it work this my code :

   public override void OnActivated(UIApplication uiApplication)
        {
            base.OnActivated(uiApplication);
            if (UIDevice.CurrentDevice.CheckSystemVersion(15, 0))
            {
                // For iOS 10 display notification (sent via APNS)
                UNUserNotificationCenter.Current.Delegate = new UserNotificationCenterDelegate();
                var authOptions = UNAuthorizationOptions.Alert | UNAuthorizationOptions.Badge | UNAuthorizationOptions.Sound;
                UNUserNotificationCenter.Current.RequestAuthorization(authOptions, (granted, error) =>
                {
                    Console.WriteLine(granted);
                });
            }
            else
            {
                // iOS 9 or before
                var allNotificationTypes = UIUserNotificationType.Alert | UIUserNotificationType.Badge | UIUserNotificationType.Sound;
                var settings = UIUserNotificationSettings.GetSettingsForTypes(allNotificationTypes, null);
                UIApplication.SharedApplication.RegisterUserNotificationSettings(settings);
            }
            UIApplication.SharedApplication.RegisterForRemoteNotifications();

        }

What are the measure units for FontSize and how to make it related to font height?

$
0
0

My main target to to set such FontSize on a Label that in the result the Label height would become the desired value. For example, I want the Label to be 50 Xamarin Forms units high what value should I use for the FontSize in this case? How to calculated FontSize from the font height?

App login flow

$
0
0

I'm quite new to Xamarin development and have what is likely a very simple problem. I'd like the first thing to happen in my app to be a login. The login is pretty much exactly the same as the "Web Authenticator" sample in the Xamarin Essentials samples. However, it's the flow that I'm struggling to figure out. I'd like that to be the entry point of my app. Upon successful login, the rest of the app becomes usable. However, if login fails, I'd like to display a "retry or exit". In other words, I'd display the login page first, and only display the main page upon successful login, and exiting the app without it.

Whereas it embarrasses me to ask such a trivial question, doing so might save me a lot of time and end up with a better solution than if I just grind my way through it. So, good instructions or a code example would be much appreciated.

Note that initially this is just for Android, but I'd like to do the same with the iOS and UWP versions eventually.

Thanks!
Brad.

How to add a TapGestureRecognizer on a custom control (:Label) on a single XAML line?

$
0
0

Hi, instead of using a Label with a TappedGesture like this:

                <Label x:Name="filter" Text="BlaBlaBla">
                    <Label.GestureRecognizers>
                        <TapGestureRecognizer Tapped="OnFilterClicked" />
                    </Label.GestureRecognizers>
                </Label>

I would like to create a custom control based on a Label. But I want to pass the handler OnFilterClicked to this new control like this:

<shared:IconControl x:Name="filter" Text="BlaBlaBla" Tapped="OnFilterClicked">

I am not able to figure out what I should add to my custom control (IconControl) to be able to pass the "OnFilterClicked" and to add the TapGestureRecognizer in the code behind.

XAML

<?xml version="1.0" encoding="utf-8" ?>
<Label xmlns="http://xamarin.com/schemas/2014/forms"
        xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
        x:Class="RetroactionApp.Views.Shared.IconControl"
        FontFamily="{StaticResource IconFont}"
        BackgroundColor="Transparent"
        TextColor="LightGray"
        FontSize="20"
        Margin="5,0">
</Label>

CS

using Xamarin.Forms;
using Xamarin.Forms.Xaml;

namespace RetroactionApp.Views.Shared
{
    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class IconControl : Label
    {
        public IconControl()
        {
            InitializeComponent();
        }
    }
}

Thanks in advance,

Michel

Entry does not accept decimals from Keyboard

$
0
0

Hi, I have a field called Size and it's a decimal field so I expect user to enter decimal values but when I tried to debug and enter the decimal value, emulator does not accept decimals. I can enter the whole number but not the decimal. Any suggestions? TIA.

CarouselView with contentpages / switch between views in a page

$
0
0

Hi All,

I am trying to implement tabs to switch between content views/pages in a page. Alternatively I thought i could do this
with a carouselView where i bind pages to it ( but haven't been successful in binding pages as i can only do photos).

Any help would be appreciated!!! Picture attached ! :) I have been trying this for days and still no luck

Best wishes, Lou

Options to Properly Add FireBase to My Xamarin Forms Project

$
0
0

Hi guys,

I need to use firebase Cloud Messaging in my project, decide to follow all the official microsoft guidelines but I have had some bugs trying to add dependencies.

First, when adding the json file generated by Firebase (google-services.json) in the Android project, I don't see the option to add the resource as **GoogleServiceJson **(Step: In Properties> Advanced> Build Action, select GoogleServicesJson.)

Second, when I try to add the NuGetPackage Xamarin.Firebase.Messaging in the android project it throws me the error the $ (TargetFrameworkVersion) for PGTApp.Android (v8.1) is less than the minimum required $ (TargetFrameworkVersion) for Xamarin.Forms ( 9.0).
I am clear where I have to change for this to be fixed, but it remains the same without being able to be added.

Finally, I have updated to the latest version of xamarin forms but still unable to enable Firebase in my project.

Some aspects of my project:
1. Xamarin Forms version: 4.6.0.800
2. .Net Standard version: 2.0
3. Xamarin.Firebase.Messaging version: 17.1740.1 (not installed)
4. Sdk version minimum Api16 and maximum Api29. For the Android project.

My main question is what other options can I have to use Firebase in my project or how can I solve this problem?

Thank you very much, Greetings from Panama

how to handle Icons android tablet with mdpi resolution?

$
0
0

Some tablets have mdpi resolution like amazon firebase tablets. I have icon for each resolution folder defined but problem is that tablet is mdpi and icon in the mdpi folder is like 48x48 and when you define the icon on tablet, 48x48 is like tiny, if you define larger size, it is pixeled. what is the best way to handle it if svg is not the option. Should it be just put in drawable folder with the biggest size possible, so let it be resized on runtime?


How to set the default date in date picker before user has selected a value in xamarin forms

$
0
0

Hye everyone

i got a problem to handle with datepicker in xamarin forms. how to set default value for today date. my problem is, if user select another date its okay. but the error will appear if user does not select a new date.

anyone please help.. thanks

Bluetooth Text Transfer in Xamarin.Forms

$
0
0

Hi all

I'm trying to create an App which should do the following:

  • Connect to a Host (Desktop PC) over Bluetooth
  • Send a Scanned QR-Code as Text or Bytes to the Host via Bluetooth

However i have no idea how to do that, couldnt find anything relevant on the internet. Does somebody have an idea how to achieve that?

Thank you
Giusi

How to implement NFC in Xamarin.Forms

$
0
0

Hello,

I need to implement a Xamarin.Forms application that can read NFC tags. Regarding this, I have 2 questions:

  1. How to enable NFC in Android Emulator

I have used _nfcAdapter = NfcAdapter.GetDefaultAdapter(this); in MainActivity OnCreate method, but null is returned

  1. How to emulate the tag presence

When I could enable NFC in Android Emulator, how can I emulate the tag presence?

Regards
Jaime

PRISM Navigation with Xamarin.Forms application for UWP produces artifcats.

$
0
0

My Xamarin.Forms application is a MasterDetailPage application which uses PRISM framework. I have listed below the series of actions I perform to produce the artifact.

  1. Hamburger Menu Page(MasterDetailPage):
    NavigationService.NavigateAsync("NavigationPage/LandingPage");
  2. Landing Page is a tabbed page:
    NavigationService.NavigateAsync("CreatePage");
  3. CreatePage is a content page with its NavigationBar disabled:
    NavigationPage.SetHasNavigationBar(this, false);
    NavigationService.NavigateAsync("SelectPage");
  4. SelectPage is a content page with its NavigationBar disabled as well:
    NavigationPage.SetHasNavigationBar(this, false);

    You can notice a grayish bar on the top. Which I believe is the UWP AppBar, maybe?
  5. Navigating back to CreatePage:
    NavigationPage.SetHasNavigationBar(this, false);

    The same grayish bar can be observed here as well along with the HamburgerMenu icon.

It will be really helpful if anyone can explain what is going on? and how to have this fixed? Meaning, I don't want that horrible gray bar appearing.

Xamarin.Forms CardsView nuget package

$
0
0

Hi all) I've released new package for Xamarin.Forms (Something like Tinder's CardsView)
Maybe, someone will be interested in it

nuget.org/packages/CardsView/ -- nuget
github.com/AndreiMisiukevich/CardView -- source and samples

Viewing all 89864 articles
Browse latest View live