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

Emergency: Can't install Microsoft.Bcl.Build.1.0.14 in Visual Studio 2015 for Android project

$
0
0

I am trying to use "PortableRest" for my Xamarin Forms portable projects(IOS project can add PortableRest.3.0.1 fine).
I can't add package "PortableRest.3.0.1" to my Droid project, the following are the error message in output.

I tried on both OS X and Window Xamarin Studio,
Xamarin Studio OS X/Windows doesn't have problem to add "PortableRest.3.0.1" to Android project at all.

I followed an old post said that I need to reinstall Portable library, Xamarin Studio,reboot etc, no matter what I do,
Visual Studio can't add "PortableRest.3.0.1",

Please help, I have been stuck here for few hours already.

Thank you!

=======Output=======
Resolved actions to install package 'PortableRest.3.0.1'
Install failed. Rolling back...
Package 'Microsoft.Bcl.Build.1.0.14 : ' does not exist in project 'App1.Droid'
Package 'Microsoft.Bcl.Build.1.0.14 : ' does not exist in folder 'C:\Users\Dev\Documents\Projects\App1\packages'
Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

=======Error=======
Error Could not install package 'Microsoft.Bcl.Build 1.0.14'. You are trying to install this package into a project that targets 'MonoAndroid,Version=v6.0', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author. 0


HttpClient IPv6 iOS Appstore rejection

$
0
0

I just submitted an update to my Xamarin Forms based iOS app for the first time in ~8 months and got a rejection for not supporting ipv6 only networks connections.

There is a lot of information on this, but there are also a lot of ways to do network connections and not really matched my scenario.

I am using making all of my network calls from my Forms portable library, not from an iOS implementation. I am not using IP addresses, but am always connecting to a host name to communicate with a simple Asp.Net back end (on https) that runs on Azure. It it almost 100% my app telling the server that something has happened on the device, there is only one case where information is coming down from the web server.

All of the networking calls in my app get routed through the following function:

private static async Task DoPost(string baseUrl, string action, object data, int batteryLevel = -1)
{
    if (string.IsNullOrWhiteSpace(baseUrl) || string.IsNullOrWhiteSpace(action))
    {
        return;
    }

    try
    {
        var url = baseUrl + action;
        var postContent = GetHttpContentFromObject(data, batteryLevel);
        HttpResponseMessage response;
        using (var client = new HttpClient(new NativeMessageHandler()))
        {
            Debug.WriteLine($"posting to {url}");
            response = await client.PostAsync(url, postContent);

        }

        if (response.IsSuccessStatusCode == false)
        {
            Debug.WriteLine("exiting response");
            throw new Exception(string.Format("Could not post to web service. Code:{0} MSG:{1}", response.StatusCode, response.Content.ToString()));
        }
        var contentVal = await response.Content.ReadAsStringAsync();
        Debug.WriteLine($"content: \"{contentVal}\"");
        if (contentVal != "success")
        {
            throw new Exception("Got an error from the web service.  MSG:" + contentVal);
        }
    }
    catch (Exception exc)
    {
        var e = exc;
        throw new Exception("Got an error trying to post.  MSG:" + exc.MessageComplete());
    }
}

My app is running on:
Microsoft.Net.Http: v2.2.29
Xamarin.Forms: v2.3.3.168
modernhttpclient: v2.4.2

I followed the instructions at: https://developer.apple.com/library/content/documentation/NetworkingInternetWeb/Conceptual/NetworkingOverview/UnderstandingandPreparingfortheIPv6Transition/UnderstandingandPreparingfortheIPv6Transition.html#//apple_ref/doc/uid/TP40010220-CH213-SW1 to try to reproduce the problem, but everything still works on my debug device (attached to the network sharing mac i just set up).

I am hoping to keep the networking code in my forms portable library, but will move it into my ios app if i have too.

Thanks in advance,
-Logan

Disabling a hovering view over page

$
0
0
Does anyone know of any information about how to disable a view Hovering over the current view, bound to an mvvm class. I'm looking to create a text box that allows triggering the hovered box to have some data, essentially user selection like mentioning someone in a slack channel.

ListView long press PCL

$
0
0

Hello everyone.

I need to use or add the LongPress method in my app.

Does anyone have a good example to develop this event?

Xamarin.Forms Feature Roadmap

$
0
0

This roadmap outlines our anticipated feature releases.

Are there things you don't see here that you feel strongly deserve a spot? Make your voice heard and open a proposal on the Xamarin.Forms Evolution forum.

Primary Focus

Quality is top of the list. This means stability and performance first and foremost. Xamarin.Forms has been swiftly adopted as a preferred tool for delivering production apps in addition to rapid prototypes. Our focus and priorities are to support the Xamarin.Forms community in those areas. In the release schedule below, we've highlighted how and where we are making those investments.

A Note About Bugs

As this thread is primarily about the feature roadmap, we anticipate the important question "what about ___ bug"?! Improving quality by addressing bugs is huge priority and ongoing focus for the team, in addition to improve our communication across the board.

Disclaimer

We cannot predict the future and how everything will shake out. Things will change. Timing may be adjusted due to priority changes, in pursuit of quality standards, or any number of other really good reasons that we will strive to proactively and openly communicate.

The Features Roadmap

Milestone Release Date
2.3.3 December 2016
2.4.0 February 2017
2.5.0 May 2017

2.3.3 - December 2016

Native View Declaration - Feature
Native view declaration allows you to add bindable iOS, Android, and Windows views directly to XAML. Rather than having to write a custom renderer, you can simply add the control directly to XAML with no additional configuration. This not only works with stock platform controls, but custom controls as well.

Platform-Specifics - Feature
Platform-specifics allow you to take advantage of native functionality that is only available on select platforms that Xamarin.Forms targets from shared code.

UWP Blur Support (3rd party nuget) - Feature
Adds the UWP blur platform-specific.

2.4.0 - February 2017

Bindable Picker - Feature
Adds data binding to the Picker control, specifically the following properties:

  • ItemSource

  • SelectedItem

https://github.com/xamarin/Xamarin.Forms/pull/515

Accessibility (A11y) Support - Feature
Proposal
Adds accessibility support to Xamarin.Forms by exposing the underlying accessibility features on iOS, Android, and Windows 10.

CarouselView v1 Stable - Feature
CarouselView was introduced at Xamarin Evolve 2016 and has been in prerelease ever since. v1 brings stability and performance improvements.

Xamarin.Forms for macOS Preview - Feature
Xamarin.Forms is coming to macOS, joining iOS, Android, Windows, and Tizen as target platforms for Xamarin.Forms.

Fast Renderers - Performance
Optimize built-in and custom view renderers to streamline view creation and improve performance.

Startup Time Improvements - Performance
Improve the startup and initialization time for Xamarin.Forms apps.

Compiled Native Views - Enhancement, Performance
Bring native view declaration to XAMLC, so users don't have to opt-out of XAMLC in PCLs where pages use native view declaration.

OnIdiom Support for Desktop (UWP) - Enhancement
Developers have lots of options when it comes to configurability based on operating system (Android, iOS, UWP, etc.), version (9, 10, etc.), and idiom (mobile or tablet). This adds Desktop as an OnIdiom for UWP developers.

https://github.com/xamarin/Xamarin.Forms/pull/420

XAMLC Enhancements - Enhancement, Performance
Approaching full support for currently supported XAML features. Compile time support for all value providers.

Deprecation of iOS 6/7

Deprecation of WP8

2.5.0 - May 2017

Xamarin.Forms Embedding - Feature
Embed Xamarin.Forms into a native Xamarin.iOS, Xamarin.Android, or Windows 10 app.

Xamarin.Forms for macOS - Feature
Xamarin.Forms is coming to macOS, joining iOS, Android, Windows, and Tizen as target platforms for Xamarin.Forms.

MenuPage - Feature
Alternative to the MasterDetail page, but rendered as a platform-specific menu that makes creating flyouts easy.

Cut down on GPU overdraw for Android - Performance
Try to avoid overdraw on Android where possible to improve performance.

Reduce native views created - Performance
Cut down on backing native views created for Xamarin.Forms, as noted by Miguel in #42948.

Layout Compression - Performance
LayoutCompression allows multiple layers of Xamarin.Forms layouts to be packed into a single native one.

Prism-Like URI Navigation Routing - Enhancement
Navigate to a page using Uri navigation, similar to what Prism does.

NavigationService.NavigateAsync("ListPage/DetailPage?id=1");

Single DLL - Enhancement
Ship Xamarin.Forms as a single DLL to improve startup performance and assist the linker.

Open Source Contributions

As noted above, the Xamarin.Forms Evolution forum is the place to start.

No TLS 1.2 support in Xamarin.Forms? Android app cannot connect to TLS 1.2 web sites

$
0
0

Mono now has TLS 1.2 support: http://tirania.org/blog/archive/2016/Sep-30.html
According to this post on stackoverflow it should work on Xamarin:

http://stackoverflow.com/questions/40735964/how-can-i-enable-ntlm-and-tls-1-2-with-xamarin-on-android

Yet in my Xamarin.Forms (Android version) I cannot connect to TLS 1.2 web sites to download an image:

https://randomuser.me/api/portraits/med/men/85.jpg

This is the error I get:

Image Loading: Error getting stream for randomuser.me/api/portraits/med/men/85.jpg: System.Net.WebException: Error: SecureChannelFailure (The authentication or decryption has failed.) ---> System.IO.IOException: The authentication or decryption has failed. ---> System.IO.IOException: The authentication or decryption has failed. ---> Mono.Security.Protocol.Tls.TlsException: The authentication or decryption has failed. –

Why?

Custom Android View Not Showing In Xamarin Relative Layout

$
0
0

I have a simple Xamarin Forms content page defined as below

<?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:local="clr-namespace:MyCustomView"
            x:Class="MyCustomView.MyContentPage">
  <ContentPage.Content>
    <RelativeLayout>
    <local:CustomView
                                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Constant=0, Factor=0}"
                                RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Constant=0, Factor=0}"/>
    </RelativeLayout>
  </ContentPage.Content>
</ContentPage>

The local:CustomView is defined as

public class CustomView : ContentView
{
    public CustomView()
    {

    }
}

For which I have created the following custom renderer

[assembly: Xamarin.Forms.ExportRenderer(typeof(MyCustomView.CustomView), typeof(MyCustomView.Droid.CustomViewRendererDroid))]
namespace MyCustomView.Droid
{
    public class CustomViewRendererDroid : ViewRenderer<MyFloatingActionButton.FloatingActionButton, View>
    {
        View _backgroundView;

        protected override void OnElementChanged(ElementChangedEventArgs<FloatingActionButton> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null && Control == null)
            {
                _backgroundView = new View(this.Context);
                _backgroundView.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                _backgroundView.SetBackgroundColor(Color.Blue);
                _backgroundView.BringToFront();
                _backgroundView.SetMinimumHeight(100);
                _backgroundView.SetMinimumWidth(100);
                _backgroundView.Left = 50;
                _backgroundView.Top = 100;
                SetWillNotDraw(false);
                SetNativeControl(_backgroundView);
            }

        }
    }
}

No matter what I try (hence lots of positioning, coloring, etc in the renderer) I can't get this custom view to appear in a RelativeLayout, but if I change the XAML to use a StackLayout it appears no problem. What am I missing?

Custom Android View Not Showing In Xamarin Relative Layout

$
0
0

I have a simple Xamarin Forms content page defined as below

<?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:local="clr-namespace:MyCustomView"
            x:Class="MyCustomView.MyContentPage">
  <ContentPage.Content>
    <RelativeLayout>
    <local:CustomView
                                RelativeLayout.YConstraint="{ConstraintExpression Type=RelativeToParent, Constant=0, Factor=0}"
                                RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Constant=0, Factor=0}"/>
    </RelativeLayout>
  </ContentPage.Content>
</ContentPage>

The local:CustomView is defined as

public class CustomView : ContentView
{
    public CustomView()
    {

    }
}

For which I have created the following custom renderer

[assembly: Xamarin.Forms.ExportRenderer(typeof(MyCustomView.CustomView), typeof(MyCustomView.Droid.CustomViewRendererDroid))]
namespace MyCustomView.Droid
{
    public class CustomViewRendererDroid : ViewRenderer<MyFloatingActionButton.FloatingActionButton, View>
    {
        View _backgroundView;

        protected override void OnElementChanged(ElementChangedEventArgs<FloatingActionButton> e)
        {
            base.OnElementChanged(e);
            if (e.NewElement != null && Control == null)
            {
                _backgroundView = new View(this.Context);
                _backgroundView.LayoutParameters = new LayoutParams(LayoutParams.MatchParent, LayoutParams.MatchParent);
                _backgroundView.SetBackgroundColor(Color.Blue);
                _backgroundView.BringToFront();
                _backgroundView.SetMinimumHeight(100);
                _backgroundView.SetMinimumWidth(100);
                _backgroundView.Left = 50;
                _backgroundView.Top = 100;
                SetWillNotDraw(false);
                SetNativeControl(_backgroundView);
            }

        }
    }
}

No matter what I try (hence lots of positioning, coloring, etc in the renderer) I can't get this custom view to appear in a RelativeLayout, but if I change the XAML to use a StackLayout it appears no problem. What am I missing?


Themes Appears to be broken

$
0
0

When you add the pre-release versions of the theming (that is ancient) it doesn't work with .180 coming up with null reference exceptions.

When can we expect this to be fixed/updated and to work properly?

Xamarin (dutch) DigiD (SAML) authentication

$
0
0

Hi,

Are there some Dutch people who already tried to connect with the dutch DigiD authority based on SAML or CGI? I'm curious about your findings...

BR,
Martijn

How i can do it like this?

Smart watch as an identification tool

$
0
0

Hi there
I'm developing a s/w for bio-impaired people who make punches at the Android-based terminal clock. I never worked with the wear devices and the idea is to use their smart watch to make a punch in/out. Any clue or links to an analogous approach? How to use the Blue Tooth to communicate with the watch?
Thanks

Target platform is greyed out in xamarin forms app

$
0
0

Hi!

I have installed Xamarin studio in my mac. But when I want to create app using xamarin forms app, the target platform is greyed out, both the Android and iOS. I have installed Android SDK and XCode, separately in different time.
Could anyone please help me with this?

Scrollview - how to scroll to bottom programatically or automatically?

$
0
0

Hello friends,

I have a scrollview with a stacklayout inside. I add labels to the stacklayout, and I can scroll manually but i want that when i add a new label the scroll goes to the bottom of the scroll, because in this moment if i don't move it, the scroll is always at the beginning.

Any piece of advice?

Thanks a lot in advance!

Display image issue on scrolling in listview

$
0
0

Hi,

I am developing app using cross platform tool Xamarin using Xamarin forms. I am binding the Image and text in Listview. For Image binding I am using the code as ProfileImage.Source = ImageSource.FromStream(() => file.GetStream());

Now the problem is whenever I have lots of data around 5000 and when I scrolling then irregular behavior I found with Image column, Image for row 2 will show in Image for Row 1 and it happens all the way around.

Please help me on this as I am struggling a long back but unable to fix it.

Thanks,


ScrollView with Editor inside bug

$
0
0

Hello everyone,

In my page i have this scenario:

  • ContentPage
    -- ScrollView
    ----StackLayout
    ------Entry
    ------Editor

If i focus inside an Editor the screen bug like this:

without keyboard and focus inside the editor the screen shows this:

We need a editor because is like a "e-mail program".

Thanks

Why is the text in a listview shown in accent color (android)?

$
0
0

When I use a listview in xamarin forms and compile fro android, the text is rendered in pink:

I believe that is the accent color.

I find that strange, why is this color used?

Adding a picker in XAML

$
0
0

I'd like to add a picker control that has the values 1,2,3,4,5.

I tried the following...

        <Picker SelectedIndex="{Binding NewCriterion.Importance}" >
            <Items>
                <x:String>"1"</x:String>
                <x:String>"2"</x:String>
            </Items>
        </Picker>

to no avail. The documentation is a bit sparse on how to do this in XAML. Help?

CachedImage FFImageLoading for Xamarin.Forms

$
0
0

https://github.com/molinch/FFImageLoading or https://github.com/daniel-luberda/FFImageLoading/ (new Forms features)

DEMO: https://github.com/daniel-luberda/FFImageLoading/tree/master/samples/ImageLoading.Forms.Sample

Caching support

The library automatically deduplicates similar requests: if 100 similar requests arrive at same time then one real loading will be performed while 99 others will wait. When the 1st real read is done then the 99 waiters will get the image.

Both a memory cache and a disk cache are present.

By default, on Android, images are loaded without transparency channel. This allows saving 50% of memory since 1 pixel uses 2 bytes instead of 4 bytes in RGBA (it can be changed).

WebP support

WebP is supported on both iOS and Android.

Downsampling

Downloaded images can be automatically downsampled to specified size (less memory usage). DownsampleHeight and DownsampleWidth properties

Retry

Downloads can be repeated if not succeeded: RetryCount and RetryDelay properties.

Placeholders support

  • LoadingPlaceholder

  • ErrorPlaceholder

image image

After this pull it'll also support Transformations!
https://github.com/molinch/FFImageLoading/pull/47

Transformations support

It doesn't modify original source images. Example:

  • RoundedTransformation

  • CircleTransformation

  • GrayscaleTransformation

image image

... and some more features. Feel free to test it. Not all features are on nuget yet (older version).

re-use xaml code coming from windows store app

$
0
0

Hi all,

I have a WIN8.1 store app developed with Prism architectural principles. It has a lot of XAML views that I would like to re-use to the maximum if possible.
Now recently I have started a Xamarin Forms, Prism template-based new solution, hoping to be able to re-use a lot of code, including XAML code. We have purchased the SyncFusion complete toolset. Now I am facing the challenge to port the "old" XAML into the new "dialect" of Xamarin Forms.

Surely I hope that we do not have to build from scratch. In the mean time I have understood that there is no (visual) aid for designing XAML in Xamarin Forms environment. How does one ever design a proper looking XAML View with no visual support at all?

Anyone with experience, hints or tips on how to achieve what we are aiming at?

Regards,

Peter

Viewing all 91519 articles
Browse latest View live