1

In my android app, I'm using 3rd party libraries like fresco and okhttp3. I want to trace the response of every request made through these libraries. And i want to do it globally

I'm using react-native also in my app, and i wants to trace the response of each api call made from react-native code like firebase performance monitoring tool.

Any idea how firebase is doing this?

In okhttp3 i can add interceptor to track these, but request made through fresco and react-native I'm not able to track like this

Jin
  • 462
  • 1
  • 7
  • 22
  • If you want to monitor request for debug purpose, you could use fiddler to capture all the requests made from mobile phones – Sangeet Suresh Aug 01 '17 at 08:33
  • @SangeetSuresh thanks for you reply. But I need to monitor from users mobile. I've integrated statsd for android, and I want to send all the network trace to send to statsd server using UDP protocol. – Jin Aug 02 '17 at 06:04
  • well you could have at least stated you need remote logging in the initial question, instead of downvoting valid answers later – Nick Aug 07 '17 at 11:08

4 Answers4

3

@JM India

Please check Android Snooper library. If I understand you problem correctly this is what you are looking for.

Hope this helps you.

Sandy
  • 251
  • 1
  • 4
  • 10
1

You can use Charles . This tool is powerful to trace all request and response. It works for all platform.

THANN Phearum
  • 1,969
  • 22
  • 19
0

In development, you can use Stetho to trace any calls via a Network Intereceptor.

There will be different ways to get the active OkHttp instance for different frameworks e.g. ReactNative.

Yuri Schimke
  • 12,435
  • 3
  • 35
  • 69
  • Thanks, but ReactNative stopped supporting OkHttpClientProvider.getOkHttpClient() and i Stetho won't fulfil my requirement. – Jin Aug 07 '17 at 11:02
  • Seems to be there https://github.com/facebook/react-native/blob/0.48-stable/ReactAndroid/src/main/java/com/facebook/react/modules/network/OkHttpClientProvider.java – Yuri Schimke Aug 07 '17 at 11:27
-1

https://blogs.msdn.microsoft.com/jpsanders/2013/04/03/configuring-fiddler-to-be-a-proxy-for-android-emulators-in-eclipse/

here's how I used to do it. All you have to do is set up a proxy using fiddler and configure your emulator to use it

Nick
  • 585
  • 4
  • 11