I have small app that I built with Codename One, it runs ok in the simulator and on Android devices. But it freezes on my iPhone. I used the iOS-debug in Netbeans to create the iOS build. I did some testing using the Dialog.show to find were it is freezing on my iPhone 12. The app sends a request to a web service and I receive the return data ok, but it freezes when parsing the JSON data to a map. I works in the simulator and on Android devices. I put a Dialog wright before the parsing and another after the parse to map is done. I never see the that Dialog because it freezing at that point. Below is the code.
// --- call webservice Points Lookup WEBR419r2 ---
Response<String> response = Rest.post(PointsLookup_URL).jsonContent()
.body(jsonInput).getAsString();
System.out.println(response.getResponseCode());
//Dialog.show("Rest reply 1", "getResponseCode", "OK", null);
String returnData = response.getResponseData();
System.out.println(returnData);
Dialog.show("Rest reply 1", returnData.substring(0, 80), "OK", null);
JSONParser json = new JSONParser();
try(Reader r = new InputStreamReader(
new ByteArrayInputStream(returnData.getBytes()))) {
map = json.parseJSON(r);
Dialog.show("JSON map 2", map.toString(), "OK", null);
System.out.println("*** WEB SERVICE call ok ***");
Dialog.show("Reader 2", "*** WEB SERVICE call ok ***", "OK", null);
} catch (IOException ex) {
System.out.println("Error " + ex);
Dialog.show("Rest reply 2E", ex.toString(), "OK", null);
}
I ran the app in the simulator and tested it on a android and iPhone.