Permalink
Branch: master
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
83 lines (80 sloc) 2.42 KB
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>No data found</title>
<style>
.code {
padding:10px;
background:#ccdcde45;
color:blue;
display: inline-block;
}
</style>
</head>
<body style="padding:10px;">
<h1>OkHttpProfiler Plugin</h1>
<h2>
We don't receive any data from your android device.
</h2>
<p>OkHttp Profiler plugin can show request from okhttp library directly in your Android Studio toolwindow.
It supports okhttp v3 (<a href="http://square.github.io/okhttp/" rel="nofollow">http://square.github.io/okhttp/</a>)
or Retrofit v2 (<a href="https://square.github.io/retrofit/" rel="nofollow">https://square.github.io/retrofit/</a>)
</p>
<hr>
<h2>For installation you need to include library to your app build.gradle file</h2>
<div class="code">implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.5'</div>
<p>and add Interceptor to okHttpClient in code</p>
<h2>For OkHttp</h2>
<h3>Java</h3>
<div class="code">
OkHttpClient.Builder builder = new OkHttpClient.Builder();<br/>
if (BuildConfig.DEBUG) {<br/>
&emsp;builder.addInterceptor(new OkHttpProfilerInterceptor());<br/>
}<br/>
OkHttpClient client = builder.build();<br/>
</div>
<h3>Kotlin</h3>
<div class="code">
val builder = OkHttpClient.Builder()<br/>
if (BuildConfig.DEBUG) {<br/>
&emsp;builder.addInterceptor(OkHttpProfilerInterceptor())<br/>
}<br/>
val client = builder.build()<br/>
</div>
<h2>
For Retrofit
</h2>
<h3>
Java
</h3>
<div class="code">
OkHttpClient.Builder builder = new OkHttpClient.Builder();<br/>
if (BuildConfig.DEBUG) {<br/>
&emsp;builder.addInterceptor(new OkHttpProfilerInterceptor());<br/>
}<br/>
OkHttpClient client = builder.build();<br/>
Retrofit retrofit = new Retrofit.Builder()<br/>
&emsp;......<br/>
&emsp;.client(client)<br/>
&emsp;.build();<br/>
</div>
<h3>
Kotlin
</h3>
<div class="code">
val builder = OkHttpClient.Builder()<br/>
if (BuildConfig.DEBUG) {<br/>
&emsp;builder.addInterceptor(OkHttpProfilerInterceptor())<br/>
}<br/>
val client = builder.build()<br/>
val retrofit = Retrofit.Builder()<br/>
&emsp;......<br/>
&emsp;.client(client)<br/>
&emsp;.build()<br/>
</div>
<p>
More details by link: <a href="https://github.com/itkacher/OkHttpProfiler">https://github.com/itkacher/OkHttpProfiler</a>
</p>
</body>
</html>