0

Good Day to everyone,

is my first question and my english is not so good, so i ask sorry for. I try to explain the problem best as i can.

I made an app with Xamarin.forms for Android and iOs. During the execution the program send this class:

[Serializable]

public class datinvio
    {

        public string NomeDipendente { get; set; }
        public DateTime[] timbri { get; set; }
        public bool[] inout { get; set; }
        public double[] latitud { get; set; }
        public double[] longitud { get; set; }
        public string[] codicicom { get; set; }
        public string[] nomicomm { get; set; }
        public string[] tempicomm { get; set; }
        public string note { get; set; }
        public string mappa { get; set; }


    }

to a FTP server using this serialization

XmlSerializer formatter = new XmlSerializer(typeof(datinvio));
 Stream stream = new FileStream(path, FileMode.Create, FileAccess.Write, FileShare.None);
                formatter.Serialize(stream, tosend);
                stream.Close();

tosend is a datinvio class;

Now here's the problem:

With the emulator: (5.1 android api 22) I debug it, and works fine. I try in release mode, works fine. With a smartphone: (5.1 android api 22) Debug works fine. Release works fine.

So i think "well, is done". So i make the apk for install it on employees devices but when i install the apk, the app send an xml file only with the header to server. I have no clue about where i can search the problem.

Thanks in advance for any answer

I have and update, i'm noticing that it doesn't work in release too, only in debug mode.

  • "I have no clue about where i can search the problem." - I don't think that you have provided enough details that anyone can help you. As you would expect if everything is OK this wouldn't happen, and what isn't OK is hard to say by knowing that something isn't OK. But for start try to display on the screen what you send or some other data that can help you. – Ivan Ičin Oct 10 '19 at 08:22
  • See msdn : https://learn.microsoft.com/en-us/xamarin/android/deploy-test/release-prep/?tabs=windows – jdweng Oct 10 '19 at 09:07

2 Answers2

0

You can check this thread How to save/restore serializable object to/from file?

Plethora of options there. Thanks

Md. Asaduzzaman
  • 14,963
  • 2
  • 34
  • 46
0

maybe you can try use kotlin make you easy

data class datinvio(
    var NomeDipendente : String? = "",
    .....................................
    var mappa : String? =""
):Serializable