title: JSON Parsing taking too much time - Android
body: <p>I have a JSON file <code>airports.json</code> which contains 5720 objects, I want to parse the file in Java into Objects Airport.
  The code below is how I parse it, the problem is, it is taking too much time to completely parse all the file, about 1 min and 50 sec.</p>
  
  <pre><code>    ArrayList&lt;Airport&gt; arrayAirports = new ArrayList&lt;&gt;();
      String json_response = loadJSONFromAsset();
      try {
          JSONObject airports = new JSONObject(json_response.trim());
  
          Log.d("Length Array 0", String.valueOf(airports.names().length()));
          Log.d("Length Array 1", String.valueOf(arrayAirports.size()));
          for(int i = 0; i&lt;airports.names().length(); i++){
                  JSONObject jsonAirport = airports.getJSONObject(airports.names().getString(i));
                  Airport newAirport = new Airport();
                  newAirport.name = jsonAirport.getString("name");
                  newAirport.city = jsonAirport.getString("city");
                  newAirport.country = jsonAirport.getString("country");
                  newAirport.latitude = jsonAirport.getString("latitude");
                  newAirport.longitude = jsonAirport.getString("longitude");
                  newAirport.altitude = jsonAirport.getString("altitude");
                  newAirport.iata = jsonAirport.getString("iata");
                  newAirport.icao = jsonAirport.getString("icao");
                  newAirport.timeZone = jsonAirport.getString("timezone");
                  newAirport.dst = jsonAirport.getString("dst");
                  arrayAirports.add(newAirport);
          }
  
  
  
      } catch (JSONException e1) {
          e1.printStackTrace();
      }
  
      Log.d("Length Array 2", String.valueOf(arrayAirports.size()));
  </code></pre>
  
  <p>Is there a way to parse it quicklier.
  By the way my friend is parsing it with no time at all using Objective C.</p>
  
  <p><a href="https://github.com/ram-nadella/airport-codes/blob/master/airports.json" rel="nofollow">Link to JSON file</a></p>