Skip to content

Tag: android

How to auto refresh data in android studio every second?

I am new to android studio, I am making an app that gets the json of a field in thingspeak, but I don’t know how can I make an auto refresh to the data I get every second. Can you please help me? Answer I found a solution finally, I placed the data request inside the following code and it

CameraX: Animated Zoom

I am developing a camera app and I want to have something like double tap to zoom. I was able to implement that, but later I wanted to improve the app’s UX by animating the zoom. I tried applying a Ticker logic to do that but performing a simple zoom call from the CameraX API takes its own time (high

How can i save the date and time of a task using shared preferences?

I am trying to store the time at which a BLE scanner successfully scans for broadcasted advertisement packets. So far i am using the Function which successfully allows me to print the time of scans. I am also using SharedPreferences() to store the information recieved from the scanned data such as RSSI and he…

Camera VIew OpenCV in Android Cannot FIt

I have a problem with cameraview opencv on android, on android device type samsung camera view doesn’t fit there is a black cut like picture 1 while on android device type xiaomi and realme it’s safe like picture 2. I took the middle resolution from supportPreviewSize and set the maxFrameSize to a…

Strange layout rendering created with xml in andoid

I want to arrange buttons evenly on the layout using styles to make my code simple. So why buttons have different distance between each other and ViewGroup? Am I right that attributes defined in the xml file overrides style’s attributes? // xml code for the activity // used style Answer What the three b…