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

How to use AppCenter Analytics on .net Core WebApi backend to avoid saving secret on device?

$
0
0

Hi

I'm able to send events to appcenter.ms from my XamarinForms App . However, sending the events requires the app secret key to be added to the android/ios app itself. This key can be easily extracted using a decompiler.

On my webapi backend, like the Xamarin app, I tried adding the nuget package and then in Startup.cs
AppCenter.Start("SECTETKEYHERE", typeof(Analytics))

And then tracking the event this way

Analytics.TrackEvent("MyTestEvent",new Dictionary<string, string>{{"EventNameHere","EventValueHere"}});

However, no event data ever arrives in the appcenter dashboard.
So my question is , how do I use the trackevent functionality on the serverside, or , at the very least, store the key on the app side securely(I'd really rather not do this).

My fallback plan is to use google analytics as it works fine .
Thanks


Xamarin forms with CocosSharp - Cache async

$
0
0

Hi!,

I'm using cocosharp, but I can not load the cache asynchronously.

My Code:

public SimulatorPage()
        {
            // We'll be adding our CocosSharpView here:
            this.VerticalOptions = LayoutOptions.FillAndExpand;
            this.HorizontalOptions = LayoutOptions.FillAndExpand;

            var gameView = new CocosSharpView()
            {
                HorizontalOptions = LayoutOptions.FillAndExpand,
                VerticalOptions = LayoutOptions.FillAndExpand,
                // This gets called after CocosSharp starts up:
                ViewCreated = HandleViewCreated
            };

            this.Children.Add(gameView, 0, 0);

        }

        private void HandleViewCreated(object sender, EventArgs e)
        {
            var gameView = sender as CCGameView;

            if (gameView != null)
            {
                gameView.DesignResolution = new CCSizeI(App.SceneWidth, App.SceneHeight);
                gameView.ResolutionPolicy = CCViewResolutionPolicy.FixedWidth;
                gameView.ContentManager.SearchPaths = new List<string>() { "Fonts", "Sounds", "Images", "Images/Electrical", "Images/Pneumatic", "SpriteSheets" };

                //PreLoad Images in Cache
                PreLoadImages();

                // GameScene is the root of the CocosSharp rendering hierarchy:
                gameScene = new GameScene(this, gameView);

                // Starts CocosSharp:
                gameView.RunWithScene(gameScene);
            }
        }

        private void PreLoadImages()
        {
            var cache = CCTextureCache.SharedTextureCache;

            cache.AddImage("Image1");
            cache.AddImage("Image2");
            cache.AddImage("Image3");

       }

I want to use cache.AddImageAsync, Can you help me please?

Xamarin will be only for android and windows next year ?

$
0
0

I heared some thing about future of xamarin and worried is this true that next year xamarin support for IOS is gone. and Xamarin is only support Android and Windows.

@JamesMontemagno

sadfasdg发放的娃儿

$
0
0

的嘎嘎大的高速前往大改革瓦尔挖到过

撒飞洒发放到地方斯蒂芬是否收到f

$
0
0

方法第三方范德萨发的发的是电风扇发

which one is the best , crossplatform or xamarin android and xamarin ios alone?

$
0
0

now i am learning crossplatform. but i confused . i dont confident which one is best

Can I publish to app store an app that contains a web view that points to a website ?

$
0
0

I have a web application that requires scanning capabilities.
My client uses Scandit for barcode scanning in other native apps. The web application will need to be able to use the scandit xamarin sdk in order to scan barcodes. I manged to call c# code from javascript and viceversa in order to be able to use the scandit xamarin sdk. My concern is if apple will aprove this type of app(website inside webview and using a third party library to scan and bring the result back to website).
I do not know if this makes sense. Please let me know if you need more information

VS2017 and AIDL files

$
0
0

Hi

I'm completely new to Xamarin. I'm using VS2017 and I've included some AIDL files for a Sunmi V1 POS device. Eventually I need it to print to the device's thermal printer when a new order is received, but I'm struggling with the basics.

I've added the AIDL files and a Java class called TransBean (all provided by Sunmi), and I can see that when I build it, it's converted all this to C# classes. I have set the build action to AndroidInterfaceDescription for all AIDL files. Not sure what I should do for the Java file but I tried setting it to AndroidJavaSource but it didn't seem to help.

The Problem
But the generated TransBean.cs has no contents (not even the class definition). As a result, I'm getting build errors saying it can't find TransBean.

Just realised that I can't post screenshots, although I have a few that I can send (will try to describe instead)

The generated TransBean.cs file has no contents. I would have assumed it should contain a C# representation of the Java class.

The AIDL file for TransBean just looks like this

package com.sunmi.trans;

parcelable TransBean;

The TransBean.java file has lots of content e.g.

    package com.sunmi.trans;

    import android.os.Parcel;
    import android.os.Parcelable;

    public class TransBean implements Parcelable {

        private byte type = 0;
        private String text = "";
        private byte[] data = null;
        private int datalength = 0;

        public TransBean(){
            type = 0;
            data = null;
            text = "";
            datalength = 0;     
        };

This is the generated TransBean.cs file. As you can see, it's empty

    // This file is automatically generated and not supposed to be modified.
    using System;
    using Boolean = System.Boolean;
    using String = System.String;
    using List = Android.Runtime.JavaList;
    using Map = Android.Runtime.JavaDictionary;

    namespace Com.Sunmi.Trans
    {
    }

As a result, anything that needs to use it throws a build error (TransBean does not exist in the namespace), such as this line (also auto-generated from a different AIDL file I guess)

void CommitPrint (Com.Sunmi.Trans.TransBean [] transbean, ICallback callback);

In the above line,

Please could someone tell me what I'm doing wrong? I'm guessing when the C# file is being generated, the contents of the Java file is supposed to be converted into C# and inserted into the resulting .cs file but maybe it's not picking it up.

Thanks!


VS2017 and AIDL files

$
0
0

Hi

I'm completely new to Xamarin. I'm using VS2017 and I've included some AIDL files for a Sunmi V1 POS device. Eventually I need it to print to the device's thermal printer when a new order is received, but I'm struggling with the basics.

I've added the AIDL files and a Java class called TransBean (all provided by Sunmi), and I can see that when I build it, it's converted all this to C# classes. I have set the build action to AndroidInterfaceDescription for all AIDL files. Not sure what I should do for the Java file but I tried setting it to AndroidJavaSource but it didn't seem to help.

The Problem
But the generated TransBean.cs has no contents (not even the class definition). As a result, I'm getting build errors saying it can't find TransBean.

Just realised that I can't post screenshots, although I have a few that I can send (will try to describe instead)

The generated TransBean.cs file has no contents. I would have assumed it should contain a C# representation of the Java class.

The AIDL file for TransBean just looks like this

package com.sunmi.trans;

parcelable TransBean;

The TransBean.java file has lots of content e.g.

    package com.sunmi.trans;

    import android.os.Parcel;
    import android.os.Parcelable;

    public class TransBean implements Parcelable {

        private byte type = 0;
        private String text = "";
        private byte[] data = null;
        private int datalength = 0;

        public TransBean(){
            type = 0;
            data = null;
            text = "";
            datalength = 0;     
        };

This is the generated TransBean.cs file. As you can see, it's empty

    // This file is automatically generated and not supposed to be modified.
    using System;
    using Boolean = System.Boolean;
    using String = System.String;
    using List = Android.Runtime.JavaList;
    using Map = Android.Runtime.JavaDictionary;

    namespace Com.Sunmi.Trans
    {
    }

As a result, anything that needs to use it throws a build error (TransBean does not exist in the namespace), such as this line (also auto-generated from a different AIDL file I guess)

void CommitPrint (Com.Sunmi.Trans.TransBean [] transbean, ICallback callback);

In the above line,

Please could someone tell me what I'm doing wrong? I'm guessing when the C# file is being generated, the contents of the Java file is supposed to be converted into C# and inserted into the resulting .cs file but maybe it's not picking it up.

Thanks!

VS2017 and AIDL files

$
0
0

Hi

I'm completely new to Xamarin. I'm using VS2017 and I've included some AIDL files for a Sunmi V1 POS device. Eventually I need it to print to the device's thermal printer when a new order is received, but I'm struggling with the basics.

I've added the AIDL files and a Java class called TransBean (all provided by Sunmi), and I can see that when I build it, it's converted all this to C# classes. I have set the build action to AndroidInterfaceDescription for all AIDL files. Not sure what I should do for the Java file but I tried setting it to AndroidJavaSource but it didn't seem to help.

The Problem
But the generated TransBean.cs has no contents (not even the class definition). As a result, I'm getting build errors saying it can't find TransBean.

Just realised that I can't post screenshots, although I have a few that I can send (will try to describe instead)

The generated TransBean.cs file has no contents. I would have assumed it should contain a C# representation of the Java class.

The AIDL file for TransBean just looks like this

package com.sunmi.trans;

parcelable TransBean;

The TransBean.java file has lots of content e.g.

    package com.sunmi.trans;

    import android.os.Parcel;
    import android.os.Parcelable;

    public class TransBean implements Parcelable {

        private byte type = 0;
        private String text = "";
        private byte[] data = null;
        private int datalength = 0;

        public TransBean(){
            type = 0;
            data = null;
            text = "";
            datalength = 0;     
        };

This is the generated TransBean.cs file. As you can see, it's empty

    // This file is automatically generated and not supposed to be modified.
    using System;
    using Boolean = System.Boolean;
    using String = System.String;
    using List = Android.Runtime.JavaList;
    using Map = Android.Runtime.JavaDictionary;

    namespace Com.Sunmi.Trans
    {
    }

As a result, anything that needs to use it throws a build error (TransBean does not exist in the namespace), such as this line (also auto-generated from a different AIDL file I guess)

void CommitPrint (Com.Sunmi.Trans.TransBean [] transbean, ICallback callback);

In the above line,

Please could someone tell me what I'm doing wrong? I'm guessing when the C# file is being generated, the contents of the Java file is supposed to be converted into C# and inserted into the resulting .cs file but maybe it's not picking it up.

Thanks!

ItemsSource bindable property

$
0
0

Hello, i'm trying to make ContentView with 2 items and I need to send ItemsSource as bindable property. I tried like this, but it didn't work.

Xaml:

        <Grid>
            <Label
                Text="Text"
                TextColor="Black"
                VerticalOptions="CenterAndExpand" />

            <controls:ExtendedPicker
                Title="Title"
                HorizontalOptions="End"
                ItemDisplayBinding="{Binding PickerItemDisplayBinding, Source={x:Reference This}}"
                ItemsSource="{Binding PickerItemsSource, Source={x:Reference This}}"
                SelectedIndex="{Binding PickerSelectedIndex, Source={x:Reference This}}" />
        </Grid>

Xaml.cs:

    public static readonly BindableProperty PickerItemsSourceProperty = BindableProperty.Create(
        "PickerItemsSource",
        typeof(IList),
        typeof(DetailedPicker));

    public static readonly BindableProperty PickerSelectedIndexProperty = BindableProperty.Create(
        "PickerSelectedIndex",
        typeof(int),
        typeof(DetailedPicker));

    public static readonly BindableProperty PickerItemDisplayBindingProperty = BindableProperty.Create(
        "PickerItemDisplayBinding",
        typeof(BindingBase),
        typeof(DetailedPicker));

    public IList PickerItemsSource
    {
        get => (IList) GetValue(PickerItemsSourceProperty);
        set => SetValue(PickerItemsSourceProperty, value);
    }


    public int PickerSelectedIndex
    {
        get => (int) GetValue(PickerSelectedIndexProperty);
        set => SetValue(PickerSelectedIndexProperty, value);
    }

    public BindingBase PickerItemDisplayBinding
    {
        get => (BindingBase) GetValue(PickerItemDisplayBindingProperty);
        set => SetValue(PickerItemDisplayBindingProperty, value);
    }

How can I bind ItemsSource as BindableProperty?

Xamarin and .Net Standard

$
0
0

Hello everyone, I'm a .Net developer and I'm looking forward to starting in Xamarin. But I have some doubts, see below:

1 - We are trying to reuse the domain of our web application in a mobile application, would xamarin be the right one? (The mobile application needs to work offline)

2 - What is the best dependency injection framework to use in xamarin? (our application currently uses simpleInjector)

3 - What is the best ORM to use in xamarin. (We are currently using EF6.) We are thinking of using EF Core because it is not yet accepting the mapping of many to many)

4 - Do we want to use the application's views in the mobile project, does xamarin work with DataAnnotation for validations?

5 - Are automapper and log4net available for xamarin?

6 - We would like to use Shared Project to share the code between IOS, Android and UWP applications, would it be the right one?

In this type of project I can access the domain, infra and application dlls through a dependency injection framework?

Att,
Diogo Vieira

Does anybody have an app idea which requires advanced science skills?

$
0
0

I don't know biology, but physics, math, signal processing and automatic control I know. I also know some electronics, chemistry and software development.

Thankful for any ideas.

Mac Mini late 2012 for Xamarin development

$
0
0

Hello,

Need a bit of guidance here.
I've been thinking about buying a custom Mac Mini with ssd and i7 (the custom ones, from 2012)

Apparently they're going to work with Mojave.
http://osxdaily.com/2018/06/05/macos-mojave-compatible-macs-list/

From your experience, were there any issues with these kind of modded mac mini's ? Should I better head to a 2014+ model ?

Thanks,

Design and create the IoT cross platform for Wireless Signal Transmitters

$
0
0

Hello, I want to send real-time embedded data from Wireless signal transmitters from ncd.io to test the DC voltage of panels used in machines, I trying to create the cross-platform app which will able to convert the data from ESP32 (connected with ZigBee IoT receiver router via UART protocol). I want to provide BLE as well as WIFI services in the application with which I have never worked before any suggestion to make this work will be much helpful.


nuget failed to restore

$
0
0

i'm using vs2017
net standard 2.0


i have to clean Nuget Cash
after this step
i couldn't build solution
and couldn't re download this packages


what can i do ??????

Monitor boolean for changing value to certain value such as False only.

$
0
0

Hi,

I would like to be able to trigger an event when a boolean changes value to false. I know how to trigger the event when the boolean changes value but any guidance as to how to only trigger event when boolean is false?

ImageSource , how to invalidate / clear the cache ?

$
0
0

Hi,

In my app I upload a new "user profile" image on the server, then I try to update the image with the new version (Noticed that the image uri is the same).
But it seems that the Image cache cannot be invalidated !

I have try several solutions, but find no way ! Even when I restart the application I get the old version of the image.

Here is my code :

        (MediaImageSource as UriImageSource).CacheValidity = new TimeSpan(-1);
        FFImageLoading.Forms.CachedImage.InvalidateCache(MediaImageSource, FFImageLoading.Cache.CacheType.All, true);
        FFImageLoading.ImageService.Instance.InvalidateCacheAsync(FFImageLoading.Cache.CacheType.All);

Does someone has a solution for this ?

how to integrate xamarin in VS to Cruise Control.NET or if there is bette way to automate apk builds

$
0
0

How to produce / automate builds and how do you guys plan on providing this build to users. We already have implemented Cruise Control dot NET for our .net applications and I'm wondering if anyone here has already integrate xamarin.forms into this build server?

how to integrate xamarin in VS to Cruise Control.NET or if there is bette way to automate apk builds

$
0
0

How to produce / automate builds and how do you guys plan on providing this build to users. We already have implemented Cruise Control dot NET for our .net applications and I'm wondering if anyone here has already integrate xamarin.forms into this build server?

Viewing all 5066 articles
Browse latest View live