2017-06-25 3 views
0

Ich bekomme immer einen leeren Bildschirm nach dem Ausführen des Codes unter. Ich habe einen benutzerdefinierten Array-Adapter und eine benutzerdefinierte Klasse erstellt, aber es gab keinen leeren Bildschirm wenn Ich habe eine Array-Liste verwendet, um Elemente in einer Listenansicht anzuzeigen. aber jetzt möchte ich Parsing testen von JSON-Daten unter Verwendung von jetzt ist es ein leerer Bildschirm geben, warum bitte helfen hierLeere Bildschirmausgabe beim Analysieren von Daten aus Json-Code aus einer Website extrahiert Api

import android.util.Log; 

import org.json.JSONArray; 
import org.json.JSONException; 
import org.json.JSONObject; 

import java.util.ArrayList; 

/** 
* Helper methods related to requesting and receiving earthquake data from USGS. 
*/ 
public final class QueryUtils { 

    /** Sample JSON response for a USGS query */ 
    private static final String SAMPLE_JSON_RESPONSE = "{\"type\":\"FeatureCollection\",\"metadata\":{\"generated\":1462295443000,\"url\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2016-01-01&endtime=2016-01-31&minmag=6&limit=10\",\"title\":\"USGS Earthquakes\",\"status\":200,\"api\":\"1.5.2\",\"limit\":10,\"offset\":1,\"count\":10},\"features\":[{\"type\":\"Feature\",\"properties\":{\"mag\":7.2,\"place\":\"88km N of Yelizovo, Russia\",\"time\":1454124312220,\"updated\":1460674294040,\"tz\":720,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us20004vvx\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us20004vvx&format=geojson\",\"felt\":2,\"cdi\":3.4,\"mmi\":5.82,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":798,\"net\":\"us\",\"code\":\"20004vvx\",\"ids\":\",at00o1qxho,pt16030050,us20004vvx,gcmt20160130032510,\",\"sources\":\",at,pt,us,gcmt,\",\"types\":\",cap,dyfi,finite-fault,general-link,general-text,geoserve,impact-link,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":0.958,\"rms\":1.19,\"gap\":17,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 7.2 - 88km N of Yelizovo, Russia\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[158.5463,53.9776,177]},\"id\":\"us20004vvx\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.1,\"place\":\"94km SSE of Taron, Papua New Guinea\",\"time\":1453777820750,\"updated\":1460156775040,\"tz\":600,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us20004uks\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us20004uks&format=geojson\",\"felt\":null,\"cdi\":null,\"mmi\":4.1,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":572,\"net\":\"us\",\"code\":\"20004uks\",\"ids\":\",us20004uks,gcmt20160126031023,\",\"sources\":\",us,gcmt,\",\"types\":\",cap,geoserve,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":1.537,\"rms\":0.74,\"gap\":25,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.1 - 94km SSE of Taron, Papua New Guinea\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[153.2454,-5.2952,26]},\"id\":\"us20004uks\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.3,\"place\":\"50km NNE of Al Hoceima, Morocco\",\"time\":1453695722730,\"updated\":1460156773040,\"tz\":0,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004gy9\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004gy9&format=geojson\",\"felt\":117,\"cdi\":7.2,\"mmi\":5.28,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":0,\"sig\":695,\"net\":\"us\",\"code\":\"10004gy9\",\"ids\":\",us10004gy9,gcmt20160125042203,\",\"sources\":\",us,gcmt,\",\"types\":\",cap,dyfi,geoserve,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":2.201,\"rms\":0.92,\"gap\":20,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.3 - 50km NNE of Al Hoceima, Morocco\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-3.6818,35.6493,12]},\"id\":\"us10004gy9\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":7.1,\"place\":\"86km E of Old Iliamna, Alaska\",\"time\":1453631430230,\"updated\":1460156770040,\"tz\":-540,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004gqp\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004gqp&format=geojson\",\"felt\":1816,\"cdi\":7.2,\"mmi\":6.6,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":1496,\"net\":\"us\",\"code\":\"10004gqp\",\"ids\":\",at00o1gd6r,us10004gqp,ak12496371,gcmt20160124103030,\",\"sources\":\",at,us,ak,gcmt,\",\"types\":\",cap,dyfi,finite-fault,general-link,general-text,geoserve,impact-link,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,trump-origin,\",\"nst\":null,\"dmin\":0.72,\"rms\":2.11,\"gap\":19,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 7.1 - 86km E of Old Iliamna, Alaska\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-153.4051,59.6363,129]},\"id\":\"us10004gqp\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.6,\"place\":\"215km SW of Tomatlan, Mexico\",\"time\":1453399617650,\"updated\":1459963829040,\"tz\":-420,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004g4l\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004g4l&format=geojson\",\"felt\":11,\"cdi\":2.7,\"mmi\":3.92,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":673,\"net\":\"us\",\"code\":\"10004g4l\",\"ids\":\",at00o1bebo,pt16021050,us10004g4l,gcmt20160121180659,\",\"sources\":\",at,pt,us,gcmt,\",\"types\":\",cap,dyfi,geoserve,impact-link,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":2.413,\"rms\":0.98,\"gap\":74,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.6 - 215km SW of Tomatlan, Mexico\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-106.9337,18.8239,10]},\"id\":\"us10004g4l\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.7,\"place\":\"52km SE of Shizunai, Japan\",\"time\":1452741933640,\"updated\":1459304879040,\"tz\":540,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004ebx\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004ebx&format=geojson\",\"felt\":51,\"cdi\":5.8,\"mmi\":6.45,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":720,\"net\":\"us\",\"code\":\"10004ebx\",\"ids\":\",us10004ebx,pt16014050,at00o0xauk,gcmt20160114032534,\",\"sources\":\",us,pt,at,gcmt,\",\"types\":\",associate,cap,dyfi,geoserve,impact-link,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,\",\"nst\":null,\"dmin\":0.281,\"rms\":0.98,\"gap\":22,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.7 - 52km SE of Shizunai, Japan\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[142.781,41.9723,46]},\"id\":\"us10004ebx\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.1,\"place\":\"12km WNW of Charagua, Bolivia\",\"time\":1452741928270,\"updated\":1459304879040,\"tz\":-240,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004ebw\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004ebw&format=geojson\",\"felt\":3,\"cdi\":2.2,\"mmi\":2.21,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":0,\"sig\":573,\"net\":\"us\",\"code\":\"10004ebw\",\"ids\":\",us10004ebw,gcmt20160114032528,\",\"sources\":\",us,gcmt,\",\"types\":\",cap,dyfi,geoserve,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":5.492,\"rms\":1.04,\"gap\":16,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.1 - 12km WNW of Charagua, Bolivia\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-63.3288,-19.7597,582.56]},\"id\":\"us10004ebw\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.2,\"place\":\"74km NW of Rumoi, Japan\",\"time\":1452532083920,\"updated\":1459304875040,\"tz\":540,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004djn\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004djn&format=geojson\",\"felt\":8,\"cdi\":3.4,\"mmi\":3.74,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":0,\"sig\":594,\"net\":\"us\",\"code\":\"10004djn\",\"ids\":\",us10004djn,gcmt20160111170803,\",\"sources\":\",us,gcmt,\",\"types\":\",cap,dyfi,geoserve,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":1.139,\"rms\":0.96,\"gap\":33,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.2 - 74km NW of Rumoi, Japan\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[141.0867,44.4761,238.81]},\"id\":\"us10004djn\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6.5,\"place\":\"227km SE of Sarangani, Philippines\",\"time\":1452530285900,\"updated\":1459304874040,\"tz\":480,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004dj5\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004dj5&format=geojson\",\"felt\":1,\"cdi\":2.7,\"mmi\":7.5,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":1,\"sig\":650,\"net\":\"us\",\"code\":\"10004dj5\",\"ids\":\",at00o0srjp,pt16011050,us10004dj5,gcmt20160111163807,\",\"sources\":\",at,pt,us,gcmt,\",\"types\":\",cap,dyfi,geoserve,impact-link,impact-text,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,tectonic-summary,\",\"nst\":null,\"dmin\":3.144,\"rms\":0.72,\"gap\":22,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.5 - 227km SE of Sarangani, Philippines\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[126.8621,3.8965,13]},\"id\":\"us10004dj5\"},\n" + 
      "{\"type\":\"Feature\",\"properties\":{\"mag\":6,\"place\":\"Pacific-Antarctic Ridge\",\"time\":1451986454620,\"updated\":1459202978040,\"tz\":-540,\"url\":\"http://earthquake.usgs.gov/earthquakes/eventpage/us10004bgk\",\"detail\":\"http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us10004bgk&format=geojson\",\"felt\":0,\"cdi\":1,\"mmi\":0,\"alert\":\"green\",\"status\":\"reviewed\",\"tsunami\":0,\"sig\":554,\"net\":\"us\",\"code\":\"10004bgk\",\"ids\":\",us10004bgk,gcmt20160105093415,\",\"sources\":\",us,gcmt,\",\"types\":\",cap,dyfi,geoserve,losspager,moment-tensor,nearby-cities,origin,phase-data,shakemap,\",\"nst\":null,\"dmin\":30.75,\"rms\":0.67,\"gap\":71,\"magType\":\"mww\",\"type\":\"earthquake\",\"title\":\"M 6.0 - Pacific-Antarctic Ridge\"},\"geometry\":{\"type\":\"Point\",\"coordinates\":[-136.2603,-54.2906,10]},\"id\":\"us10004bgk\"}],\"bbox\":[-153.4051,-54.2906,10,158.5463,59.6363,582.56]}"; 


    /** 
    * Create a private constructor because no one should ever create a {@link QueryUtils} object. 
    * This class is only meant to hold static variables and methods, which can be accessed 
    * directly from the class name QueryUtils (and an object instance of QueryUtils is not needed). 
    */ 
    private QueryUtils() { 
    } 

    /** 
    * Return a list of {@link Earthquake} objects that has been built up from 
    * parsing a JSON response. 
    */ 
    public static ArrayList<Earthquake> extractEarthquakes() { 

     // Create an empty ArrayList that we can start adding earthquakes to 
     ArrayList<Earthquake> earthquakes = new ArrayList<>(); 

     // Try to parse the SAMPLE_JSON_RESPONSE. If there's a problem with the way the JSON 
     // is formatted, a JSONException exception object will be thrown. 
     // Catch the exception so the app doesn't crash, and print the error message to the logs. 
     try { 

      // Parse the response given by the SAMPLE_JSON_RESPONSE string and 
      // build up a list of Earthquake objects with the corresponding data. 

       JSONObject BaseJsonResponse = new JSONObject(SAMPLE_JSON_RESPONSE); 
       // Getting JSON Array Node 
       JSONArray earthquakeArray = BaseJsonResponse.getJSONArray("Features"); 
       // looping through All Contacts 
       for (int i = 0; i < earthquakeArray.length(); i++) { 
        JSONObject currentEarthquake = earthquakeArray.getJSONObject(i); 
        JSONObject properties= currentEarthquake.getJSONObject("properties"); 
        String magnitude=properties.getString("mag"); 
        String location=properties.getString("place"); 
        String time=properties.getString("time"); 
        Earthquake earthquake= new Earthquake(magnitude,location,time); 
        earthquakes.add(earthquake); 



       } 


      } catch (JSONException e) { 
       // If an error is thrown when executing any of the above statements in the "try" block, 
       // catch the exception here, so the app doesn't crash. Print a log message 
       // with the message from the exception. 
       Log.e("QueryUtils", "Problem parsing the earthquake JSON results", e); 
      } 

      // Return the list of earthquakes 
      return earthquakes; 
     } 

    } 

mein Hauptaktivitätscode ist

import android.os.Bundle; 
import android.support.v7.app.AppCompatActivity; 
import android.widget.ListView; 

import java.util.ArrayList; 

public class EarthquakeActivity extends AppCompatActivity { 

    public static final String LOG_TAG = EarthquakeActivity.class.getName(); 

    @Override 
    protected void onCreate(Bundle savedInstanceState) { 
     super.onCreate(savedInstanceState); 
     setContentView(R.layout.earthquake_activity); 

     // Create a fake list of earthquake locations. 
     ArrayList<Earthquake> earthquakes = QueryUtils.extractEarthquakes(); 

     // Find a reference to the {@link ListView} in the layout 
     ListView earthquakeListView = (ListView) findViewById(R.id.list); 

     // Create an {@link EarthquakeAdapter}, whose data source is a list of 
     // {@link Earthquake}s. The adapter knows how to create list item views for each item 
     // in the list. 
     EarthquakeAdapter quakeAdapter = new EarthquakeAdapter(this,earthquakes); 

     // Set the adapter on the {@link ListView} 
     // so the list can be populated in the user interface 
     earthquakeListView.setAdapter(quakeAdapter); 
    } 
} 

Hier ist der Code, der benutzerdefinierten Klasse I gemacht .

public class Earthquake { 


    //Magnitude of earthquake (e.g. 7.5,5.5,6.4 etc) 
     private String mMagnitude; 

     //Place of Earthquake (Kolkata, Delhi etc) 
     private String mPlace; 

     // Date Of the occurrence 
     private String mDate; 

     /* 
     * Create a new Earthquake object. 
     * 
     * @param vName is the name of the Android version (e.g. Gingerbread) 
     * @param vNumber is the corresponding Android version number (e.g. 2.3-2.7) 
     * @param image is drawable reference ID that corresponds to the Android version 
     * */ 
     public Earthquake(String eMagnitude, String ePlace, String eDate) 
     { 
      mMagnitude = eMagnitude; 
      mPlace = ePlace; 
      mDate = eDate; 
     } 

     /** 
     * Get value of magnitude 
     */ 
     public String getMagnitude() { 
      return mMagnitude; 
     } 

     /** 
     * Get the place of occurrence 
     */ 
     public String getPlace() { 
      return mPlace; 
     } 

     /** 
     * Get the Date of occurrence 
     */ 
     public String getDate() { 
      return mDate; 
     } 


    } 

Hier ist der benutzerdefinierte Array-Adapter.

import android.app.Activity; 
import android.view.LayoutInflater; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.ArrayAdapter; 
import android.widget.TextView; 

import java.util.ArrayList; 

/** 
* Created by Atanu on 25-06-2017. 
*/ 

/* 
* {@link EarthquakeAdapter} is an {@link ArrayAdapter} that can provide the layout for each list 
* based on a data source, which is a list of {@link Earthquake} objects. 
* */ 
public class EarthquakeAdapter extends ArrayAdapter<Earthquake> { 

    private static final String LOG_TAG = EarthquakeAdapter.class.getSimpleName(); 

    /** 
    * This is our own custom constructor (it doesn't mirror a superclass constructor). 
    * The context is used to inflate the layout file, and the list is the data we want 
    * to populate into the lists. 
    * 
    * @param context  The current context. Used to inflate the layout file. 
    * @param earthquakes A List of Earthquake objects to display in a list 
    */ 
    public EarthquakeAdapter(Activity context, ArrayList<Earthquake> earthquakes) { 
     // Here, we initialize the ArrayAdapter's internal storage for the context and the list. 
     // the second argument is used when the ArrayAdapter is populating a single TextView. 
     // Because this is a custom adapter for three TextViews , the adapter is not 
     // going to use this second argument, so it can be any value. Here, we used 0. 
     super(context, 0, earthquakes); 
    } 

    /** 
    * Provides a view for an AdapterView (ListView, GridView, etc.) 
    * 
    * @param position The position in the list of data that should be displayed in the 
    *     list item view. 
    * @param convertView The recycled view to populate. 
    * @param parent The parent ViewGroup that is used for inflation. 
    * @return The View for the position in the AdapterView. 
    */ 
    @Override 
    public View getView(int position, View convertView, ViewGroup parent) { 
     // Check if the existing view is being reused, otherwise inflate the view 
     View listItemView = convertView; 
     if(listItemView == null) { 
      listItemView = LayoutInflater.from(getContext()).inflate(R.layout.list_item, parent, false); 
     } 

     // Get the {@link Earthquake} object located at this position in the list 
     Earthquake currentEarthquake = getItem(position); 

     // Find the TextView in the list_item.xml layout with the ID mag 
     TextView magTextView = (TextView) listItemView.findViewById(R.id.mag); 
     // Get the magnitude from the current Earthquake object and 
     // set this text on the name TextView 
     magTextView.setText(currentEarthquake.getMagnitude()); 

     // Find the TextView in the list_item.xml layout with the ID place 
     TextView placeTextView = (TextView) listItemView.findViewById(R.id.place); 
     // Get the place of occurrence from the current Earthquake object and 
     // set this text on the number TextView 
     placeTextView.setText(currentEarthquake.getPlace()); 

     // Find the Date of occurrence in the list_item.xml layout with the ID date 
     TextView dateTextView = (TextView) listItemView.findViewById(R.id.date); 
     // Get the Date of occurrence from the current Earthquake object and 
     // set the date to TextView 
     dateTextView.setText(currentEarthquake.getDate()); 

     // Return the whole list item layout (containing 3 TextViews) 
     // so that it can be shown in the ListView 
     return listItemView; 
    } 

} 

bitte helfen, ich kann nicht voran gehen, ohne dies zu lösen. Vielen Dank im Voraus.

+0

Haben Sie ypu überprüft, ob Ihr getCount nicht 0 zurückgibt? –

+0

irgendein Fehler in logcat? – John

Antwort

1

Ihr JSON-String ist nicht korrekt

private static final String SAMPLE_JSON_RESPONSE="incorrect json" 

Bitte überprüfen sie auf Online-Validator [wie die, die Sie in der Inline-Screenshot sehen] und es analysieren. enter image description here

+0

ich weiß nicht viel über Json hast du eine Idee, was könnte in diesem Skript falsch sein. Ursache Ich kopierte das Skript von einem Udacity cource Link ist hier https://gist.github.com/udacityandroid/10892631f57f9f073ab9e1d11cfaafcf –

+0

Bitte versuchen Sie dies http://www.androidhive.info/2012/01/android-json-parsing-tutorial / –

0

Ich habe gerade den Fehler herausgefunden, den ich gemacht habe, der JSON-Code ist korrekt. Ich war mit

JSONArray earthquakeArray = BaseJsonResponse.getJSONArray("Features"); 

von

insted
JSONArray earthquakeArray = BaseJsonResponse.getJSONArray("features"); 

weil mein JSON Skript einen Schlüssel mit dem Namen "Features" nicht "Features" hat.

0

Es ist etwas falsch mit Ihrem JSON. Versuchen Sie, es zu analysieren, indem Sie nur zwei Dummy-Variablen nehmen.

PS: Überprüfen Sie das Bild neben. Json sieht nicht angemessen aus. Screenshot

0

Entfernen Sie einfach '\' diesen Schrägstrich von der vollständigen JSON-Zeichenfolge, die Sie von der Quelle kopiert haben. Dadurch wird Ihre JSON-Zeichenfolge gültig und Ihre JSONObject-Aufrufe können leicht verstehen und analysieren, was Sie sagen möchten. Verwenden json Validator wie jsonlint.com

ist hier erste Objekt Ihrer json ohne \ schlitzt Sie zu demonstrieren habe es wie folgt zu tun:

{ "type": "FeatureCollection", "Metadaten" : { "erzeugt": 1462295443000, "url": "http://earthquake.usgs.gov/fdsnws/event/1/query?format=geojson&starttime=2016-01-01&endtime=2016-01-31&minmag=6&limit=10", "title": "USGS Erdbeben", "Status": 200, "api": "1.5.2", "Grenze": 10 , "offset": 1, "count": 10}, "features": [{ "type": "Eigenschaft", "Eigenschaften": {"mag": 7.2, "Ort": "88km N von Yelizov o, Russland“, "Zeit": 1454124312220 "aktualisiert": 1460674294040 "tz": 720, "url": "http://earthquake.usgs.gov/earthquakes/eventpage/us20004vvx", "Detail": "http://earthquake.usgs.gov/fdsnws/event/1/query?eventid=us20004vvx&format=geojson", "gefühlt": 2, "cdi": 3,4, "mmi": ​​5.82, "alert": "grün", "status": "überprüft", "Tsunami": 1, "sig": 798, "Netz": "us", "code": "20004vvx", "ids ": ", at00o1qxho, pt16030050, us20004vvx, gcmt20160130032510, "," quellen ": ", at, pt, us, gcmt, "," types ": ", cap, dyfi, endlicher fehler, general-link , Allgemein-Text, Geoserve, Impact-Link, Impact-Text, Verlustpager, Moment-Tensor, nahegelegene Städte, Herkunft, Phasendaten, Shakemap, Tektonische Zusammenfassung, ", " nst ": null," dmin ": 0,958, "rms": 1,19, "lücke": 17, "magTyp": "mww", "typ": "erdbeben", "titel": "M 7,2 - 88 km N von Yelizovo, Russland"}, Geometrie ": {" Typ ":" Punkt ", " Koordinaten ": [158.5463, 53.9776, 177]}," id ":" us20004vvx " }]

}

können Sie dieses Objekt kopieren und in JSON-Validator überprüfen oder direkt versuchen, es zu analysieren, arbeiten.

Hoffe das hilft und löst Ihr Problem.

Verwandte Themen