Quantcast
Channel: General — Xamarin Community Forums
Viewing all 5066 articles
Browse latest View live

专业办加拿大西安大略UWO仿真毕业,证,成绩单“(薇/扣87527357)学历证书,UWO录取通知书.UWO留信网认证UWO学历文凭。学位证使馆归国人员证明

$
0
0

专业办加拿大西安大略UWO仿真毕业,证,成绩单“(薇/扣87527357)学历证书,UWO录取通知书.UWO留信网认证UWO学历文凭。学位证使馆归国人员证明


any video ad integrations available for playback less than 100% of the screen?

$
0
0

we're trying to get regular impressions counted when showing a playable etc. type ad video but we want to show our menu bar below the ad. Appodeals has a great sdk demo for xamarin, but their video ads have to be shown at 100% screen. vungl allows for less than 100% but are there any others where any of you have seen a xamarin integration for them? We are trying to get vungl to work right now so if anyone has this cross platform that would be amazing...

Releasing multiple apps for different organizations using single codebase

$
0
0

Hi,
I have single project & I need to release multiple apps to production for multiple organizations(Code always will be the same) just by changing few things below:
1. App icons, splash screen icons
2. Package name, app name
3. Google-service.json file(As apps using firebase push notifications)
How can I do it dynamically, so by just adding any .dll or .sln file my build will be ready for specific organization instead of doing those changes manually
Thank you

How to add image to datepicker

$
0
0

How can i add a calendor icon of my own to the date picker in xaml.
I have written this in my sample.xaml

Send link in push notification through Firebase Cloud Messaging

$
0
0

Hello
I have a Xamarin android application integrated with Firebase cloud messaging. How can I send a link in the push notifications. So that, whenever a user clicks, it opens the link directly in-app browser.

Best book as a reference to develop xamarin forms apps

$
0
0

Hi people! I'm a newbie developer on xamarin.forms...Can you suggest to me a book as a reference to improve my technical skills?
Thank you very much in advance

Why can't I see x:Name in my .cs when control is within a StackLayout?

$
0
0

Hi

This is my current XAML

<?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:App2"
             x:Class="App2.MainPage">
    <ScrollView BackgroundColor="White">
        <StackLayout>
            <!-- Place new controls here -->
            <ActivityIndicator VerticalOptions="Center" HorizontalOptions="Center" x:Name="activity_indicator" Color="#4D7EE1" />
                <Image x:Name="imgTopStory" />
                <ListView x:Name="homePage" HasUnevenRows="True" IsPullToRefreshEnabled="True" Margin="15,0,15,0">
                    <ListView.Header>
                        <StackLayout Orientation="Horizontal">
                            <Label Text="Top Stories" TextColor="Black" FontSize="32" FontAttributes="Bold"  />
                        </StackLayout>
                    </ListView.Header>
                    <ListView.ItemTemplate>
                        <DataTemplate>
                            <ViewCell>
                                <ViewCell.View>
                                    <Grid RowSpacing="5">
                                        <Grid.RowDefinitions>
                                            <RowDefinition Height="23" />
                                            <RowDefinition Height="*" />
                                        </Grid.RowDefinitions>
                                        <Grid.ColumnDefinitions>
                                            <ColumnDefinition Width="*" />
                                            <ColumnDefinition Width="100" />
                                        </Grid.ColumnDefinitions>
                                        <Label Grid.Row="0" Grid.Column="0" Text="{Binding categoryName}" FontSize="14" Margin="0,5,0,0" TextColor="Red"/>
                                        <Label Grid.Row="1" Grid.Column="0" Text="{Binding shortTitle}" FontSize="20" Margin="0,0,0,0"/>
                                        <Image Grid.Row="0" Grid.Column="1" Grid.RowSpan="2" Source="{Binding imageThumb}" Margin="10,0,0,0" />
                                    </Grid>

                                </ViewCell.View>
                            </ViewCell>

                        </DataTemplate>
                    </ListView.ItemTemplate>
                </ListView>

            <Label x:Name="lHello" Text="Hello, world!">

            </Label>
        </StackLayout>
    </ScrollView>
</ContentPage>

Please see the

<Image x:Name="imgTopStory" />

If I change this to

<StackLayout>
                <Image x:Name="imgTopStory" />
</StackLayout>

I can no longer set the source of the image from code because imgTopStory is not visible within the cs. I have to remove the control from within the StackLayout.

I guess there is a logical principle behind this behaviour. What is it?

I want to add some other elements within this "stacklayout". The image will come from an API - so I cannot hard code it from Resources.

Many, many thanks for helping me along

Best wishes

Iyer

How to convert this code ASP.net (C#) to work in xamarin c#

$
0
0

using System
using System.IO
using System.Net
using System.Text
using System.Web
string sUserID = "UserName";
string sPwd = "Password";
string sNumber = "966560001716,966500722007";
string sSID = "Gateway.sa";
string sMessage = "Test SMS From Gateway.sa";
string sURL =" http:// 184.95.57.221:8080/vendorsms/pushsms.aspx?user="+ sUserID + "&
password=" + sPwd + "&msisdn=" + sNumber + "&sid=" + sSID + "&msg=" + sMessage

  • "&dc=8&fl=0";
    string sResponse = GetResponse(sURL);
    Response.Write(sResponse);
    public static string GetResponse(string sURL)
    {
    HttpWebRequest request = (HttpWebRequest)WebRequest.Create(sURL);
    request.MaximumAutomaticRedirections = 4;
    request.Credentials = CredentialCache.DefaultCredentials;
    try
    {
    HttpWebResponse response = (HttpWebResponse)request.GetResponse ();
    Stream receiveStream = response.GetResponseStream ();
    StreamReader readStream = new StreamReader (receiveStream, Encoding.UTF8);
    string sResponse = readStream.ReadToEnd();
    response.Close ();
    readStream.Close ();
    return sResponse;
    }
    Catch
    {
    return "";
    }
    }

Disable weekend dates

$
0
0

Hi Guys, need help in datepicker xamarin forms.
Is there any ways to disable weekend dates in xamarin.forms datepicker?

Change archive path

$
0
0

Hello,

For some projects I struggle to generate an archive either for iOS or Android...
At first, I had a problem generating the ipa because of the length of the path.
I've managed to overcome this by allowing long Win32 path call (win+R > gpedit.msc > file system > enable win32 long path)

Then I have to generate the archive. For Android, there is this tool option which let you change the archive path. But nothing for iOS. I found some thread on github saying it would have been available in VS19 update 2 or 3. But still nothing with the latest update.

I've tried the exotic changes in csproj (, ) but it doesn't resolve my problem either.
There is a lot of topic about it everywhere but without any answer (exemple : https://forums.xamarin.com/discussion/172377/move-archive-location-in-vs-2019-windows or https://stackoverflow.com/questions/58348830/xamarin-forms-ios-error-mt3001-could-not-aot-the-assembly or https://stackoverflow.com/questions/58243084/xamarin-form-ios-distribute-app-long-path-problem and I have found a dozen others similar post)

It's very anoying to have to build everything on the mac...
How long do we have to wait to have a checkbox and a textfield in the tool > option > xamarin > ios ?
Is it that hard to implement ?

I don't understand why it's not in the box yet after all those years. I bet it will be available once everyone will have switch to Flutter or Blutter (Blazor) and will give 0 f**** about Xamarin anymore. So sad... IMHO, this kind of problem give a lot of headache and isn't building trust in the platform. It's sad.

Do we, developpers, have to walk on the street like people do in Paris / Hongkong / [put any other country here] and protest to be heared ?

Sorry for being a bit rude and savage but I'm a bit tired to face problem I didn't introduced with my code. Also a bit angry to lose a day or two from time to time. In the beginning, making everything easy to build and deploy was one of Xamarin's advantage. It's still easy to install the EDI and start to code. But release is a nightmare even after several years of practice.

How do you people manage to create archieve with big namespace / name / path ?

Thanks a lot, sorry if you feel offended.

Porting Objective-c code to C#

$
0
0

Hello Everyone !

I'm trying to port this objective-c code to c# with no success...

Apple is not allowing a setfocus () operation on an html element in their WKWebview.

In need to get running this feature on Xamarin.iOS, the following code is a original answer from another forum. I've try the solution in Objective-c project and it works:

Objective-C Code
- (void) keyboardDisplayDoesNotRequireUserAction { 
     SEL sel = sel_getUid "_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:");

     Class WKContentView = NSClassFromString(@"WKContentView"); 
     Method method = class_getInstanceMethod(WKContentView, sel); 
     IMP originalImp = method_getImplementation(method); 

     IMP imp = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, id arg3) {      
     ((void (*)(id, SEL, void*, BOOL, BOOL, id))originalImp)(me, sel, arg0, TRUE, arg2, arg3);
}); 

     method_setImplementation(method, imp); 
} 

The following code is our ported code:

using System;
using System.Runtime.InteropServices;
using CoreGraphics;
using Foundation;
using ObjCRuntime;
using WebKit;

        namespace XXXX.iOS.ViewControllers
        {
            public class WKWebViewEx : WKWebView
            {
                [DllImport("/usr/lib/libobjc.dylib")] static extern IntPtr class_getInstanceMethod(IntPtr classHandle, IntPtr Selector);

                [DllImport("/usr/lib/libobjc.dylib")] static extern IntPtr method_getImplementation(IntPtr method);

                [DllImport("/usr/lib/libobjc.dylib")] static extern IntPtr imp_implementationWithBlock(ref BlockLiteral block);

                [DllImport("/usr/lib/libobjc.dylib")] static extern void method_setImplementation(IntPtr method, IntPtr imp);


                private static IntPtr _original;


                public WKWebViewEx(NSCoder coder) : base(coder)
                {
                    AllowDisplayingKeyboardWithoutUserAction();
                }

                protected WKWebViewEx(NSObjectFlag t) : base(t)
                {
                    AllowDisplayingKeyboardWithoutUserAction();
                }

                protected internal WKWebViewEx(IntPtr handle) : base(handle)
                {
                    AllowDisplayingKeyboardWithoutUserAction();
                }

                public WKWebViewEx(CGRect frame, WKWebViewConfiguration configuration) : base(frame, configuration)
                {
                    AllowDisplayingKeyboardWithoutUserAction();
                }

                static Selector selector1;

                private void AllowDisplayingKeyboardWithoutUserAction()
                {
                    IntPtr @class = Class.GetHandle("WKContentView");
                    NSOperatingSystemVersion iOS_11_3_0 = new NSOperatingSystemVersion(11, 3, 0);

                    NSProcessInfo processInfo = NSProcessInfo.ProcessInfo;
                    bool isIOS1130 = processInfo.IsOperatingSystemAtLeastVersion(iOS_11_3_0);
                    if (isIOS1130)
                    {
                        Selector selector = new Selector("_startAssistingNode:userIsInteracting:blurPreviousNode:changingActivityState:userObject:");
                        IntPtr method = class_getInstanceMethod(@class, selector.Handle);
                        _original = method_getImplementation(method);

                        BlockLiteral block = new BlockLiteral();
                        CaptureDelegate d = MyCapture;
                        block.SetupBlock(d, null);
                        IntPtr @override = imp_implementationWithBlock(ref block);
                        method_setImplementation(method, @override);

                        //IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, BOOL arg3, id arg4) 
                        //{
                        //    ((void(*)(id, SEL, void *, BOOL, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3, arg4);
                        //});
                    }
                    else
                    {
                        selector1 = new Selector("_startAssistingNode:userIsInteracting:blurPreviousNode:userObject:");
                        IntPtr method = class_getInstanceMethod(@class, selector1.Handle);
                        _original = method_getImplementation(method);

                        BlockLiteral block = new BlockLiteral();
                        CaptureDelegate d = MyCapture;
                        block.SetupBlock(d, null);
                        IntPtr @override = imp_implementationWithBlock(ref block);
                        method_setImplementation(method, @override);

                        //IMP override = imp_implementationWithBlock(^void(id me, void* arg0, BOOL arg1, BOOL arg2, id arg3) 
                        //{
                        //    ((void(*)(id, SEL, void *, BOOL, BOOL, id))original)(me, selector, arg0, TRUE, arg2, arg3);
                        //});
                    }
                }

                [MonoNativeFunctionWrapper]
                public delegate void OriginalDelegate(NSObject me, Selector sel, IntPtr arg0, bool arg1, bool arg2, NSObject arg3);

                delegate void CaptureDelegate(NSObject me, IntPtr arg0, bool arg1, bool arg2, NSObject arg3);

                [MonoPInvokeCallback(typeof(CaptureDelegate))]
                static void MyCapture(NSObject me, IntPtr arg0, bool arg1, bool arg2, NSObject arg3)
                {
                    OriginalDelegate del = (OriginalDelegate)Marshal.GetDelegateForFunctionPointer(_original, typeof(OriginalDelegate));
                    del(me, selector1, arg0, true, arg2, arg3);
                }
            }
        }

The code compiles correctly. The problem is very localized in:

(me, selector1, arg0, true, arg2, arg3), and specifically in the selector1 parameter. This call executes the delegate OriginalDelegate.

The error that occurs at runtime is:

Type ObjCRuntime.Selector which is passed to unmanaged code must have a StructLayout attribute.
and it tells me that the Selector object must have the StructAttribute attribute defined. ????

Could anyone give us a hand ?

Thankyou so much!

Create thumbnail from Video

$
0
0

I want to create 5 thumbnails from a video (at 5 different moment in the video) to let the user choose the thumbnail.
I did some search and I didn't find the good way to do that.
Can someone help me?
Thanks

UITest on App Center - accepting notification permissions dialog on iOS

$
0
0

Posting here as there seems to be no other support forum for App Center and UITest.

Our app uses Push Notifications, and so when it is first installed on an iOS device, the OS displays a permissions dialog.

When running tests remotely in Microsoft App Center, this dialog is preventing progress through to the main screen.

How can we automatically accept this dialog?

When examining using repl() and tree, the dialog isn't showing in the UI elements, so we can't access it from UITEST.

This post discusses it but doesn't have a solution.

Versions: Xamarin.UITest 2.2.5 Test device: iOS 11.1.2

Xamarin.UITest - Handle (tap/verify) notification

$
0
0

Hello experts,

I'm doing a PoC for automation project using Xamarin.UITest, and stuck at handling (verify_content or tap) on the notification.

I did searching for a while but don't see any guideline for this case. It's very important feature for our app and we want to automate these cases.

If you guys know that, please shed a light.

Thank you in advance.

Can't login to this forum using Google Chrome

$
0
0

I can't seem to be able to login/register/forgot password to these forums (forums.xamarin.com) using Google Chrome browser. I get the 'thinking' icon, but nothing more. Am I the only one with this issue? I had to use Safari to login to post this question.


Xamarin.Forms, Xamarin.iOS, Xamarin.Android - Authorize.Net

$
0
0

Trying to configure my app to work with the Authorize.Net API to add credit card payment option. Has anyone been able to do this?

Xamarin not working after XCode update to 11.2 version

$
0
0

Hey everybody,

My xcode updated in the last friday to version 11.2 and the simulator OS updated to 13.2 version.
Now when I try to debug my project, I'm facing this error: "Xamarin.iOS 13.4.0 does not support a deployment target of 13.2 for iOS (the maximum is 13.1). Please select an older deployment target in your project's Info.plist or upgrade to a newer version of Xamarin.IOS.".
I've tried to update Visual Studio for mac, but it's already up to date. I've tried to update to preview version, but no success (The Xamarin on Visual Studio from windows blocked debbug by insconsitency of versions between them both). I've tried to use MinimumOSVersion key in info.plist, but the breakpoints is not hitting anymore.
I think this is happening because the version o Xcode is greater then the working version of Xamarin, but it does not have a version to update.
Is anyone having this problem and how can I solve this?

Thanks and I'm sorry, English is not my first language.

Xamarin Certification

$
0
0

Is there any way now to obtain a Xamarin Certification as earlier provided by Xamarin University. On Microsoft Learn it only appears to give badges , there are no formal exam or certificate.

Moved: Android Xamarin.Forms freelance (or not) coder in Paris

web reference test vs prod addresses

$
0
0

Hello! I'm writting an application for android and iOS that has several web service references.

Currently we are testing changes to the webservices and need to easily switch the references in the app between the test service and the prod service.
Idealy I would like to be able to put the address in a config file somewhere so I can change it easily. I'm just not sure how to set this up.

Does anyone know how I might go about doing this? or any other suggestion to achieve something similar?

thanks.

Viewing all 5066 articles
Browse latest View live