With a new version of okhttp(4.9.0, not sure if it was in lower versions) and Retrofit 2.9.0(also lower versions). I started to see in firebase and google analytics reports about UnknownHostException. I tried to repro this crash and found that it is happening when the internet is off or very low quality. I ca…
Tag: android
LeakCanary detecting a leak in my Java Android app – Google Maps
I am relatively new to the scene with little programming background, therefore I apologise in advance if I ask something silly. I am show a google map using SupportMapFragment. I am doing this to prevent a leak in onDestroyView(), however no clue whether this is right or wrong? Full code is here: https://gith…
Unknown characters before String filename list in android application
I’ve saved an array list in the android mobile storage with a .txt extension. The problem is that there are unknown characters (as it’s shown in the screenshot) coming before each file name that my string does not contain these characters. and the screenshot is: Answer Instead of using ObjectOutpu…
How to open an app when its related file is clicked in file explorer?
I have made a music player application in android(java). It’s working well but i need to know that whenever i click on a music (.mp3 file) in file manager , music starts getting played in default …
How to access a variable of a service from an activity
I understand that in order to access methods of a service from an activity, we should bind the service. But if we just want to get the value of a variable in the service, can we just access it like so without binding? It works, but I’m not sure if it has any memory leak implications or any other issues.
Difference between CustomTextView as Parent and Textview as Parent
i created CustomTextview as below . what is the difference between This and this When i put this TextView textView = findViewbyId(R.id.view); IDE runs without throwing error. Why? Thanks! Answer A real life comparison: When you learn to drive a manual transmission car, you can drive almost any manual transmis…
Adding a linear layout in XML dynamically to another linear layout
Basically I created a separate XML containing a linear layout which contains a image and a textview, and I need this linear layout inside of another linear layout, where I need to add my first linear layout dynamically to the second linear layout. First linear layout, a separate XML file : Second linear layou…
Handle Response Kotlin Retrofit
I’m new to Kotlin and android development. Have been struggling to get my retrofit api to work. But have found a way to do it after some search on SO. I get the data response now, but I don’t know how to “separate” it, so that i can work around with it. this is my json response: and my…
Modifying the scoring of a quiz app (android studio)
Context about the app: This is a sample 5 question test app that I made while I also learned firebase database just yesterday. The app is working perfectly and it does it needs to do, BUT what I wanna do next is that there are no right answers and each button corresponds to a score ex: Question: What are you
ARCore: How to make my app available on GPlay only to devices that support Depth API?
I have an app that uses Depth API. As mentioned here: https://developers.google.com/ar/discover/supported-devices Depth API is not supported by all devices that support ARCore. How can I specify in my Manifest (or elsewhere) that my app requires a device compatible with Depth API ? Indeed, I don’t want …