Code example for Properties

Methods: get

0
    } 
 
    public void send(Location loc) {
        NetworkInfo networkInfo =
                mConnectivityManager.getNetworkInfo(ConnectivityManager.TYPE_WIFI);
        String env = (String) mApiProperties.get("environment");
 
        if (env == null) {
            env = "development";
        } 
 
        if (env.equalsIgnoreCase("production")) {
            if (networkInfo.getState() == State.CONNECTED) {
                Log.d(TAG, "send: Connected to Wifi. Sending to web service...");
                sendToWebService(loc);
            } else { 
                Log.d(TAG, "send: Not connected to Wifi. Saving the location to the database");
                sendToDatabase(loc);
            } 
        } else if (env.equalsIgnoreCase("development")) {
            Log.d(TAG, "send (Development): Sending to web service...");
            sendToWebService(loc);
        } 
    } 
 
    private String getLocationApiUrl() {
        if (mApiProperties == null) {
            return ""; 
        } 
 
        String domain = (String) mApiProperties.get("domain");
        String locations = (String) mApiProperties.get("locations");
        return domain + locations;
    } 
 
    public void onLocationChanged(Location location) {
        send(location);