fix(driver-app): use Locale.US in NetworkHelper to prevent invalid JSON formatting

This commit is contained in:
Shanmuga Krishnan S M
2026-08-03 14:36:20 +05:30
parent 01a3df2386
commit add0fbb47c
2 changed files with 4 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ package com.rit.driver;
public class Config {
public static final String BACKEND_URL = "http://10.43.158.201:8085";
public static final String BACKEND_URL = "https://api.rit-services.in";
public static final String DEFAULT_PIN = "RITDRIVER";

View File

@@ -36,9 +36,10 @@ public class NetworkHelper {
conn.setConnectTimeout(8000);
conn.setReadTimeout(8000);
// Build JSON string payload
// Build JSON string payload using Locale.US to ensure dot decimals in JSON
String jsonInputString = String.format(
"{\"latitude\": %f, \"longitude\": %f, \"pin\": \"%s\"}",
java.util.Locale.US,
"{\"latitude\": %.6f, \"longitude\": %.6f, \"pin\": \"%s\"}",
lat, lng, pin
);