Description
Android Snooper is a HTTP inspector which observes all the HTTP calls made by the app and opens up an Activity to see the detailed history of HTTP calls on onShake event. This library is inspired by the Network Request History feature of FLEX app for iOS. Android Snooper works on the interceptor mechanism provided by almost every HTTP client. https://github.com/jainsahab/AndroidSnooper
Android Snooper alternatives and similar packages
Based on the "Debug" category.
Alternatively, view Android Snooper alternatives based on common mentions on social networks and blogs.
-
Android Debug Database
A library for debugging android databases and shared preferences - Make Debugging Great Again -
Linx
Lynx is an Android library created to show a custom view with all the information Android logcat is printing, different traces of different levels will be rendererd to show from log messages to your application exceptions. You can filter this traces, share your logcat to other apps, configure the max number of traces to show or the sampling rate used by the library. -
android-grid-wichterle
This app will show grid overlay over whole system which helps you to verify your excellent app design. -
Under the Hood
Under the Hood is a flexible and powerful Android debug view library. It uses a modular template system that can be easily extended to your needs, although coming with many useful elements built-in. -
AndroidMiniDebugger
A small tool to log your application inside your application with a floating UI component -
AppSpector
Remote Android and iOS debugging and data collection service. You can debug networking, logs, SQLite and mock device's geo location.
InfluxDB - Purpose built for real-time analytics at any scale.
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Android Snooper or a related project?
README
Android Snooper
Introduction
Android Snooper is a library which helps in debugging issues while running the applications on android devices. One of the basic features provided includes HTTP inspection, which observes all the HTTP calls made by the app. When the device is shaked, history of all the HTTP requests is presented with their responses and allows search, copy and sharing of the request/response. This library is inspired by the Network Request History
feature of FLEX app for iOS.
[Snooper](assets/snooper_demo.gif)
How to use?
Android Snooper works on the interceptor pattern which is supported by almost every HTTP client. All you need to do is initialize Android Snooper using AndroidSnooper.init(this);
statement in your Application class and set an instance of SnooperInterceptor
to the list of your network interceptors.
As of now Snooper supports the interceptors for the following libraries:
Didn't get your HTTP client's name in the list? No worries, You can still write your own implementation by using Android Snooper's
core module and let Android Snooper know about the request being made. Below is given a dummy implementation.
AndroidSnooper androidSnooper = AndroidSnooper.getInstance();
HttpCall httpCall = new HttpCall.Builder()
.withUrl(httpRequest.getUrl())
.withPayload(httpRequest.getRequestPayload())
.withMethod(httpRequest.getMethod())
.withResponseBody(httpResponse.getResponseBody())
.withStatusCode(httpResponse.getRawStatusCode())
.withStatusText(httpResponse.getStatusCode())
.withRequestHeaders(httpRequest.getHeaders())
.withResponseHeaders(httpResponse.getHeaders())
.build();
androidSnooper.record(httpCall);
The above implementation ought to be part of your custom interceptor where you will have access to the required Request
and Response
object to jot down the required data for Android Snooper to work properly.
Warning: Android Snooper records each and every HTTP call intercepted by it. The sole purpose of Android snooper is to help in debugging, hence only Debug or QA builds are the perfect candidates for integrating the library. Sensitive information such as Auth Tokens, Headers, etc are not supposed to be exposed and hence production apps should not integrate the library.
Integration
repositories {
mavenCentral()
}
// when using Android Snooper's core module
compile ('com.github.jainsahab:Snooper:1.5.5@aar'){
transitive = true
}
// Android Snooper library for "Spring Android Rest Template"
compile ('com.github.jainsahab:Snooper-Spring:1.5.5@aar'){
transitive = true
}
// Android Snooper library for "Square's Okhttp"
compile ('com.github.jainsahab:Snooper-Okhttp:1.5.5@aar'){
transitive = true
}
Snapshot versions are available in Sonatype's snapshots repository.
Contributing
If you would like to contribute code to AndroidSnooper
you can do so by forking the repository and create a Pull request. You can also create an Issue to report bugs or features that you want to see in AndroidSnooper
library.
Attributions
This library uses:
- Icons made by Madebyoliver, Freepik and Gregor Cresnar from www.flaticon.com is licensed by CC 3.0 BY.
LICENSE
Copyright (C) 2017 Prateek Jain
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*Note that all licence references and agreements mentioned in the Android Snooper README section above
are relevant to that project's source code only.