we are developing an android device. its on android 4.4.2. My issue is that i am getting red frame like strip which occur at different frequencies. some come and go very fast. but some stay for some time.
i tried to remove the strict mode in developer option.
i tried to make persist.sys.strictmode.visual to 0 manually also by setprop.
But the red strips are killing my days.Please help me on this.
Dont put it as duplicate. Because everywhere the issue is solved with strictmode value to 0. But for me that solution is not helping..
I know this is a bit late but you can try this:
ADB into the device
(open command prompt and type "adb shell")
Then type the following commands
setprop persist.sys.strictmode.visual 0
setprop persist.sys.strictmode.disable 1
Once complete, restart the machine. It worked for me using 5.0.0.
Related
Can't seem to launch Layout Inspector on Android Studio 3.0 (Canary 3)
When connected to my device and app running, choosing Tools > Android > Layout Inspector comes up with the following error dialog:
"Error obtaining view hierarchy: Unexpected error: empty view hierarchy"
Any setup I'm missing? I have Developer Options enabled on the device.
In general I've this behavior when something is "moving" in the view so the layout inspector cannot retrieve a simple layout, that's why pausing a video will work but if you have something more complex like camera preview or Google Map is harder, not sure how to work around this
If you have ViewTreeObserver in your code to measure a view's width/height, and you're changing some width/height/padding/etc. according to a result you are getting from addOnPreDrawListener of ViewTreeObserver;
Just comment inside onPreDraw or comment all code related to ViewTreeObserver.
I can't launch my hierarchy viewer while playing video. Once I pause the video, it works!
This could be related to your Android version. For example, in my case, this error occurs on Genymotion on Android 4. After moving to Android 5 this error gone.
In my case, I had two devices connected to add, one device and an emulator. And I had to make sure only one device is connected. Then it worked. I was on Android Studio 3.2 Canary.
What I tried and did NOT work:
kill adb process and tried it again
clearing cache and restart
uninstalling the app, cleaning the build and building it again
disconnect the device and plug it back in
Finally I managed to solve it by turning off developer options and then turning it on + enable usb debugging.
Had same problem on Android Studio v2.3.3, problem was related to CountDownTimer Object, somehow it cause problem (probably because of onTick method).
After commenting it, I could normally use Layout Inspector.
Maybe you use something similar in your code, try to comment it out and see if if works.
Had the same problem.
Could not capture hierarchy on Emulator.
I used a real device and it worked fine.
I changed my device from a Nexus 6 to a Pixel XL. Then it worked.
So try and change your device and see if that fixes the issue.
I have an Android tablet (Teclast X98) with an extremely annoying feature that it constantly keeps adjusting the brightness of the display all by itself.
Initially I thought maybe the tablet has a faulty display unit - the pumping of the brightness is that annoying. After a lot of investigation I finally noticed this in dmesg:
QL: i915_dpst_compute_brightness dpst factor = 7022.
QL: i915_dpst_compute_brightness dpst factor = 6987.
QL: i915_dpst_compute_brightness dpst factor = 6882.
Put DPST into Google and I find the Intel engineers came up with this:
http://en.wikipedia.org/wiki/Intel_Display_Power_Saving_Technology
So it's not just the brightness that is adjusted, but also the chroma of the display, which leads to washed out colors in addition to the reduced backlight intensity.
Next I try and find the driver where this is implemented. Giving the function name a shot on GitHub I found it in the i915 GPU driver.
Now I see in that the driver has a dpst.enabled setting.
Presumably there should be some way to set dpst.enabled to false.
Anyone have any clue how I could turn it off?
sysctl, /proc/...? There has to be some way to turn it off?
Well. That was surprisingly easy.
Not sure if this is the correct way to do it, but here's how I got rid of it:
echo 0 > /sys/class/drm/card0/power/i915_dpst
# Something keeps writing 1 into this file, so I just prevent it like this
busybox chmod gou-w /sys/class/drm/card0/power/i915_dpst
If someone knows a better way to disable it please add an answer.
My teacher wants us to work on the Snake Android demo, and I'm having trouble using the arrow keys of my Mac. I need to press the arrow about 20 times before the snake actually moves. In my 2.3.3 AVD config I have enabled hw.dPad and hw.keyboard. One thing I was suggested was to use an Android 4 rom, but I actually get worse problems. What else can I do?
I guess that you are using the emulator.
It is indeed pretty slow on old/moderate hardware.
One good solution is to use a x86 Android image instead of the default one, they are notably more efficient.
installation guide : http://bryanmarty.com/blog/2012/08/04/faster-android-emulator-mac-android-4-0-3-ice-cream-sandwich-2-3-3-gingerbread/
Another is to run the game directly on your terminal if you own an Android phone/tablet.
I tried changing the screen resolution in build.prop file in system, but it requires re booting.
I need a solution for changing screen resolution on android devices without re booting.
Thanks,
Krishna
Unfortunately that is not possible. Everytime when Android boots, it will read the build.prop file and set parameters pointed by it accordingly. After it has booted, it will not access that file dynamically to change parameters. So for any change to take effect, a reboot is compulsary, you cannot escape it.
Set resolution (e.g. 1024x768):
$ am display-size 1024x768
Reset:
$ am display-size reset
Doesn't require a reboot. This works with Android 4.2. Solution for 4.3 is mentioned by LiTTle
There is also an App for that called NOMone Resolution Changer.
Android can change the screen resolution.
I think that you need Android 4.0 and above version.
Only things you need is terminal emulator and root access.
Reproduce the following steps:
1. Open the terminal emulator app.
2. Type su.
3. Type wm.
Read the help message appeared and you will understand...
In case you want an App take a look at this on Play Store or the source from Github.
I spend many time testing orientation changes, going back, changing again etc etc..checking if fragment are loaded correctly..
has anyone think about a process to test that issues or use a tool for that?
thanks
Using Robotium, you can change the orientation by simply calling:
solo.setActivityOrientation(Solo.LANDSCAPE);
or in JUnit:
activity.setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_LANDSCAPE);
I'm not really aware of an existing method of automatically testing with several screen sizes, but it would be easy enough to manually run the test using a different AVD if you configure AVDs for each screen resolution you want to test with. You could probably start various emulators and run the tests all from the command line on each emulator using something like the following (if you're using a Unix like operating system or Cygwin):
for i in avd_1 avd_2 avd_3
do
emulator -avd $i &
PID=$!
adb wait-for-device
adb -e install path/to/your/app.apk
kill $PID
done
where avd_1, avd_2, etc. are replaced by your android virtual device names for the devices with the different screen resolutions.
You might want to have a look at the Spoon test runner. It will run your instrumentation tests on all connected devices and can also make screenshots during the test to help you see the results visually.
If you want to run your unit & HMI tests on multiples emulators with different Screen size and resolution, the best thing to do is to setup a Jenkins with the android emulator plugin.
It allows you to define matrix jobs and check if your tests are ok on several platforms:
It will be painfull to set up but the benefits are really great!