Code example for Properties

Methods: getProperty

0
    GpsXtraDownloader(Context context, Properties properties) {
        mContext = context;
 
        // read XTRA servers from the Properties object 
        int count = 0;
        String server1 = properties.getProperty("XTRA_SERVER_1");
        String server2 = properties.getProperty("XTRA_SERVER_2");
        String server3 = properties.getProperty("XTRA_SERVER_3");
        if (server1 != null) count++;
        if (server2 != null) count++;
        if (server3 != null) count++;
         
        if (count == 0) {
            Log.e(TAG, "No XTRA servers were specified in the GPS configuration");
            return; 
        } else { 
            mXtraServers = new String[count];
            count = 0;
            if (server1 != null) mXtraServers[count++] = server1;
            if (server2 != null) mXtraServers[count++] = server2;
            if (server3 != null) mXtraServers[count++] = server3;