use DeviceMappingConstants instead of introducing redundant constants

This commit is contained in:
Axel Uhl committed 2015-03-04 23:58:10 +01:00
1 parent 8a06b30cf0
commit beeb188e7a
4 files changed
+6 -9

No files matched your search

@@ -46,7 +46,7 @@ public abstract class BaseQRIdentifierWidget implements IsWidget {
});
inputGrid = new Grid(1, 2);
inputGrid.setWidget(0, 0, new Label("Server URL:"));
inputGrid.setWidget(0, 0, new Label("Server URL:")); // TODO i18n
inputGrid.setWidget(0, 1, serverBox);
qrCodeComposite = new QRCodeComposite(qrCodeSize, errorCorrectionLevel);
@@ -35,7 +35,7 @@ public class DeviceConfigurationQRIdentifierDialog extends DialogBox {
@Override
protected String generateEncodedQRCodeContent() {
if (identifierBox.getValue().contains("#")) {
Window.alert("I'm not capable of generating a code for this identifier.");
Window.alert("I'm not capable of generating a code for this identifier."); // TODO i18n
} else if (!identifierBox.getValue().isEmpty() && !serverBox.getValue().isEmpty()) {
String apkUrl = getServerUrlWithoutFinalSlash() + rcAppApkPath;
return DeviceConfigurationQRCodeUtils.composeQRContent(identifierBox.getValue(), apkUrl);
@@ -55,6 +55,7 @@ import com.sap.sailing.android.tracking.app.utils.NetworkHelper.NetworkHelperFai
import com.sap.sailing.android.tracking.app.utils.NetworkHelper.NetworkHelperSuccessListener;
import com.sap.sailing.android.tracking.app.utils.UniqueDeviceUuid;
import com.sap.sailing.android.tracking.app.valueobjects.CheckinData;
import com.sap.sailing.domain.common.racelog.tracking.DeviceMappingConstants;
import com.sap.sailing.domain.racelogtracking.DeviceIdentifier;
import com.sap.sailing.domain.racelogtracking.impl.SmartphoneUUIDIdentifierImpl;
@@ -175,7 +176,7 @@ public class HomeFragment extends BaseFragment implements LoaderCallbacks<Cursor
String leaderboardNameFromQR;
try {
leaderboardNameFromQR = URLEncoder.encode(uri.getQueryParameter(CheckinHelper.LEADERBOARD_NAME), "UTF-8")
leaderboardNameFromQR = URLEncoder.encode(uri.getQueryParameter(DeviceMappingConstants.URL_LEADERBOARD_NAME), "UTF-8")
.replace("+", "%20");
} catch (UnsupportedEncodingException e) {
ExLog.e(getActivity(), TAG, "Failed to encode leaderboard name: " + e.getMessage());
@@ -186,10 +187,10 @@ public class HomeFragment extends BaseFragment implements LoaderCallbacks<Cursor
return;
}
final String competitorId = uri.getQueryParameter(CheckinHelper.COMPETITOR_ID);
final String competitorId = uri.getQueryParameter(DeviceMappingConstants.URL_COMPETITOR_ID_AS_STRING);
final String checkinURLStr = hostWithPort
+ prefs.getServerCheckinPath().replace("{leaderboard-name}", leaderboardNameFromQR);
final String eventId = uri.getQueryParameter(CheckinHelper.EVENT_ID);
final String eventId = uri.getQueryParameter(DeviceMappingConstants.URL_EVENT_ID);
final String leaderboardName = leaderboardNameFromQR;
final DeviceIdentifier deviceUuid = new SmartphoneUUIDIdentifierImpl(UUID.fromString(UniqueDeviceUuid
@@ -4,10 +4,6 @@ import org.json.JSONException;
import org.json.JSONObject;
public class CheckinHelper {
public static final String LEADERBOARD_NAME = "leaderboard_name";
public static final String COMPETITOR_ID = "competitor_id";
public static final String EVENT_ID = "event_id";
public static JSONObject getCheckinJson(String competitorId, String deviceUuid, String pushDeviceId, long fromMillis)
throws JSONException {
JSONObject jsonObject = new JSONObject();