We subscribed to Thermometer instance but never released a Disposable resource later. As a result it can blow up an application logic or even cause a memory leak!
💩
⚠️
Note: in case you're facing with IllegalStateException: Plugins can't be changed anymore, then another application component tries to use RxJavaPlugins utility class with exclusive access. Disable this component when working with the plugin.
Make snapshot & generate HTML report
Now you're ready to go! Check whether you have alive Rx subscriptions at the moment:
val result =RxDisposableWatcher.probe() // Collect info: stacktrace, number of calls, typeval report =HtmlReportBuilder(result).build() // Generate HTML report
For Android save the report to SD card:
val report =...
val file =File(context.getExternalFilesDir(null), "report.html") // Specify filenameval stream =FileOutputStream(file)
stream.use { it.write(report.toByteArray()) }
Display HTML report in a desktop browser
Pull report file from Android device and display (replace with your paths):
adb pull /sdcard/report.html ~/report.html # Grab a report from SD card
open ~/report.html # for Mac# or
google-chrome ~/report.html # for Linux
That's it!
Displaying HTML report in one click (Like a boss)
😎
I want a magic button in Android Studio toolbar to show HTML report in one click!
The idea is pretty simple:
As a lazy developer I prefer the described approach, because it dramatically saves my time!
Copyright 2020 Andrey Fomenkov
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.
Built the ccp code on compose. Country Code Picker is an android library which provides an easy way to search and select country or international phone code.