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

How to implement responsive xamarin.controls.signaturepad.forms ?

$
0
0

In landscape mode signature is getting crop.so is there any way to implement signature pad in such a way that size of a signature does not crop in portrait or landscape?


Signature in Signature Pad getting misplaced while changing screen orientation.

$
0
0

Signature in Signature Pad getting misplaced while changing screen orientation from portrait to Landscape and vice-versa. Any suggestion how to handle it???

In xamarin form Creating a curved header layout Making a button that overlaps the header

How to handle notification click on Xamarin form ios project

$
0
0

When my Xamarin ios app is in background and I am clicking on the Push notification it is always opening the page i.e in background. Please let me know how I can open another app page on clicking push notifications. when I am clicking on notification public override void DidReceiveRemoteNotification(UIApplication application, NSDictionary userInfo, Action completionHandler)
{
}
event is called but I am not able to redirect to another app page.

how can i SetPriority. in Xamarin Android in the OnStop method

$
0
0

hello guys i need my app to work even when the user close it from the task manager to receive notification i am not using firebase or anything
is it possible to set the priority in the onstop method so the application will not be destroyed
Thank you

Video Conferencing with Xamarin

$
0
0

Hi,
We are planning to make a app that has Video Conferencing facility.
We are planning to use Xamarin, so we can have cross platform app.

The Video Conferencing can be done from,
Android phones / tab, iOS Phones / Tabs and Web Based.

We are doing our RnD over Video Conferencing SDKs available to make this
We got Vidyo, ooVoo, tokbox etc

But all have SDK in Native Android and Native iOS

Can anyone guide us,
Is there any SDK for Xamarin?

Or how to Modify the Native App (SDK Available) to work with xamarin, point is that, we dont want to call another app. it will affect the User Experience of the app, so we may need to develop our business logic over the existing SDK.

Best Regards
Santosh Pathak

How to Create a curved header layout and making a button that overlaps the header???

$
0
0

Here im using stacklayout as header,How to create a curved header layout?????


<Grid.RowDefinitions>


</Grid.RowDefinitions>

  <!-- header background -->
        <StackLayout Grid.Row="0" BackgroundColor="White">
            <Grid ColumnSpacing="0" RowSpacing="0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto"/>
                    <RowDefinition Height="Auto"/>
                </Grid.RowDefinitions>
                <StackLayout Grid.Row="0" HorizontalOptions="Center" VerticalOptions="Start"  Padding="0,50,0,00">
                    <Label Text="Name" HorizontalOptions="Start"/>
                    <Entry Placeholder="Enter Your Name" HorizontalOptions="Center" HorizontalTextAlignment="Center" />
                </StackLayout>
                <StackLayout Grid.Row="1" HorizontalOptions="Center" VerticalOptions="Start" Padding="0,50,0,00">
                    <Label Text="Place" HorizontalOptions="Start"/>
                    <Entry Placeholder="place" HorizontalOptions="Center" HorizontalTextAlignment="Center"  />
                </StackLayout>
            </Grid>
        </StackLayout>

  <Image Source="ProfilePic.jpg" Margin="0,0,0,-50" HeightRequest="50" WidthRequest="50" HorizontalOptions="Center" VerticalOptions="EndAndExpand"/>

Sample output will be like this...

Error appear when import InTheHand

$
0
0

When I using the DLL, it gives me this error, did I need to install something? or Xamarin don't support the DLL?
I want to make a project that can receive Bluetooth data, so I need to use that DLL

Can not resolve reference: System.Configuration, referenced by App2 > InTheHand.Net.Personal. Please add a NuGet package or assembly reference for System.Configuration, or remove the reference to App2. App2.Android


Picker pops up twice

$
0
0

I have a simple picker inside a list view and on my devices when I use my finger to scroll or tap it pops up twice

I have verified this on multiple devices and I know it is not my code - it's just a picker

best

JK

Hi, I am facing Deployment to emulator error in Xamarin Forms

$
0
0

I am trying to build a Xamarin forms Application, It's a blank code, the code builds perfectly without error but it does not get deployed on an emulator.

If I click "Start without Debugging" then the application gets installed on my emulator or else it stays black and after building complete I get just a "Ready" output. It happened all of sudden. Visual Studio version: VS2017 15.9.6

Can anyone help me with this? It started out of nowhere.

I tried to search for mono in "Extensions and Update" to enable it but couldn't find anything installed. If I try to install mono it gives an error "Either it is not compatible or already installed"

Also in my registry, I can't find the SDK path.

I need visual studio to build and display output in emulator.!

App icon pinned to Android device desktop is removed with each deployment?

$
0
0

When I deploy my Xamarin Forms app to emulator for debugging, the app icon pinned to the device desktop is removed. This happens only in Android. How do I avoid it?

Multiple warnings and an error but the app runs correctly

$
0
0

I am modifying an basic Calc app I found on the web.

I added a CLEAR button with this axml:

Here's the axmal:

<LinearLayout
    android:id="@+id/wrapper4"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_below="@+id/wrapper3"
    android:weightSum="1.0">
 <Button
        android:text="Clear"
        android:layout_width="0dp"
        android:layout_height="wrap_content"
        android:layout_below="@+id/btn0"
        android:layout_weight=".25"

    android:theme="@style/CustomButton"
        style="@style/Widget.AppCompat.Button.Colored"
        android:id="@+id/btnClear" />
</LinearLayout>

And here's the C# code in MainActivity.cs:

Button clr = (Button)FindViewById(Resource.Id.btnClear);

The app compiles but....

Here's some of the many warnings and the error:

Severity Code Description Project File Line Suppression State
Warning Directory obj\Release\MonoAndroid81\android/assets contains Xamarin.Android.Arch.Lifecycle.Common.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid81\android/assets contains Xamarin.Android.Arch.Core.Common.dll but no debug symbols file was found. 0
Warning Directory obj\Release\MonoAndroid81\android/assets contains Java.Interop.dll but no debug symbols file was found. 0
Error ADB0010: Failure [INSTALL_FAILED_NO_MATCHING_ABIS: Failed to extract native libraries, res=-113]
at Mono.AndroidTools.Internal.AdbOutputParsing.CheckInstallSuccess(String output, String packageName) in E:\A_work\122\s\External\androidtools\Mono.AndroidTools\Internal\AdbOutputParsing.cs:line 338
at Mono.AndroidTools.AndroidDevice.<>c__DisplayClass94_0.b__0(Task1 t) in E:\A\_work\122\s\External\androidtools\Mono.AndroidTools\AndroidDevice.cs:line 746 at System.Threading.Tasks.ContinuationTaskFromResultTask1.InnerInvoke()
at System.Threading.Tasks.Task.Execute() 0
Error CS0117 'Resource.Id' does not contain a definition for 'btnClear' Calc5 P:\C#\Android\Calc5\Calc5\MainActivity.cs 40 Active

I've deleted the Release dir; rebooted both the phone and the computer.

After I run Build and then Deploy (ignoring the errors) I get a signed.apk file in the release dir. I can copy it to the phone and install it there and it runs correctly.

I would like any input as to why I'm getting these errors and warnings.

RON

System.Xml.Dll assembly only loading on breakpoint

$
0
0

Hello,

I have been migrating all my project from an old version of xamarin with an old version of mono to the latest of both.
Amongst all the other issues I have encountered and found a solution, here is one I am still stuck with.

When I start my application on Debug, some part of a code sends an exception:
var source = new TraceSource(traceName);
source.Listeners.Clear();

The source.Listeners.Clear(); says the following:
System.MissingMethodException: Default constructor not found for type System.Diagnostics.FilterElements

Here comes the funny part: if I put a breakpoint on this line, and hoover the "Listeners" word, I got the error above on a little warning windows. But meanwhile in the logs of the application, the DLL loads himself (at the same moment I hoover the word):
Loaded assembly: /Users/...../System.Xml.dll [External]

And then the application runs smoothly, without errors, and the listeners work.

If I don't put the breakpoint, the application will not run properly.

Any idea on this one?

N.B.: I have migrated the application so it compiles in 64bits, retargeted a bunch of packages, etc. So Maybe I have broken something, but I have no idea what.

Xamarin, Android, Entity Framework Core 2 and Migrations

$
0
0

Hi,

I've been trying to get EF Core and Migrations to work with Xamarin Android. I found this blog post by Jon Douglas.

Fortunately EF Core and Visual Studio 2017 both have been upgraded in the mean time. But this makes it unfortunate that I can't replicate what has been written in the blog. (Different project templates, NuGet packages not compatible etc.)

Is there anyone here who got EF Core 2.0 to work with Xamarin Android and Visual Studio 2017 version 15.3? If so, can you please tell us step by step how this can be done?

Thanks a lot!

Rob

How to navigate from a UICollectionView to another view by clicking the cell

$
0
0

Hey, guys, i'm working on a project on Xamarin.iOS, the problem is i can't navigate from a UICollectionView to another ViewController by clicking some specific cell, i try to after the cell is clicked open a AlertView with a button and when the user clicks that button open another view, but that doesn't work, here is my code:

public override void ItemSelected(UICollectionView collectionView, NSIndexPath indexPath)
        {
            var cell = (EnvioCell)collectionView.CellForItem(indexPath);

            UIAlertView alert = new UIAlertView()
            {
                Title = "Options",
                Message = "Guide: " + localitems[indexPath.Row].guide + "\nStatus: " + localitems[indexPath.Row].status,
            };
            alert.AddButton("See");
            alert.Show();
            alert.Clicked += ButtonClicked;
        }    

            public void ButtonClicked(object sender, UIButtonEventArgs e)
            {
                try
                { 
            information.PerformSegue("segCollectionInformation", this); 
        }
                catch (Exception e) {throw e;}
            }

I hope you can help me with this issue, i really need that funtionality!!


SharedPreferences not working after a SplashScreen was added

$
0
0

HI, i have a problem i just create a simple app with one activity and on this activity i add two buttons and one edittext, on button saves data to the SharedPreferences and other read it, and display the data to the EditText, everything works fine until i add a splashscreen this is the splashscreen activity code

[Activity(MainLauncher = true, Theme = "@style/Theme.Splash", NoHistory = true)]
public class SplashScreen : Activity
{
protected override void OnCreate(Bundle bundle)
{
base.OnCreate(bundle);

        // Create your application here
        StartActivity(typeof(Activity1));

    }
}

and this the Activity1 code:

[Activity(Label = "Shared Preferences", Icon = "@drawable/icon")]
public class Activity1 : Activity
{
EditText dataEditText;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        // Set our view from the "main" layout resource
        SetContentView(Resource.Layout.Main);

        Button saveButton = FindViewById<Button>(Resource.Id.SaveSP);
        Button readButton = FindViewById<Button>(Resource.Id.ReadSP);

        dataEditText = FindViewById<EditText>(Resource.Id.DataEditText);

        saveButton.Click += delegate
        {
            saveData();
        };

        readButton.Click += delegate
        {
            readData();
        };
    }

it works only if the app is running but as soon i stop it, and run it again, the values never get readed from the SharedPreferences.

any idea?

XAML: how do I call a UI element's function from another UI element?

$
0
0

I'm using xamarin forms signaturepad (a drawing pad). https://github.com/xamarin/SignaturePad/tree/master/samples
I'm editing it myself for custom functionality.

I'm trying to implement an "undo" button that removes that last stroke. I have added an Undo() function into SignaturePadCanvasView. But I don't know how to call that function.

i.e. If my xaml page looks like this

 <signaturePad:SignaturePadCanvasView
            StrokeColor="{Binding StrokeColor, Mode=TwoWay}"
            UndoCommand="{Binding ?????}"
            />

<Button Text="Undo" Command="{Binding UndoButtonCommand}"/>

<Button Text="Color" Command="{Binding ChangeColorCommand}"/>

The "Color" button is working. (ChangeColorCommand changes the "StrokeColor" property in the ViewModel).

How do I get the "Undo" button to work?

I developed an Application based on Android 8.1 and I need to downgrade it to Android 5.0

$
0
0

Once I did though the application gives me a lot of errors, even after downloading android SDK for 5.0, is it Nuget problem? if though how I downgrade the NuGet packages, what is the root cause?

**Some of the Errors:
Error max res 21, skipping mipmap-anydpi-v26 "max res 21, skipping mipmap-anydpi-v26".
Error No resource found that matches the given name: attr 'windowNoTitle'.
Error NU1202 Package Xamarin.Android.Support.v7.AppCompat 27.0.2.1 is not compatible with monoandroid50 (MonoAndroid,Version=v5.0). Package Xamarin.Android.Support.v7.AppCompat 27.0.2.1 supports: monoandroid81 (MonoAndroid,Version=v8.1)

How access to instance of Dynamics 365 ??

$
0
0

Hello!!

I am developing an APP with Xamarin.Forms, and I need to access the data hosted on my Dynamics 365 platform..
In the developer resources section, Microsoft offers me a URL for access: https: //XXXXXX.api.crm4.dynamics.com/api/data/v9.1/ and a Client ID.

With this data, is it enough to access to the platform? According to the Microsoft documentation, I need to register the APP in Active Directory but following the steps indicated in it I have not managed to connect.

But the Client ID offered to me when registering the APP in Azure is totally different from the one offered in the platform. I have also obtained the access credentials but there is no way.

I have the following code.

Values ​​of the constants:

Constantes.API_URL = https: //XXXXXX.api.crm4.dynamics.com/api/data/
Constantes.CLIENT_ID = By registering the application at Active Directory (Not the one that they give me in the platform)
Constantes.CLIENT_KEY = By registering the application at Active Directory.

    AuthenticationParameters ap = AuthenticationParameters.CreateFromResourceUrlAsync(
                    new Uri(Constantes.API_URL)).Result;

        String authorityUrl = ap.Authority;
        String resourceUrl = ap.Resource;

        //return resourceUrl;
        ClientCredential creditential = new ClientCredential(Constantes.CLIENT_ID, Constantes.CLIENT_KEY);
        AuthenticationContext authContext = new AuthenticationContext(authorityUrl, false);

        AuthenticationResult result = null;

        result = await authContext.AcquireTokenAsync(resourceUrl, creditential);

        return result.AccessToken;

Shell, load all tabbed pages at once. Forms 4

$
0
0

I'm using the prerelease of Xamarin Forms 4, and am trying out App Shell.

I have my pages setup like this for bottom tab navigation:

    <ShellItem>
        <ShellSection Title="Stats" Icon="tab_feed.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.StatsPage}" />
        </ShellSection>
        <ShellSection Title="Upcoming" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.UpcomingPage}" />
        </ShellSection>
        <ShellSection Title="By Month" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.ByMonthPage}" />
        </ShellSection>
        <ShellSection Title="By Community" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.StatsPage}" />
        </ShellSection>
        <ShellSection Title="Recent" Icon="tab_about.png">
            <ShellContent ContentTemplate="{DataTemplate local:Spotlight.StatsPage}" />
        </ShellSection>
    </ShellItem>

My issue is, each page is loaded after you click on the tab, and then also reloads when going back to the tab. I'm hoping to somehow load all of these pages at once and just switch between them, the same way TabbedPage works. Is there any way to do this with AppShell?

Thanks

Viewing all 204402 articles
Browse latest View live


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