Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all 204402 articles
Browse latest View live

iOS Launch Images not showing up

$
0
0

I hate to ask a question that I know there must be an easy answer to, but for the life of me I can't get iOS to launch with the right launch images!

I have edited the iOS settings, and moved the assets to Asset Catalogues. Then opened up that Contents.json and added images for each box. No cigar. Everytime I launch, I get a blue background with my app icon centered in the middle.

Thanks in advance for any help.


MessageCenter.Unsubscribe *doesn't* unsubscribe - Anyone else see this.

$
0
0

Case

I have a ViewModel that lives for the lifespan of the app.
When a given feature is turned on, I subscribe to a given MessagingCenter message.
When the feature is turned off, I unsubscribe.
{repeat}
Seems simple enough.

Problem

Despite the unsubscribing the handler for the subscription is getting called once for every .Subscribe taking place. As if the .Unsubscribe isn't doing its job.

Test

In a fit of desperation I even tried to .Unsubscribe 10 times using both overloads of the method. If there is not subscription existing then no-harm-no-foul, right?

Yet the multiple handling of the single incoming message still happens. Anyone else run across this?

It seems related to, but not identical as, this thread... For one thing, I'm not disposing of either the View or the ViewModel - so there shouldn't be an orphaned subscription hanging out there. this is always the same instance of this in other words.
https://forums.xamarin.com/discussion/20420/messagingcenter-causing-problems-if-unsubscribing-within-message-handler
I didn't want to hijack that thread for a new issue.

@JohnMiller You wrote the nice article on unsubscribing... Any thoughts?

Desperation code

I really figure that 10 times the unsubscribes for every subscribe would stop this. Alas, no.
Keep in mind, this is in addition to unsubscribing when the feature gets turned off. Just to be safe/robust/cover all the bases/find anything that works.

            MessagingCenter.Unsubscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions
            MessagingCenter.Unsubscribe<SettingsManager>(this, nameof(SettingsUpdatedMessage));//Avoid duplicate subscriptions

            MessagingCenter.Subscribe<SettingsManager, SettingsUpdatedMessage>(this, nameof(SettingsUpdatedMessage), (sender, args) =>
            {
                OnSettingsChanged();
            });

Automatic Provisioning with Visual Studio for Mac

$
0
0

Anyone that has provisioned an iOS device for development knows that it is a confusing process! We've tried to make that easier for you with automatic provisioning in Visual Studio for Mac.

Read our blog for information on how to get started today.

Enjoy!

Adding rows to a grid using MVVM

$
0
0

On a page where I am displaying a receipt to a user, I have a section which lists the subtotal, any taxes, and the total. Since the taxes applicable vary by region and based on the products being sold, the number of rows in this section will vary. For example, here are 3 separate orders, one with GST and PST, one with just GST, and one with neither:



I've accomplished this by putting just the SubTotal in the grid in XAML, and adding the rest in the code-behind in a method I call from the ViewModel. However, I'd really like to avoid doing it this way, so I'm wondering if there is an approach to accomplishing this which doesn't require having a bunch of code in the View's code-behind. I'd like to do this while keeping the columns nicely aligned as if they were in a single grid, and without adding any weird spacing between the rows.

[Xamarin.Forms] ImageSource -> Uri -> String?

$
0
0

Hi,

I've been using this code here as a template for my own code.

Basically I get a ImageSource object from my Android code and set the image.Source variable and the image is shown just great.
However in my Xamarin.Forms page code I want to save an object to a database (which I know how) with the Uri as a String of that ImageSource. The problem is that I do not know how to properly convert a ImageSource object into a Uri as String... and then back again ofc. Anyone have a suggestion?

Sidenote: I am extremely knew to Xamarin.

Thanks,

Bobby Kristensen

Image.Source to String

$
0
0

Buenas amig@s.
En mi proyecto, quiero guardar un objeto en una base de datos (que sé cómo) con el Uri como una cadena de ese ImageSource. El problema es que no sé cómo convertir adecuadamente un objeto ImageSource en un Uri como String ...
Me gustaria saber como convertir el url de la imagen a un string para poder guardarlo en una base de datos local.
Saludos y gracias de antemano

Xamarin Forms Bluetooth

$
0
0

Hi,
I am trying to create a Portable Class library Xamarin Form project in which I need to use Bluetooth of the device to communicate with HC-05 Bluetooth module using serial communication. I want the code to be cross-platform. Can anybody please guide me step by step how can I do a single coding for both Android and iOS platform in Xamarin Forms. I don't want to opt for platform-specific coding. Thanks in advance

Storyboard editing, too slow (4.1.0)

$
0
0

I really like new feature that is storyboard editting in xamarin studio. but so so slow. (I use mac mini server)

I guess that the problem caused by too many grid lines.


Error with OnPlatform and x:TypeArguments="x:Double" on xaml

$
0
0

Why this xaml

 <BoxView HorizontalOptions="Fill" VerticalOptions="Fill" BackgroundColor="Red" >
            <BoxView.HeightRequest>
                <OnPlatform x:TypeArguments="x:Double">
                    <On Platform="iOS">20</On>
                    <On Platform="Android">50</On>
                </OnPlatform>
            </BoxView.HeightRequest>
        </BoxView>

gives me the error No property, bindable property, or event found for 'HeightRequest', or mismatching type between value and property on 2.5.0.121934?

Xamarin.Forms for Mac Unit Tests

$
0
0

Working on a Xamarin Forms app targeting mac and I am trying to get Unit Tests working.

My project structure:
-Xamarin Mac App (Xamarin.Mac Full)
-Xamarin Mac Library (Xamarin.mac Full)
-Xamarin Shared App

These 3 work perfectly with NuGet references etc.

Creating a Nunit Library project I cannot reference the Xamarin Mac Library as it says it is incompatible with Xamarin Mac, 2.0

So then I tried creating a new Xamarin Mac app, was able to reference my Mac Library, but am getting an error at runtime: NUnit.Engine.NUnitEngineException: The NUnit 3.0 driver does not support the portable version of NUnit.

Anyone else hit this issue yet?

Do I need a Mac even when I am developing on Windows

$
0
0

I want to develop an Apple app on a Windows 10 Laptop. I have downloaded Visual Studio 2017 and began to create an App. When I test the app, it is asking me to connect to a Mac. Do I ready need a Mac to be able to test my apps or is there something else I can get round it please?

I have got an IPad if I can test apps on that if possible?

Xamarin.Forms.props

$
0
0

Since I upgrade to 15.5 visual studio I am getting this file missing error Xamarin.Forms.props.
This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see

http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is ....\packages\Xamarin.Forms.2.5.0.121934\build\netstandard1.0\Xamarin.Forms.props.

What TCP/UDP ports does Xamarin for VS use?

$
0
0

I use Visual Studio 2017 with Xamarin VS in Parallels on Mac but Android emulators work fine only in Mac OS so I had to create a ssh tunnel and redirected some ports from Windows to Mac to Android emulators worked. I did it experimental I didn't know what ports I had to redirect exactly that all Xamarin services worked.

What ports should I redirect that all Xamarin services (Inspector, Profiler and etc) work exactly?

Thanks

Why can't I run my Android app?

$
0
0

Environment: Mac High Sierra, Visual Studio Community for Mac v.7.3 (build 797)

I tried to create my first Xamarin.Forms project from scratch. Before doing any editing, I tried to compile and run the Android portion from what's provided out of the box.

Unfortunately, I got this error:

java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.DebugRuntime!

Caused by: android.content.pm.PackageManager$NameNotFoundException: Mono.Android.DebugRuntime

Does anyone have any idea?

Xamarin IoT, problems with launching

$
0
0

I created IoT project and connected to my raspberry pi, but after launching the application the log was a recorded message about the failure, without any errors. If you have successful startup experience, please share.


Scanning using ZXing.Net.Mobile.Forms ZXingScannerView

$
0
0

How do I use the ZXingScannerView in a content page to Scan a QR Code? I also want to have a red rectangle (Target Area) inside of the view with a cancel button to end the scanning. How do I accomplish this using ZXingScannerView?
Ask?
1. Scan
2. Target Area
3. Cancel Button

Any insights would be helpful.

ScrollView not updating when elements are changed on Android

$
0
0

I have a ContentPage, with a ScrollView that has a StackLayout with a couple of nested StackLayouts.

Essentially:

public class Widgets : ContentPage
{
    StackLayout layout;
    public Widgets()
    {
        layout = new StackLayout()
        {
            VerticalOptions = LayoutOptions.FillAndExpand,
            Orientation = StackOrientation.Vertical
        };

        var Widget = new Wiget();
        layout.Children.Add(Widget.Render());
        //Widget.Render() returns a StackLayout with some other UI elements, it also loads some items from the web and adds them to the stacklayout.

        var Widget2 = new Wiget2(); //Same idea...
        layout.Children.Add(Widget2.Render());

        Content = new ScrollView()
        {
            HorizontalOptions = LayoutOptions.FillAndExpand,
            VerticalOptions = LayoutOptions.FillAndExpand,
            Content = layout
        };
    }
}

When the Widget class finishes loading the web items, and adds them to the stacklayout, the new elements are not rendered, in fact any change to the UI does not get rendered. The widgets display a Loading icon while the items are loading, this is displayed properly and the loading icon disappears when loading is complete, but the new elements do not show up.

This appears this when running on Android, the ScrollView and related Widget elements work properly on iOS. Admittedly I can only try Android on the emulator so not sure if it is an issue with it. I am using the built-in Android_Accelerated_Nougat with API version 25. (7.1.1)

Can i change the view (.xaml) to PageModels using FreshMvvm?

$
0
0

I'm using FreshMvvm on my Portable Project (Android, iOS), currently i have a project designed only for Tablets and IPads, and i would to develop a version for Phones... i'm looking a way to re-use my PageModels and use a diferent Page(xaml) depending if is the app is running on a Tablet or a Phone, there is a way to do this without create a new Project?

Cannot authorize Xamarin to access Google Play account

$
0
0

Hi,
I have an app published to the Play Store. Yesterday my laptop crashed and I had to reinstall Windows and Visual Studio. After I set everything up, I tried to publish an updated version of the app to the store. Upon reaching the "Register Google API Access" screen, I fill in the Client Id and Client Secret fields, then I hit Register. A Google authorization page loads in the browser, I give the required authorization and then I get back the standard success message ("Received verification code. You may now close this window"). However, after switching back to Visual Studio, I see this:

Looking at the Xamarin logs, I found this exception:

System.TypeInitializationException: The type initializer for 'Google.Apis.Json.NewtonsoftJsonSerializer' threw an exception. ---> System.IO.FileNotFoundException: Could not load file or assembly 'Newtonsoft.Json, Version=10.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies. The system cannot find the file specified. at Google.Apis.Json.NewtonsoftJsonSerializer..ctor() at Google.Apis.Json.NewtonsoftJsonSerializer..cctor() --- End of inner exception stack trace --- at Google.Apis.Json.NewtonsoftJsonSerializer.get_Instance() at Google.Apis.Auth.OAuth2.Requests.TokenRequestExtenstions.<ExecuteAsync>d__0.MoveNext()

So it seems like Xamarin is trying to use version 10.0.0.0 of Json.NET, which cannot be located. I have no idea about how to solve this. Where is the Json.NET dll that Xamarin is using located? Please help as I need to get this app update out ASAP.

Thanks in advance

Help with Components folder

$
0
0

Hello. I have a problem. After reinstalling Visual Studio 2017, the Components folder does not display in the Solution Explorer. Is it possible to manually enable the Components folder?

Im start blank Android c# projekt.

Viewing all 204402 articles
Browse latest View live


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