searching for "hz".
Dim jo As JavaObject
jo.InitializeContext
Dim windowmanager As JavaObject = jo.RunMethod("getSystemService", Array("window"))
Dim display As JavaObject = windowmanager.RunMethod("getDefaultDisplay", Null)
Dim refreshrate As Float = display.RunMethod("getRefreshRate", Null)
Log(refreshrate)
you made me realize I can use quotes to narrow my searches on the forums<joke> all these years I thought it was M for Martin, only to discover now that it might be M for masochist </joke>
U da man !!B4X:Dim jo As JavaObject jo.InitializeContext Dim windowmanager As JavaObject = jo.RunMethod("getSystemService", Array("window")) Dim display As JavaObject = windowmanager.RunMethod("getDefaultDisplay", Null) Dim refreshrate As Float = display.RunMethod("getRefreshRate", Null) Log(refreshrate)
you made me realize I can use quotes to narrow my searches on the forums
refresh rate : 7 pages of results
"refresh rate" : 5 pages
Mmmh, but the main frequency is not always 50Hz, you'd need an calibrated generator to be most exact. Keepin Measurement Uncertainty at it's lowest.On a less-painful note:
there's probably a system call somewhere, accessible via some JavaObject call magic, but that is still a bit beyond me. If it's just something you want to know about your own phone, then my first idea would be to move a panel about on screen, one tick (millisecond) per step, and adjust the number of steps in the repetitive path until the strobing effect (beating? as in two similar frequencies alternating between being in and out of phase) made the panel appear stationary.
Eg if you move the panel in a circle, 16 steps, ie 360 / 16 degrees per step, one step per millisecond, then it will take the panel 16 ms to do one lap of the circle. So the panel would be doing about 60 laps a second, and if the screen refresh rate was 60 Hz then the panel would always be at the same spot on the circle when the flinger refreshes the display, and look like it's not moving.
We use a similar technique at work to calibrate speed on our equipment, using a mains-frequency (50 Hz) strobe to check that the part is indeed rotating exactly 50 times per second ie 3000 rpm.