Hi all,
Any one have idea about Integrate Payment(Judo) In Xamarin Forms? please post the code here.
Thanks In Advance
Payment gateway integration
Problem using Tasks with Spinners and Unit Tests
Hi, I'm having trouble with showing a spinner/running a unit test. My unit test seems to fail due to Xamarin not supporting Task.Run()? If I uncomment the Task.Run out then the test completes successfully but my spinner doesn't show initially when I want it to, i.e. immediately after a button click.
My SomeCodeAsync method contains an API call which retries if it fails the first time and it was this which forced my hand into using the Task.Run().
Button click event...
//Show loading spinner
LoadingVisible = true;
await Task.Run(async () =>
{
await SomeAsyncTask();
});
This is just massively frustrating, can anybody please advise on what options I have to solve this?
Thanks
ACR.UserDialogs Splat - Could not be resolved as it was built against Version=v5.0
Hi
Since upgrading my version of Visual Studio 2019 to the latest build I have been unable to build my project.
Is anyone getting this same message or do you know how to resolve it?
I am using Splat 2.0.0 as I am user ACR.UserDialogs 6.5.1 as part of a shared project.
.nuget/packages/splat/2.0.0/lib/netstandard1.1/Splat.dll" could not be resolved because it was built against the ".NETPortable,Version=v5.0" framework. This is a higher version than the currently targeted framework ".NETPortable,Version=v4.5,Profile=Profile111".
Many thanks in advance
Setting Focus from one Entry to another Entry in code closes and opens SoftKeyboard on Android
On Xamarin form page if we have two Entry controls and now in code when we change Focus from one Entry to another Entry control the "SoftKeyboard" closes once the first Entry control looses focus and it opens again when the cursor is positioned on second Entry Control. This happens only on Android not on IOS. Any reason why this happens?
Getting blank screen when navigating after animation
After the animation is triggered on the first page changing pages on the menu gives a blank page.
Open App > Click any of the two buttons to trigger the animation > Menu > About Page > Blank "Error"
After that you can click the square button of the android and re-open the app will open the page normally .
Tested with Android Oreo 8.1 API 27 (Emulator and Mobile)
I'm using MasterDetail
Xamarin Forms 4.0.0.425677
NETStandard.Library 2.0.3
Project/Code
=> github/farukaf/XamarinTeste
Tryed:
Removing the animation fix but I would like to have some animation/transition.
Removing only the Translate animation.
Update to Xamarin Forms 4.0.0.540366
Hipotesis:
The HeaderMenu also disappears but if I swipe from left to right calls the menu again. Thinking that some kind of refresh after setting the Detail could fix?
This APK results in unused code and resources being sent to users?
why google shows below warning for App Bundles? I mean it is clear that google wants us to use app bundles and this is why we see this warning but how does google now my app has unused code and resources? what does it mean exact meaning of "results in unused code and resources"?
Unoptimised APK
Warning:
This APK results in unused code and resources being sent to users. Your app could be smaller if you used the Android App Bundle. By not optimising your app for device configurations, your app is larger to download and install on users' devices than it needs to be. Larger apps see lower installation success rates and take up storage on users' devices.
Best solution to implement realtime sockets?
Hi guys,
I'm giving up with SignalR, as an exception is always occuring when turning on airplane mode / turning off WiFi. (Fatal signal 11 SIGSEGV)
Is there any other library you can recommend me to implement realtime sockets with broadcasting features?
Thanks a lot.
NaN is not a valid value for width
I have this error in my xamarin app whe I testing in iOS 11.0 or higher : NaN is not a valid value for width, any one can help me with that??. I use xamarin.forms version 2.5.0.280555
Connect to backend web api on Android Emulator
Hi,
I'm using visual studio 2019.
I created new xamarin project, chose tabbed template and included backend web api.
I tested the app on android emulator, it worked perfectly when using MockDataStore class and returns a list of items.
Whenever I try to use AzureDataStore, the list returns No records.
I tested the link "http://10.0.2.2:5000/api/item" on emulator browser, it worked and return json items as expected.
I only can't get it worked inside the app.
Any idea?
Inverted ListView animation issues
I am trying to make a chat application that is scrolled to the bottom by default, and whenever new items are added to the source, it stays scrolled to the bottom.
One method I've seen to do this is to define FlowDirection="RightToLeft" and Rotation="180" on the ListView, and FlowDirection="LeftToRight" and Rotation="180" on the individual items.
This works fairly well, but in iOS it can be very jerky and bizarre. When rotating your device to landscape, for instance, all of the items and the ListView will animate rotating/spinning and act up. I haven't found a good way around this. It seems to work okay in Android.
How to resize AdControl in UWP dynamically ?
I have implemented banner ads in UWP. It works fine but i cant figure out how to refresh or resize the ad if user changes the size of UWP app in desktop.
Code looks like as below. OnElementChanged is called only once when Adview on forms side is loaded. If I resize the window, it never gets called, only MeasureOverride method and OnPropertyChanged are called. but from here, i am not sure how to call GetAd method again or how to request a new size for my ad. Because I want to display a vertical ad instead of horizontal banner ad for if Width > height. For that i need to recalculate AdControl.
public class AdRenderer : ViewRenderer<Helpers.Controls.AdView, AdControl>
{
private const bool _hasSideMenu = true;
private const int _sideBarWidth = 320;
public AdRenderer()
{
}
protected override Size MeasureOverride(Size availableSize)
{
return base.MeasureOverride(availableSize);
}
protected override void OnElementChanged(ElementChangedEventArgs<Helpers.Controls.AdView> e)
{
base.OnElementChanged(e);
GetAd(e);
}
private void GetAd(ElementChangedEventArgs<Helpers.Controls.AdView> e)
{
try
{
var ad = new Microsoft.Advertising.WinRT.UI.AdControl
{
IsAutoRefreshEnabled = true
};
if (e.OldElement != null)
{
return;
}
if (Control == null)
{
var availableWidth = Window.Current.Bounds.Width;
var availableHight = Window.Current.Bounds.Height;
if (_hasSideMenu)
{
var isDesktop = Windows.System.Profile.AnalyticsInfo.VersionInfo.DeviceFamily == "Windows.Desktop";
if (isDesktop)
{
availableWidth = Window.Current.Bounds.Width - _sideBarWidth;
}
}
if (availableWidth >= 728)
{
ad.Width = 728;
ad.Height = 90;
}
else if (availableWidth >= 640)
{
ad.Width = 640;
ad.Height = 100;
}
else if (availableWidth >= 320)
{
ad.Width = 320;
ad.Height = 50;
}
else if (availableWidth >= 300)
{
ad.Width = 300;
ad.Height = 50;
}
//if (availableHight < availableWidth)
//{
// ad.Width = 160;
// ad.Height = 600;
//}
e.NewElement.HeightRequest = ad.Height;
SetNativeControl(ad);
}
}
catch (System.Exception ex)
{
}
}
private void OnErrorOccurred(object sender, AdErrorEventArgs e)
{
}
}
x:Reference Array
I've got an IMarkupExtension like so:
<controls:TouchableView
x:Name="touchGrid"
HorizontalOptions="FillAndExpand" VerticalOptions="FillAndExpand"
AffectedStatefulObjects="{ext:StatefulMarkup Names='flavorText,flavorShape,flavorBackground', ParentView={x:Reference contentView}}">
</controls:TouchableView>
public class StatefulMarkupExtension : IMarkupExtension
{
public IAffinityStatechangable[] AffectedStatefulObjects;
public ContentView ParentView { get; set; }
public string Names { get; set; }
//public IAffinityStatechangable[] Names { get; set; }
public StatefulMarkupExtension()
{
}
object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider)
{
IProvideValueTarget provideValueTarget = serviceProvider.GetService(typeof(IProvideValueTarget)) as IProvideValueTarget;
var parent = ParentView;
string[] names = Names.Split(',');
List<IAffinityStatechangable> objects = new List<IAffinityStatechangable>();
foreach (string n in names)
{
var t = parent.FindByName(n) as IAffinityStatechangable;
objects.Add(t);
}
return objects.ToArray();
}
}
How can I provide a list of objects as an x:Array of x:References of some type, where in the above, flavorText, flavorShape, and flavorBackground are all custom controls in the same contentView as contentView that have a common interface I made called IAffinityStatechangable?
Seems a lot cleaner than passing a string of names and splitting it, even though it works, plus I wouldn't have to do a "FindByName." I want Names to be an IAffinityStatechangable[] as commented out above.
SignalR with Airplane On / Wifi Off -> Crashes app! (SIGSEGV)
Hi guys,
I'm using in my PCL Xamarin.Forms application a SignalR-Client class which connects to my SignalR-Server, the connection itself works fine, pakets are transported well and the Client is able to communicate with the Server.
I'm NOT using the AspNetCore SignalR instead I'm using the AspNet SignalR .NET library, as it offers more events and functionality.
I receive this error only when I try it on my real device, when working with the Android Emulator, the error doesn't appear. I don't know why.
Emulator Android Version: Pie 9.0
Samsung Device Version: Oreo 8.0
Therefor, when I turn on the airplane mode or turn off WiFi on my device, I get an SIGSEGV error, which is the following:
=================================================================
Native Crash Reporting
Got a SIGSEGV while executing native code. This usually indicates
a fatal error in the mono runtime or one of the native libraries
used by your application.
=================================================================
Basic Fault Adddress Reporting
Memory around native instruction pointer (0x76d330b678):0x76d330b668 00 1c 40 b9 c0 03 5f d6 fd 7b bf a9 fd 03 00 91 ..@.....{......
0x76d330b678 08 20 40 b9 a8 00 c8 37 88 01 e0 37 00 00 40 f9 . @....7...7..@.
0x76d330b688 fd 7b c1 a8 c0 03 5f d6 60 08 00 b0 01 0a 00 f0 .{............
0x76d330b698 03 0a 00 f0 00 24 06 91 21 80 08 91 63 8c 0a 91 .....$..!...c...
No native Android stacktrace (see debuggerd output).
=================================================================
Managed Stacktrace:
at <unknown> <0xffffffff>
at System.Threading._ThreadPoolWaitCallback:PerformWaitCallback <0x00007>
at :runtime_invoke_bool <0x0006f>
07-01 17:35:46.316 E/mono-rt (21080): /proc/self/maps:
07-01 17:35:46.316 E/mono-rt (21080): 12c00000-52c00000 rw-p 00000000 00:01 12723 /dev/ashmem/dalvik-main space (region space)_2562_2562 (deleted)
07-01 17:35:46.316 E/mono-rt (21080): 6fef3000-7019b000 rw-p 00000000 fe:00 261228 /data/dalvik-cache/arm64/system@framework@boot.art
07-01 17:35:46.316 E/mono-rt (21080): 7019b000-702a1000 rw-p 00000000 fe:00 261231 /data/dalvik-cache/arm64/system@framework@boot-core-libart.art
07-01 17:35:46.316 E/mono-rt (21080): 702a1000-702ec000 rw-p 00000000 fe:00 261232 /data/dalvik-cache/arm64/system@framework@boot-conscrypt.art
07-01 17:35:46.316 E/mono-rt (21080): 702ec000-70329000 rw-p 00000000 fe:00 261233 /data/dalvik-cache/arm64/system@framework@boot-okhttp.art
07-01 17:35:46.316 E/mono-rt (21080): 70329000-7032d000 rw-p 00000000 fe:00 261234 /data/dalvik-cache/arm64/system@framework@boot-legacy-test.art
07-01 17:35:46.316 E/mono-rt (21080): 7032d000-70370000 rw-p 00000000 fe:00 261235 /data/dalvik-cache/arm64/system@framework@boot-bouncycastle.art
07-01 17:35:46.316 E/mono-rt (21080): 70370000-703ab000 rw-p 00000000 fe:00 261236 /data/dalvik-cache/arm64/system@framework@boot-ext.art
07-01 17:35:46.316 E/mono-rt (21080): 703ab000-70ccf000 rw-p 00000000 fe:00 261237 /data/dalvik-cache/arm64/system@framework@boot-framework.art
07-01 17:35:46.316 E/mono-rt (21080): 70ccf000-70d84000 rw-p 00000000 fe:00 262670 /data/dalvik-cache/arm64/system@framework@boot-telephony-common.art
07-01 17:35:46.316 E/mono-rt (21080): 70d84000-70d8d000 rw-p 00000000 fe:00 262672 /data/dalvik-cache/arm64/system@framework@boot-voip-common.art
07-01 17:35:46.316 E/mono-rt (21080): 70d8d000-70d95000 rw-p 00000000 fe:00 262677 /data/dalvik-cache/arm64/system@framework@boot-ims-common.art
07-01 17:35:46.316 E/mono-rt (21080): 70d95000-70db9000 rw-p 00000000 fe:00 262788 /data/dalvik-cache/arm64/system@framework@boot-apache-xml.art
07-01 17:35:46.316 E/mono-rt (21080): 70db9000-70de5000 rw-p 00000000 fe:00 262847 /data/dalvik-cache/arm64/system@framework@boot-org.apache.http.legacy.boot.art
07-01 17:35:46.316 E/mono-rt (21080): 70de5000-70dea000 rw-p 00000000 fe:00 262854 /data/dalvik-cache/arm64/system@framework@boot-smartbondingservice.art
07-01 17:35:46.316 E/mono-rt (21080): 70dea000-70df1000 rw-p 00000000 fe:00 262864 /data/dalvik-cache/arm64/system@framework@boot-sprengine.art
07-01 17:35:46.316 E/mono-rt (21080): 70df1000-70df2000 rw-p 00000000 fe:00 262883 /data/dalvik-cache/arm64/system@framework@boot-android.hidl.base-V1.0-java.art
07-01 17:35:46.316 E/mono-rt (21080): 70df2000-70df5000 rw-p 00000000 fe:00 262903 /data/dalvik-cache/arm64/system@framework@boot-android.hidl.manager-V1.0-java.art
07-01 17:35:46.316 E/mono-rt (21080): 70df5000-70dff000 rw-p 00000000 fe:00 262910 /data/dalvik-cache/arm64/system@framework@boot-timakeystore.art
07-01 17:35:46.316 E/mono-rt (21080): 70dff000-70e08000 rw-p 00000000 fe:00 262923 /data/dalvik-cache/arm64/system@framework@boot-fipstimakeystore.art
07-01 17:35:46.316 E/mono-rt (21080): 70e08000-70e09000 rw-p 00000000 fe:00 262925 /data/dalvik-cache/arm64/system@framework@boot-ucmopensslenginehelper.art
07-01 17:35:46.316 E/mono-rt (21080): 70e09000-70e0d000 rw-p 00000000 fe:00 262926 /data/dalvik-cache/arm64/system@framework@boot-esecomm.art
07-01 17:35:46.316 E/mono-rt (21080): 70e0d000-70e0e000 rw-p 00000000 fe:00 262928 /data/dalvik-cache/arm64/system@framework@boot-SemAudioThumbnail.art
07-01 17:35:46.316 E/mono-rt (21080): 70e0e000-70e48000 rw-p 00000000 fe:00 262930 /data/dalvik-cache/arm64/system@framework@boot-knoxsdk.art
07-01 17:35:46.316 E/mono-rt (21080): 70e48000-70e75000 rw-p 00000000 fe:00 262932 /data/dalvik-cache/arm64/system@framework@boot-sec_edm.art
07-01 17:35:46.319 F/libc (21080): Fatal signal 11 (SIGSEGV), code 1, fault addr 0x20 in tid 21184 (Thread Pool Wor)
As image:
Edit code during debug session on Android
Hi guys! This seems to be a quite noobish problem, nonetheless, still encountering the issue...
Some details: Xamarin Forms, PCL, Android emulator.
Is there any way to edit the code during a debug session? Also, is there a way to step back in the code during debugging? I assume the target emulator is not capable do these things, or is it? I also have a physical Android phone, which might help the situation.
How to handle CollectionView ItemTapped?
Hi everybody!
I'm using CollectioView
Now I want handle ItemTapped from MVVM. Currently I use SelectedItem but the Item selected will be change the color, I don't want it.
I can not find ItemTapped in CollectionView.
Could you please suggest me the best way to implement this!
Thank you!
Webview not Scrollable using Shell
I'm using Shell in Xamarin 4.1 for a New Project. And I tried everything but I can't make this WebView to be Scrollable.
<StackLayout>
<ScrollView VerticalOptions="FillAndExpand">
<WebView Source="mysite" VerticalOptions="FillAndExpand" HorizontalOptions="FillAndExpand"/>
</ScrollView>
</StackLayout>
Am I doing something wrong?
Xamarin Forms TableView Color Binding doesnt work
hi,
I'm building an interface for a settings page of an app. Currently I am at the themes of the app. Everything works very well. The colors are exchanged automatically against the new ones (header, text, etc.). For the individual setting points I use the TableView element on the basis of an example. However, the colors of the TableView are not changed when the theme is changed. I can't find a solution. Can anyone help?
The XAML of the page:
<ContentPage.Content>
<StackLayout BackgroundColor="{DynamicResource StackLayoutBackgroundColor}">
<TableView Intent="Settings"
BackgroundColor="{DynamicResource TableViewBackgroundColor}">
<TableRoot>
<TableSection TextColor="{DynamicResource TableViewTitleForegroundColor}" Title="Darstellung">
<SwitchCell On="true" Text="Moderner Feed" OnColor="{DynamicResource PrimaryColor}" />
<ViewCell>
<StackLayout
Padding="15,0,20,0"
Orientation="Horizontal"
VerticalOptions="Center">
<StackLayout.GestureRecognizers>
<TapGestureRecognizer NumberOfTapsRequired="1"
Tapped="Handle_Tapped" />
</StackLayout.GestureRecognizers>
<Label Text="Theme" XAlign="Center" />
<Label
HorizontalOptions="EndAndExpand"
Text=">"
XAlign="Center" />
</StackLayout>
</ViewCell>
</TableSection>
</TableRoot>
</TableView>
</StackLayout>
</ContentPage.Content>
kind regards
Add tap events to elements inside an SVG using SkiaSharp in Xamarin.Forms
I want to add tap events inside the SVG ,want to get location or specific any detail .Is it possible?
BindableProperty does not notify when its property is set
Hi all,
I am developing my own DynamicGrid and I have added to it BindableProperty:
public static readonly BindableProperty DynamicRowDefinitionProperty =
BindableProperty.Create( // Or BindableProperty.CreateAttached it does not matter
"DynamicRowDefinition",
typeof(RowDefinition),
typeof(DynamicGrid),
defaultValue: null,
defaultValueCreator: bindable =>
{
var rowDef = new RowDefinition();
rowDef.SizeChanged += ((DynamicGrid)bindable).OnDefinitionChanged;
return rowDef;
},
propertyChanged: OnDynamicRowDefinitionPropertyChanged);
public static void OnDynamicRowDefinitionPropertyChanged(BindableObject bindable, object oldValue, object newValue)
{
if (oldValue != newValue)
{
}
}
public void OnDefinitionChanged(object bindable, EventArgs newValue)
{
Console.WriteLine("OnDefinitionChanged");
}
public RowDefinition DynamicRowDefinition
{
get { return (RowDefinition)GetValue(DynamicRowDefinitionProperty); }
protected set { SetValue(DynamicRowDefinitionProperty, value); }
}
, but when I try to set Height of DynamicRowDefinition it does not set Height :
<utilscontrols:DynamicGrid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<utilscontrols:DynamicGrid.DynamicRowDefinition
Height="20" />
<!-- ... -->
</utilscontrols:DynamicGrid>
But by some reason I do not receive OnDefinitionChanged when Height is set to value "20"
What did I wrong ?
Background task even when the app is closed
Hi All,
i am building an Xamarin Forms App which retrieves location data from the device when its running as background service and when its connected to the server it would send the gps data to the server. The functionality of the app must not stop when the app is closed. Can you guys guide me through the process, or provide me some reference or sample code to do this. I am really struggling to make the app run in the background when its closed.
Regards,
Zak