June 2018
Beginner to intermediate
394 pages
9h 2m
English
As we have already learned, Performance Monitoring captures network data automatically. When your application has too many network calls and you want to monitor a specific network, call the following code snippet, as it explains how to achieve this:
HttpMetric metric = FirebasePerformance.getInstance().newHttpMetric("https://www.google.com", HttpMethod.GET);final URL url = new URL("https://www.google.com");metric.start();HTTPURLConnection conn = (HttpURLConnection) url.openConnection();conn.setDoOutput(true);conn.setRequestProperty("Content-Type", "application/json");try { DataOutputStream outputStream = new DataOutputStream(conn.getOutputStream()); outputStream.write(data);} catch (IOException e ...
Read now
Unlock full access