maui-samples icon indicating copy to clipboard operation
maui-samples copied to clipboard

RestApi under Android dont work

Open Steven-L-42 opened this issue 2 years ago • 0 comments

It just stops at "ClientResponse"

i tested it with your Demo "TodoRest" and "TodoApi", so there are just no implementation for Android.

If i run my Maui project in Windows machine = works perfectly but if i run Maui project on a Android Device = Code quit at ClientResponse and forward other code.

This is one of the important settings, why someone discard it? Mobile App without SSL/TLS Settings? Who decide this?

Code that works on MAUI with Windows machine but not with Android:

RestClient restClient = new RestClient();
RestRequest restRequest = new RestRequest(GetUrl);
RestResponse restResponse = restClient.Get(restRequest);

using (DataTable dt = (DataTable)JsonConvert.DeserializeObject(restResponse.Content, (typeof(DataTable))))
{
   
    CultureInfo german = new CultureInfo("de-DE");
    firmen = (from DataRow row in dt.Rows
              select new FirmenKunden()
              {
                  Id_Terminliste = row["id_Terminliste"].ToString(),
                  Id_Firma = row["id_Firma"].ToString(),
                  Termin = Convert.ToDateTime(row["Termin"]).ToString("ddd'. 'dd'.'MM'.'yyyy' 'HH:mm", german),
                  TerminTagZahl = Convert.ToDateTime(row["Termin"]).ToString("dd"),
                  TerminUnFormatted = Convert.ToDateTime(row["Termin"]),
                  ServiceSafe = row["ServiceSafe"].ToString(),
                  Beschreibung = row["Beschreibung"].ToString(),
                  ServiceNr = row["ServiceNr"].ToString(),
                  MassnahmenNr = row["MassnahmenNr"].ToString(),
                  Servicestand = row["Servicestand"].ToString(),
                  Firma = row["Firma"].ToString(),
                  Strasse = row["Strasse"].ToString(),
                  Postleitzahl = row["Postleitzahl"].ToString(),
                  Ort = row["Stadt"].ToString(),
                  Vertragsbeginn = Convert.ToDateTime(row["Vertragsbeginn"]).ToString("ddd'. 'dd'.'MM'.'yyyy", german),
                  Vertragsende = Convert.ToDateTime(row["Vertragsende"]).ToString("ddd'. 'dd'.'MM'.'yyyy", german)

              }).ToList();



}

Steven-L-42 avatar Aug 08 '22 09:08 Steven-L-42