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

Select Multiple image from gallery in ios.

$
0
0

I have goann with ELCImagePickerController but they said install this component which is not available. Is there any other lib that i can go for multiple selection.
Thankx in advance :smile:


Xamarin Forms - Sending a large file over a TCP connection (using Socket.BeginSendFile) fails

$
0
0

I encountered a strange behavior when using the Socket.BeginSendFile method in a Xamarin Forms app on android.

When I run my app using the Visual Studio debugger (with an android phone connected over USB) and want to pass a large file (7 MB) over a TCP connection, only the first 2 MB of data are being sent. Transmission then stops.
The app functions as a TCP client. I checked with Wireshark and the TCP packets all look OK: The last 2 packets or a TCP ACK from my app (sending some data), followed by a TCP ACK from the server. The socket remains active.

When I run the app without the debugger (directly from a smartphone) the error doesn't seem to occur. The complete 7 MB of data is being transmitted.

I use Socket.BeginSendFile because that gives the highest throughput. When I do the exchange with 'normal' Socket.BeginSend calls (and my own file stream and reader code) the error never pops up, but throughput is bad. Transfer speed is about 40 times less than with Socket.BeginSendFile.

Is there anyone who can shed some light on this? The issue is probably in the Mono runtime since only System.Net.Sockets is being involved.

how to create a straight line between 2 StackLayouts? just to Separate

$
0
0

So i am looking for a separator ! in order to separate 2 views . for example 2 layouts. Any ideas? (.cs)

Custom Renderer erroneously instantiated multiple times

$
0
0

I have a Master-Detail pattern Xamarin Forms app in which the landing detail page has a HybridWebView in it.

On iOS, I have created a custom renderer for that Xamarin Forms HybridWebView.

The problem is that every time I leave the page by clicking a Master item, and then come back into this page, that an additional instance of the custom renderer is created: I've proven this because I create an ID for each renderer in it's constructor, when it is created.

Because both are bound to a Uri in the viewmodel, they both make a call to the uri.

Of course the user sees only one, but I need to stop this behaviour!

Any ideas how this is occurring?

Kind regards,

Anthony

The renderer is a WKWebView, btw!

Low Performance with Sycfusion SfDataGrid scroll

$
0
0

Hi,

I'm using a Syncfusion SfDataGrid on my Xamarin.Forms app, but I have low performaces when I scroll.
I've check the % of CPU used it's stay at ~25%.

I don't know if it's a recurent problem but I find nobody with the same problem.
Have somebody any solution?

Binding to a specific element of an array (or List)

$
0
0

After much googling, I haven't found an answer to this.

I have an array of colors. I want to bind a Button's BorderColor to a specific element within an array.
What is the syntax to achieve this?

Xaml:

 BorderColor="{Binding ButtonColors[11], Converter={Services:ByteToBorderColourConverter}}"

ViewModel:

private List<byte> buttoncolors;

public List<Byte> ButtonColors
    {
        get => buttoncolors;
        set
        {
            buttoncolors = value;
            OnPropertyChanged();
        }
    }

...

ButtonColors[11] = (Byte)Data[3];

I've also tried implementing this with byte[] array (which I would prefer), but it also doesn't work.
I think the xaml binding syntax is incorrect maybe?

Error Linking Assemblies

$
0
0

Hello,

I'm not be able to run my app when a selected release mode with ProGuard and Sdk Assemblies Only.
I get the following error:

"Cound not found find class 'android.graphics.drawable.RippleDrawable' referenced from method android.support.v7.widget.AppCompactImageHelper.hasOverlappingRendering"

I check the folder "obj\Release\MonoAndroid81\android\assets", decompile Mono.Android.dll and I can see the RippleDrawable class.

I don´t know what is happend

Anyone have the same problem

Thanks a lot

Nico

Time needed to publish an APP on iTunes.

$
0
0

It is normal that, to publish a trivial APP on iTunes it takes weeks? from Apple I make continuous observations on the use of GPS, and a series of questions regarding any payments in the APP ...


Cross Platform Camera Frame Analysis

$
0
0

Is there a way I can access ios/Android camera frames to do real-time frame analysis?

Samsung keyboard covers entry cells in xamarin forms; Other android and iOS seem to work w/o issue

$
0
0

I have a form with a table view to display info to the user as well as let them edit it.

<StackLayout>
    <Frame>
        <TableView>
            <TableRoot>
                <TableSection>
                    <EntryCell/>
                </TableSection>
                <TableSection>
                    <ViewCell>
                        <StackLayout >
                            <Label />
                            <Grid>
                                <Grid.RowDefinitions>
                                    <RowDefinition Height="Auto"/>
                                </Grid.RowDefinitions>
                                <Editor Text="{Binding Service.ExtProblem, Mode=TwoWay}" 
                                         HorizontalOptions="FillAndExpand"
                                         VerticalOptions="FillAndExpand"
                                        AutoSize="TextChanges"
                                        InputTransparent="{Binding ProblemLocked}"/>
                            </Grid>
                        </StackLayout>
                    <EntryCell Keyboard="Numeric"
                                           x:Name="AmtToCollectEntry"
                                           Label="Amt To Collect" 
                                           Placeholder="$0.00"
                                           Text="{Binding Service.AmtToCollect, Mode=TwoWay, Converter={StaticResource CurrencyConverter}}"
                                           LabelColor="{DynamicResource headerFooterIconColor}"/>
                </TableSection>
            </TableRoot>
        </TableView>
    </Frame>
</StackLayout>

This is the basic format of the form, with a few more of the ViewCells containing Editors. For whatever reason when some of my testers with Samsung devices try to use the form, the keyboard covers the entry fields so the user can't see what they are typing. Additionally, when first selecting the numeric EntryCell, it seems to get deselected and none of the input gets recorded. Some playing around on the form and coming back seems to let you select it correctly the second time.

What's weird is I can't repeat this with another android device (Google pixel and some no-name android tablet) or iOS. Anything I was able to research on it seemed to only come up with iOS keyboard issues and a few years old. Please help.

How to prevent double tap?

$
0
0

I created a Page with a button which will execute Navigation.PopAsync() on click.
but if the user double tap the button, the Navigation.PopAsync() will run twice.
How to prevent that happen?

No resources found that matches at AndroidManifest.xml

$
0
0

Hello,

I am trying to follow this solution https://stackoverflow.com/questions/41524459/broadcast-receiver-not-working-after-device-reboot-in-android but I get the following error:
**
No resource found that matches the given name (at 'resource' with value '@xml/my_accessibility_service').**

with my_accessibility_service.xml :

<?xml version="1.0" encoding="utf-8" ?>
    <accessibility-service
      xmlns:android="http://schemas.android.com/apk/res/android"
        android:packageNames="myapp"
        android:accessibilityFeedbackType="feedbackSpoken"
        android:description="@string/service_desc"
        android:notificationTimeout="100">
    </accessibility-service>

Why is it happening?
Thanks

How to update value in listview

$
0
0

Hi I am using 2 Entry filed in List view One In Item Price and other is Quantity. I want to update sub total when value changed in Item Price or Quantity.
I have add a image for reference.

Can debug on simulator but CANT run app in debug on device and app quits in release with this error:

$
0
0

Guys I do not know what happened but this error came up when running app in debug, I updated eveyrthing including windows and visual studio to all the latest updates as of 11 Dec 2018. What is going on??

UPDATE: App debugging in simulator works perfectly fine.
I just cannot debug, or run on device. It just quits with the error below:

2018-12-11 14:56:45.424 MyApp.iOS[1352:236793] Token received: <c888863b cb362ba8 3028fa09 ea6171ce e88231e3 f1d5f6a3 071e47aa 1b2511e3>
Thread started:  #9
Thread started: <Thread Pool> #10
Thread started: <Thread Pool> #11
Thread started: <Thread Pool> #12
Thread started: <Thread Pool> #13
Thread started: <Thread Pool> #14
2018-12-11 14:56:46.014 MyApp.iOS[1352:236793] <!DOCTYPE html>
<html>
    <head>
        <title>The resource cannot be found.</title>
        <meta name="viewport" content="width=device-width" />
        <style>
         body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;} 
         p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
         b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
         H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
         H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
         pre {font-family:"Consolas","Lucida Console",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}
         .marker {font-weight: bold; color: black;text-decoration: none;}
         .version {color: gray;}
         .error {margin-bottom: 10px;}
         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }

@media screen and (max-width: 639px) {
          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }
         }
         @media screen and (max-width: 479px) {
          pre { width: 280px; }
         }
        </style>
    </head>

    <body bgcolor="white">

            <span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>

            <h2> <i>The resource cannot be found.</i> </h2></span>

            <font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">

            <b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
            <br><br>

            <b> Requested URL: </b>/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd<br><br>

            <hr width=100% size=1 color=silver>

            <b>Version I
The app has been terminated.
llback cb, Object extraData)
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.<>c__DisplayClass285_0.<ExecuteStepImpl>b__0()
   at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
   at System.Web.HttpApplication.StepInvoker.<>c__DisplayClass4_0.<Invoke>b__0()
   at Microsoft.AspNet.TelemetryCorrelation.TelemetryCorrelationHttpModule.OnExecuteRequestStep(HttpContextBase context, Action step)
   at System.Web.HttpApplication.<>c__DisplayClass284_0.<OnExecuteRequestStep>b__0(Action nextStepAction)
   at System.Web.HttpApplication.StepInvoker.Invoke(Action executionStep)
   at System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step)
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
--><!-- 
This error page might contain sensitive information because ASP.NET is configured to show verbose error messages using &lt;customErrors mode="Off"/
nformation:</b>&nbsp;Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.7.3163.0

            </font>

    </body>
</html>
<!-- 
[HttpException]: The controller for path &#39;/push/installations/e99787d6-f94e-4ddf-888d-9b4e8e680bdd&#39; was not found or does not implement IController.
   at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
   at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
   at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController& controller, IControllerFactory& factory)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContext httpContext, AsyncCallback callback, Object state)
   at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCa
&gt;. Consider using &lt;customErrors mode="On"/&gt; or &lt;customErrors mode="RemoteOnly"/&gt; in production environments.-->
Failed to Stop app:  An error occured on client IDB412377 while executing a reply for topic xvs/idb/4.12.3.77/stop-app
The app has been terminated.

How to increase binded progress property in view model

$
0
0

Hello developers! :smile:

I'm begginer in xamarin ,For some time i'm trying to implement a progress bar which will be increasing by tapping a image assing to it. My problem is that i can't figure out how to get access to Bindable property in my viewmodel. When i copied my model properties to viewmodel still no result, my dream solutions is that model's properties will stay in a model becouse i implement a observable object to this and create observable collection which is binded to listview in my page.xaml file. Can i ask you for some tips or guide my throught this step of my project ?

My code from ViewModel :

` public class SurfBoardViewModel : BaseViewModel
{
public ObservableRangeCollection Boards { get; }
public SurfBoardViewModel()
{

        Boards = new ObservableRangeCollection<SurfBoard>
        {

            new SurfBoard()
            {
                Counter =0.2, Icon="icon.png"
            },
            new SurfBoard()
            {
                Counter= 0.1, Icon="icon.png"
            },
            new SurfBoard()
            {
                Counter =.8, Icon ="icon.png"
            },
            new SurfBoard()
            {
                Counter= .3, Icon="icon.png"
            },
            new SurfBoard()
            {
                Counter = 0.2, Icon="icon.png"
            }
        };



        AddProgressCommand = new Command(AddProgress);

    }

   private void AddProgress()
    {

    }

    public Command SetBusyCommand { get; }
    public Command AddProgressCommand { get; }

//My last step was to copy property from model class and make it observable object to remain all functionality as it was but still no result :neutral:

    public class SurfBoard : ObservableObject
    {
        public SurfBoard()
        {

        }

        double counter;
        public double Counter
        {
            get { return counter; }
            set
            {
                if (SetProperty(ref counter, value))
                {
                    Debug.WriteLine("Counter changed");
                }
            }
        }

        string icon;
        public string Icon
        {
            get { return icon; }
            set
            {
                if (SetProperty(ref icon, value))
                {
                    Debug.WriteLine("Icon Changed");
                }
            }
        }

    }`

Code from page xaml

`

    <ListView x:Name="listView" ItemsSource="{Binding Boards}" HasUnevenRows="True" 
              Margin="10">
        <ListView.ItemTemplate>
            <DataTemplate>
                <ViewCell>

                    <Grid>
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto"/>
                            <RowDefinition Height="Auto"/>
                        </Grid.RowDefinitions>
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="3*"/>
                            <ColumnDefinition Width="*"/>
                        </Grid.ColumnDefinitions>


                        <ProgressBar x:Name="progressBar"
                                     Grid.Row="0" Grid.RowSpan="2"
                                     Grid.Column="0"
                                     Progress="{Binding Counter}"
                                     />


                        <Image x:Name="icon"
                                   Grid.Row="0" Grid.RowSpan="2"
                                   Grid.Column="1"
                                   WidthRequest="60"
                                   HeightRequest="60"
                                   Source="{Binding Icon}"
                                   >
                            <Image.GestureRecognizers>
                                <TapGestureRecognizer NumberOfTapsRequired="2"
                                                      Command="{Binding AddProgressCommand}"/>
                            </Image.GestureRecognizers>
                        </Image>


                    </Grid>

                </ViewCell>
            </DataTemplate>
        </ListView.ItemTemplate>
    </ListView>
</StackLayout>`

Saving An object type as a string in SQLite Database (With Sqlite-net-pcl nuget)

$
0
0

Hi, I have a Tag class that I am using to get and save items from the database. I want to know if there is a good and easy way to add Color and Timespan type properties that i could transform into String and Integer before saving to the database.

hastebin.com/abufucijiw.cs (Here is the class code)

Adding TextChanged event to an Entry view is crashing whole XAML?

$
0
0

If I remove the event, all is well. Any explanation? Any resolution?

Display more than one Image on my page

$
0
0

How can I display 3 image on my xaml page which I have taken earlier (from the gallery)

Custom layout for TabbedPage tabs

$
0
0

Hi.

Can I edit the tabs' layout of a TabbedPage to be like I want?
I mean, I want to customize the tabbar layout with my own, like in the image below:

How can I achieve this?
I need to create a custom User Control? I need to create a custom Layout?

Thank you so much.
I'm very grateful for this community and Xamarin team.

Best regards.

Azure app service not handing control back over to app after successful sign-in.

$
0
0

So I have been trying to implement client authorization for the past few days, specifically with Xamarin Forms on android. My code is heavily based off of James Montemagno's tutorial: Personalized Experiences with Azure Mobile Apps Authentication -it is a Xamarin blow but I can't link due to restrictions.

I am currently having an issue where I get a successful sign-in page on the android web-browser (azure mobile app url with the browser displaying "You have successfully signed in - return to the website") using Google as the identity provider, however, the browser does not return flow back over to the app. I can hit the browsers back button however once back in the app, I am still not logged in.

This is my android manifest:

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="schemas[dot]android[dot]com/apk/res/android">
    <uses-sdk android:minSdkVersion="20" />
    <application android:label="BookDB.Android">
      <activity android:name="com[dot]microsoft[dot]windowsazure[dot]mobileservices[dot]authentication[dot]RedirectUrlActivity" android:launchMode="singleTop" android:noHistory="true">
        <intent-filter>
          <action android:name="android.intent.action.VIEW" />
          <category android:name="android.intent.category.DEFAULT" />
          <category android:name="android.intent.category.BROWSABLE" />
          <data android:scheme="bookdbase" android:host="easyauth.callback" />
        </intent-filter>
      </activity>


  </application>
</manifest>

And this is the Android implementation of the IAuthetication interface which I call from my PCL.

 public class Authentication: IAuthentication
        {
            public async Task<MobileServiceUser> LoginAsync(MobileServiceClient client, MobileServiceAuthenticationProvider provider)
            {
                try
                {
                    var user = await client.LoginAsync(provider,"bookdbase");


                    Settings.AuthToken = user?.MobileServiceAuthenticationToken ?? string.Empty;
                    Settings.UserId = user?.UserId ?? string.Empty;


                    return user;
                }
                catch (Exception e)
                {
                    e.Data["method"] = "LoginAsync";
                   // Xamarin.Insights.Report(e); 
                }

                return null;
            }
        }

If anyone could shed some light on this or perhaps point me in the direction of help, that would be much appreciated.

thanks.

Viewing all 91519 articles
Browse latest View live


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