I have an app that rotates other apps. It uses an accessibility service so I have the ability to retrieve screen content.
Say I'm rotating a game called Geometry Dash to the portrait direction. Sometimes it will rotate correctly and look like this:
But other times it incorrectly appears like this:
Is it possible to detect when half the screen is black like in the second pic?
Perhaps using AccessibilityNodeInfo is the key since that class gives information about what's on the screen?
You could do it easily be loading the content of the screen into a bitmap then you can split the bitmap in two parts.
Check if one of them is only black.
Related
i am making an android app where the camera preview part is circle so that it will only have to capture the face of the user and beside the circle part make other part black.enter image description here
That would imply making a custom camera yourself instead of using the default one.
Refer to this link for this: https://stackoverflow.com/a/15392209/7528995
You could also use the normal camera instead, since making the user fit their head inside the circled preview would be a bit inconvenient. After capturing the photo you could simply put it into a CircleImageView.
To do this you can refer to this answer: https://stackoverflow.com/a/36613446/7528995
I'm trying to create a gauge/meter/dial animation as part of an application I'm trying to build.
What I'm trying to do is to display the acceleration values that I get via the the sensors on a gauge. Now I'm able to successfully get the values from the sensors but I don't know how to display them as an animated gauge/dial.
I've looked at the frame-by-frame and tweened animations, but they don't suit my needs, because I can't seem to use them to change the animation based on input from the code.
I should be able to display an image for the gauge and an image for the needle and then change the rotation of the needle image according to the values so as to make it look animated but I don't know how to do this.
Is there a way a do what I'm trying to do?
Is there a better/alternate way?
I'm using the standard Android SDK and eclipse and trying to support devices with android v2.2 upwards.
Hi Ayos Draw the background, a solid color is best, then draw you indicator in a different color (black). When you get a new value, test to see if its different and if it is draw the indicator in the background color (erase it). Then draw the new indicator. You will need to figure out a way of scaling your raw data and making it in to degrees to draw the indicator. Its best if your difference test allows you to not change the indicator if the change does not move the indicator less that a degree or two. If you use an image or pattern for the background then you have a big job in erasing the indicator. You might have to redraw the background every time, that takes a lot of processing time and the gauge may look jumpy. Cliff
Is it possible to create a touch draw area to take signatures in a form?
I am working on an application to collect information though a form and would like to collect signatures by letting users of the app draw a signature on the screen. How would I do this for android. Preferably I would like the "signature" stored as a image to save somewhere.
Does anyone have any idea?
Many thanks,
Check out Google's API example of Fingerpaint -- the full app is included in the samples -- but the code to the main Java file is here.
Basically, make some small section of the view a canvas control (like in finger paint) and then when the user presses done, save the Canvas as an image (using the Bitmmap object attached to the Canvas.)
You may want to turn rotation off for this particular view, otherwise the signature will get cleared when you rotate the image -- unless you implement some way of rotating it.
In any programming language, but preferably JAVA, I am trying to do screen captures from various browsers. I would like to capture the "whole" page, even the parts that one has to scroll to see.
A common method of achieving this is to capture the displayed, visible portion of the screen, then scroll to the next portion and capture it, and so on. One would then take these "tiles" and stitch them together in photoshop.
How can I capture the "whole" rendered page without scrolling? Is this possible. Is the page fully rendered but sitting in a video buffer somewhere? For example, let's say a page ends up rendering at 4000 x 4000 pixels. I want to capture the whole mess without scrolling.
I will want to do this for android, btw.
Snagit has the ability to easily capture images from objects that are larger than the screen. Give it a try, it's recommended as one of the five best screen capture tools by lifehacker.
Features and free trial version download:
http://www.techsmith.com/snagit.html
Currently I am developing an application for decoding barcodes using mobile phones.
I have a problem with how to draw a line or a square on the camera screen to easily capture the barcode.
What is the easiest way of doing it?
Unfortunately this isn't as easy as it sounds. If you have a preview image from a phone's camera then it's often rendered as an overlay. This means that the camera preview image doesn't actually form any part of your application's canvas and you can't interact directly with the pixels. The phone simply draws the preview on top of your appliction, completely out of your control.
If you draw a line on your screen, then it will be drawn underneath the preview image.
The way around this isn't too pretty. You need to actually capture an image from the camera. Unfortunately this means capturing a JPEG or a PNG file into a byte buffer. You then load this image using Image.createImage and render that to the screen. You can then safely draw on top of that.
This also has the undesirable downside of giving you an appalling frame-rate. You might want to enumerate all the possible file formats you can capture in and try them all to see which one is quickest.
You can do this by using OverlayControl, assumming that your target devices support it.
I think i remember seeing a good example # Sony Ericsson developer forums.
Edit: found this (does not involve use of OverlayControl)