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

Java.Net.ProtocolException: 'unexpected end of stream' I got this error.

$
0
0

I am using Android Device manager "Pixel 2 Pie 9.0 – API 28"

i try to input my Xamarin form app value to Sql server table using Asp.net Api but not working with "Java.Net.ProtocolException: 'unexpected end of stream' I got this error."

please tell me any solution or any link. help me!

Thank you.


Example to integrate firestore in Xamarin.Forms Andriod/IOS?

$
0
0

So, im trying to implement this libraries inside my project:
Firestore Android:
https://www.nuget.org/packages/Xamarin.Firebase.Firestore/60.1142.0-beta2

Firestore IOS:
https://www.nuget.org/packages/Xamarin.Firebase.iOS.CloudFirestore/

And I've only found 1 example of how to use them both:
https://github.com/yamachu/Sample-Firebase-Cloud-Firestore-Xamarin.Forms

Since I'm having problems when adding/updating in the mapping of .NET objects to Java/NSObject respectively. Does anyone know a library that provides an example of that?
Thanks!

How to enable calling from the number displayed in Xamarin.Forms.DataGrid

$
0
0

I am using Xamarin.Forms.DataGrid for displaying data as a report.When i click any number i want to open phone dialer.
i have implemented opening phone dialer using xamarin.essentials i want to implement it when i click a number or click on a row in datagrid.
How can i do that.

please help.

`< / StackLayout >
< dg:DataGrid x:Name="SalesGrid" RowHeight="45" FontSize="12" HeaderFontSize="15" HorizontalOptions="FillAndExpand" >

            < dg:DataGrid.Columns >

                < dg:DataGridColumn Title="Date" PropertyName="Date"  Width="150"  HorizontalContentAlignment="StartAndExpand" VerticalContentAlignment="CenterAndExpand"/>
                < dg:DataGridColumn Title="Number" PropertyName="Num" Width="170" HorizontalContentAlignment="StartAndExpand" VerticalContentAlignment="CenterAndExpand" />

                < dg:DataGridColumn Title="nhg"  Width="0" >

                    < dg:DataGridColumn.CellTemplate >
                        < DataTemplate >
                             < ContentView  VerticalOptions="FillAndExpand"  HorizontalOptions="StartAndExpand"  >
                                < Label Text="{Binding SALES}" HorizontalOptions="Center" VerticalOptions="Center" TextColor="White" />
                            </ ContentView >
                        </ DataTemplate >
                    </ dg:DataGridColumn.CellTemplate >
                </ dg:DataGridColumn >
            </ dg:DataGrid.Columns >
        </ dg:DataGrid >
    </ StackLayout >`

Xamarin forms: How to set the VerticalOptions value of StackLayout from viewmodel?

$
0
0

I tried like below:

Created a new property named verticalOption:

private LayoutOptions verticalOption;

public LayoutOptions VerticalOption
{
    get => verticalOption;
    set
    {
        verticalOption = value;
        OnPropertyChanged(nameof(VerticalOption));
    }
}

Then set its value initially as FillAndExpand:

VerticalOption = LayoutOptions.FillAndExpand;

At one point I need its value as CenterAndExpand.

VerticalOption = LayoutOptions.CenterAndExpand;

Finally on XAML:

<StackLayout 
    Orientation="Vertical"
    HorizontalOptions="CenterAndExpand"
    VerticalOptions="{Binding VerticalOptio}">

But the CenterAndExpand value is not working. Always stack layout is on the top section, not coming to the center position. Is anything wrong with my implementation?

How to send notifycation by Firebase Cloud Messaging in Xamarin Forms

$
0
0

Hi, i'm new to Xamarin and in my Xamarin.Forms app after user click on CheckOut button then it will push notification to my Web API through FCM.
So how can i send notification to my Web API ?

Animation when changing MainPage of the application

$
0
0

I am using a MasterDetail template and I also have a login page. In my app when I am logged out I have set:

MainPage = new LoginPage();

When I will successfully log in I am just changing MainPage to MasterDetailNavigation like this:

MainPage = new MasterDetailNavigation();

However, there is no animation (page transition) when I am changing MainPage. How can I add it? It would be great to have i.e. the same animation which is when we are doing:

Navigation.PushAsync(new SomePage())

How can I achieve this animation?

How to send notifycation by Firebase Cloud Messaging in Xamarin Forms

$
0
0

Hi, i'm new to Xamarin and in my Xamarin.Forms app after user click on CheckOut button then it will push notification to my Web API through FCM.
So how can i send notification to my Web API ?

DellyShop Ecommerce Application - Xamarin Forms (Android/iOS)

$
0
0

MORE INFO

Does DellyShop only contain design?
All the screens you need, all renderers and customviews are ready for you. All you have to do is prepare your service and connect it to the models. The application is completely ready and full application.

DellyShop is an e-commerce mobile application. The design was written with Xaml code. The purpose of the application is to save dozens of hours spent on design and coding, so the time spent on design and coding will be spent at the back end. The application is not just about XAML code, the Xaml code is full of logical architecture behind it. Simple and beautiful template structure, CustomRenderers, CustomViews, MVVM architecture design includes. DellyShop has a clear design and infrastructure. The application contains a very well designed design structure and descriptive codes. DellyShop supports all language structures, regardless of RTL or LTR. Arabic and English language structure.

Why Should I Buy This Application?
DellyShop will save you a great deal of time with its superior design and infrastructure features Design is a time-consuming and difficult process in Xamarin Forms. Most super developers lose a lot of time with the Design part, but DellyShop will save you time.

DellyShop will never put you in a mold with its flexible and dynamic structure.

Everything is easy, everything is simple! Even if you don’t have any knowledge about Xamarin, we are ready to help you with our explanatory documents and our 24/7 support line. Simply send us your purchase code for support. If this code is verified by us, we will be happy to support you!

With this Application you can learn Xamarin.Forms and you can learn what can be done with Xamarin and what are the limits of Xamarin. Designing on Android and iOS mobile platforms is a waste of time. Some developers may even quit this enthusiastic work because of the design part.

Application Features

  • Simple and minimalist design.
  • Cross Platform. Save time developing for multiple devices with this template!
  • Custom Controls.
  • Custom Views.
  • Super Animations.
  • Fast and smooth design that does not affect performance.
  • Easy and readable Xaml codes.
  • Dynamic Pages.
  • Custom Renderers.
  • Partial Views.
  • Support RTL Language.
  • Support Dark Mode.
  • HD icons with FontIcon.

Xamarin Forms 4.0 Using TabbedPage Tab But look black screen.

$
0
0

Hi everyone !
I'm trying to use a tab. But when I click x, my pages look black.


Creating button from code behind?

$
0
0

I am working on xamarin forms. Where I am creating Button from code behind. When I specify WidthRequest and HeightRequest for the button, the button text is not showing and If I remove WidthRequest and HeightRequest then the button text is showing.

Code for creating button

    Button buttonRemoveItem = new Button()
    {
        Text = "-", 
        TextColor = Color.White,
        WidthRequest = 25,
        HeightRequest = 25,
        CornerRadius = 10,
        BackgroundColor = Color.Red
    };

output

If I remove WidthRequest and HeightRequest
then my code looks like

 Button buttonRemoveItem = new Button()
    {
        Text = "-",
        TextColor = Color.White,    
        BackgroundColor = Color.Red
    };

and the output

How to resolve this?

Push notifications from server side of the app

$
0
0

I have implemented push notifications to my app using firebase console. Now what I would like to do is, trigger the push notification at my server side.

For eg: when new user signs up, I want to trigger the notification from server. How can this be done

App freezes on iPad when in split view mode (multi-tasking) and change between pages

$
0
0

I have come across a very strange bug -- not sure if it in my app, Xamarin.Forms, or iOS itself.

My app switches between several pages derived from ContentPage. When I have my app and another app, for example the iOS "Pages" app on my iPad side-by-side (half screen). It seems to be related to whether the other app is in an input field before switching. Anyway, I press a Button in my app to switch to another page, and my page is kinda there, but the dark blue background want is white, plus no interaction (so, appears "frozen"). But, if move the slider to make it a 2/3 split, it immediately works.

When my app starts in 2/3 screen mode, the result is a bit comical -- the first half of my app is OK (the leftmost third of the screen), but other half refuses to allow interaction (and has white background). Weirdest thing -- one of my buttons straddles the break -- the left part works fine, the right does not.

I've not seen this on an iPad that has not updated to 13.x yet. I'm suspcious that this might be the same issue or related to White Screen after navigating to MasterDetailPage on iPAD iOS 13.2 and iOS 13.0 Broke MasterDetailPage on iPads?, so I added tags that might relate. But, here's the thing -- I'm currently using XF 4.3 (4.3.0.991221). The "solution" for the others was to update to 4.3. And, I'm not really using MasterDetailPage, and those issues don't mention SplitScreen.

I'd just like to hear if someone else has seen something like this, or has any quick suggestions before I try to create a simplified example.

Local SQLite Database in Xamarin Forms ?

$
0
0

How can i use a Database that i made outside Xamarin ?
I don't want to create a new Database in Xamarin i just want my app to connect to old Database ?

Streaming PCm bytes to AudioTrack causes white noise

$
0
0

I have an app, that gets every mp3 file on the device, then it decodes it using MP3Sharp library to PCm bytes. They are then send to another device via Bluetooth. The other device then assembles AudioTrack class, and starts playing it, then it starts writing to the AudioTrack while the Bluetooth stream is available. The problem is that every couple seconds, the there is a 1 - 2 s of white noise and than the player start the next part of the song. How would I remove that. Is it something about the file or the player?

This is how I send the file to dependency service:

`private void SendData(object sender, EventArgs e)
    {
        System.Threading.Tasks.Task.Run(() =>
        {
            // open the mp3 file.
            MP3Stream stream = new MP3Stream(pathList[ShowSongFile.SelectedIndex]);

            // Create the buffer.
            byte[] buffer = new byte[4096];

            // read the entire mp3 file.
            int bytesReturned = 1;

            while (bytesReturned > 0)
            {
                bytesReturned = stream.Read(buffer, 0, buffer.Length);
                DependencyService.Get<BluetoothManager>().Write(buffer);
            }

            // close the stream after we're done with it.
            stream.Close();

        }).ConfigureAwait(false);
    }`

And this is how I receive the file on another device:

    `public void Read()
    {
        System.Threading.Tasks.Task.Run(() =>
        {

            int _bufferSize;
            AudioTrack _output;

            _bufferSize = AudioTrack.GetMinBufferSize(44100, ChannelOut.Stereo, Android.Media.Encoding.Pcm16bit);

            _output = new AudioTrack(Android.Media.Stream.Music, 44100, ChannelOut.Stereo, Android.Media.Encoding.Pcm16bit,
                _bufferSize, AudioTrackMode.Stream);
            _output.Play();

            while (mmInStream.CanRead)
            {
                try
                {
                    byte[] myReadBuffer = new byte[2000];
                    mmInStream.Read(myReadBuffer, 0, myReadBuffer.Length);
                    _output.Write(myReadBuffer, 0, myReadBuffer.Length);
                }
                catch (System.IO.IOException ex)
                {
                    _output.Stop();
                    System.Diagnostics.Debug.WriteLine("Input stream was disconnected", ex);
                }
            }
            _output.Stop();
        }).ConfigureAwait(false);
    }`

Trying to add icon sets to a theme option in my app.

$
0
0

Hello everyone!
I have a theming option in my app, that is not perfect, but functions well enough for my purpose, at least that's what I thought until I started making the light and dark themes and realized I needed to make a light and dark icons as well... Only problem is my icons are statically coded... So I figured, why not use the same <style ... tags for the icons as well?
Here is what I have in the code.
Here's a snippet from my theme code.

<Style x:Key="ic_Add" TargetType="{x:Type ToolbarItem}">
    <Setter Property="IconImageSource" Value="ic_plus_26px.png" />
</Style>

<Color x:Key="primary-title-color">#919191</Color>
<Color x:Key="NavigationPrimary">#6F6F6F</Color>
<Color x:Key="AppBackgroundColor">#373739</Color>

and when I attempt to implement it...

<ToolbarItem
        x:Name="btnAddLoad"
        Clicked="AddLoad_Clicked"
        StyleId="{StaticResource Key=ic_Add}"
        Text="Add" />

My problem is that the icon is not showing up... I've tried using the implementation as both StyleId and ClassId both with the same results...

Any ideas or recommendations?

Thanks!


Xamarin Forms: Call a number directly?

$
0
0

Ok, this may be a bit difficult to explain for me, but i'll try my best.

We (and by 'we' I mean 'my higher ups') want to phone a specific number trough our app. That is the easy part.
The problem is that, when the button is pushed, prompts you to the telephone editor screen, were you can delete digits, make the call or cancel.
We (refer to the previous parentheses) don't want that. We need to, when the user presses the aforementioned button, call that number directly.
With no intermediate steps.

If this is not possible, please give us a thorough explanation. I'm a bit in a pickle here.

Kind regards

Can I use Triggers from code?

$
0
0

Is there a way how I can use triggers from the code? I can't seem to find any examples. Basically I have some behaviors for my entries, and I want to trigger the Login Button's "IsVisible" property based on the 'IsValid' property from my entry's behavior:

    public class PEntry : Entry
        {
            public PEntry ()
                : base ()
            {
            }

            /// <summary>
            /// Determines whether this instance is valid.
            /// </summary>
            /// <returns><c>true</c> if this instance is valid; otherwise, <c>false</c>.</returns>
            public bool IsValid 
            {
                get{
                    // iterate through each entry's validator behaviors
                    foreach (var behavior in this.Behaviors) {
                        var validatorBehavior = behavior as IValidatorBehavior;
                        if (validatorBehavior != null) {
                            if (!validatorBehavior.IsValid) {
                                return false;
                            }
                        }
                    }

                    // default to true
                    return true;
                }
            }
        }

Absolute layout two overlapping, active sliders?

$
0
0

Hey, I'm new to xamarin, however trying to create a simple joystick that consists of two sliders inside a absolute layout. One of them is rotated 90° so it can read a y value while the other one reads a x value.
My problem is, that if one of them is overlapping the other, the one in the background doesn't change position when I touch it while the other does.
Is there a way to have both acitve at the same time, is there a better way to achieve my goal?

My first idea would be to deactivate the first slider after it detects that it is touched and then read out the value of the other, however I think there must be a better solution to this.

                <AbsoluteLayout
                    IsVisible="False"
                    x:Name="joystick_xy"
                    HeightRequest="200"
                    WidthRequest="200"
                    HorizontalOptions="Center"
                    VerticalOptions="Start"
                    BackgroundColor="CadetBlue">
                    <Slider WidthRequest="200"
                            HeightRequest="200"/>
                    <Slider Rotation="90"
                            WidthRequest="200"
                            HeightRequest="200"/>
                </AbsoluteLayout>

eliteKit: Xamarin Forms UI Kit

$
0
0

Hi guys,

I'm proud to announce the first release of the eliteKit Xamarin Forms UI Kit. It's a collection of 20 UI elements made with SkiaSharp to make it much easier creating and design your next app.

You can find all informations about this project under www.eliteKit.de.

A free LITE version is available with 10 UI elements. There is also a PRO version containing all 20 UI elements. We're planning to create a lot of more UI elements in future, as we're a team of 3 people creating, developing and designing awesome elements. Lifetime updates are for free available.

With a built in community you can ask any questions related to eliteKit to staffs or other community members. We're giving our best to answer and help you immediately or as fast as possible. You can even ask us to create new UI elements or suggest us any changes to existing elements. For any found bug's we'd be happy to get noticed about it in the eliteKit bug reports category.

Feel free to have a look on our homepage under www.eliteKit.de

White-list the app using code

Viewing all 91519 articles
Browse latest View live


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