[Q] How to access and modify display frame/buffer? - Android Q&A, Help & Troubleshooting

I want to be able to intercept a frame that will be displayed to the user and modify it, ideally.
However, if there is a way to access a frame before it is displayed and insert an overlay, then that might be what I'm looking for too.
What I want to do is detect objects(say an apple) on the screen (where ever they might be, in a video that is playing or in a post in Facebook app) and then highlight them.
I'm willing to try anything from creating an app to modifying the source files of a custom ROM.
Is there any way I can achieve this?

Related

[Q] overlay text on camera feed

Hi,
I was wondering if someone knows if it would be doable to write text as an overlay to a video feed... My main goal would be to add GPS data (speed, direction, etc) to the feed.
A similar question was asked over a year ago, but never got any feedback: http://forum.xda-developers.com/showthread.php?t=758936
Maybe today's knowledge will enable us to do this?
palloquin said:
Hi,
I was wondering if someone knows if it would be doable to write text as an overlay to a video feed... My main goal would be to add GPS data (speed, direction, etc) to the feed.
A similar question was asked over a year ago, but never got any feedback: http://forum.xda-developers.com/showthread.php?t=758936
Maybe today's knowledge will enable us to do this?
Click to expand...
Click to collapse
Yes, you can.
Regarding your original post, you don't even need to record video. You just need to prepare a layout w/ a FrameLayout containing a Canvas/SurfaceImage where you will output the video from the Camera, and a TextView (or a more complex view depending on your particular needs) where you will output GPS data (or any other text).
Job done.
If you want to record it as a video, it will require more work, because you'll have to overlay the video feed with the text, then re-encode the feed. I haven't yet dealt with video recording, I made a simple (private) app which overlaps the current date and time on the captured image from the Camera. Since you're creating new images, you need to be sure your device has enough RAM to do the processing (or scale the image to be smaller and require less RAM).
That sounds rather simple (even though I have never build an Android App in my life, I have built for other platforms.)
But, this way you 'just' build an app that shows your video this way. What if I would want to change the video feed so any application (android camera app, Skype, etc..) will get this feed with the added overlay... Would THAT be doable?
Questions or Problems Should Not Be Posted in the Development Forum
Please Post in the Correct Forums
Moving to Q&A
palloquin said:
But, this way you 'just' build an app that shows your video this way. What if I would want to change the video feed so any application (android camera app, Skype, etc..) will get this feed with the added overlay... Would THAT be doable?
Click to expand...
Click to collapse
In order to accomplish that, you'd need to rewrite the (internal) code which talks to the camera. Either at kernel level, or at android API level.
So either with a custom kernel or a custom ROM. No other way.
It's 2016, is there a built in way to recording a phone's video feed with a PNG still image or animated overlay?

Firefox OS as an embedded email reader?

Greetings,
At my office, we rotate after-hours email monitoring but some of the older guys are apprehensive about getting cell phones, so keeping up on-the-go can be difficult. I am wondering about buying a ZTE Open off of ebay and getting a pay/mb data plan and we can pass that around as a dedicated email reader.
Up to that point, there is nothing to worry about, but what I am thinking of playing around with is cutting the OS down to only the email app and settings. I'd like to have it boot directly to email with settings available from the pull-down menu, if possible. I mainly want to keep it simple enough for cellular-phobic people and also take away the ability to browse the web and run up my cellphone bill.
I'm not super fluent in the in's and out's of FXOS beyond the app level, but I'm interested poking around, I'm just looking to gauge the difficulty. There are cheaper android devices that I could try with as well, but I'd much rather hack around in HTML/JS than Java. That being said, I have the option of just customizing the Andriod UI to remove everything except the mail app, so if tearing down the Firefox UI would be a lot of work, I'll just do that.
I have a Flame that I can run tests on before spending any money, but I appreciate your opinions before a throw away a bunch of time that could be used on something useful.
John
That's super doable and not very difficult I think! Only with one (obvious?) condition: you must have full root access to your device. ZTE gives a rooting tool, so if you stick with the Open C (or the flame) you should be good to go. Don't choose a Kliff for example, as they are not rootable yet.
First of all, stripping all of gaia (the top layer of firefox OS, containing all the UI) has already been done by JanOS (for IoT device), so you can get inspiration from them. They reduced it to only one js file and a folder, where you can put your own js that gets executed at startup. Your use case is a bit more complex though: you still want to access settings, and be able to go back to email when needed. Basically, you need the email app to replace the homescreen right?
Creating alternate homescreen is a possibility that firefox os gives you, see https://developer.mozilla.org/en-US/Apps/Build/Manifest#role
You can try adding the role "homescreen" to the email app, flash your device, change the homescreen in the settings and see what happens!
NB: when you change the manifest of an internal apps, you might need to rehash it by downloading https://github.com/julienw/config-files/blob/master/addpref and execute
Code:
./addpref rehash-manifest
while your device is connected (and usb debugging is on).
You might need to add handler in the email for the home button to work correctly, in a similar fashion as in verticalhome (which is the name of the folder containing the homescreen app, not "homescreen").
Good luck! Don't hesitate to ping me if you need any help.
---------- Post added at 11:00 AM ---------- Previous post was at 10:46 AM ----------
Dude I just tried this and it's working like a charm. The thing that took me the most time was the configuration of the email account

Custom ROM, remove all permissions?

I'm going to be giving a phone to my grandma who will be using the phone half a world away. I wish to be able to customize this phone remotely after I've given this phone to her. For example, she may feel that the default dialer is too confusing -- I want to be able to change it, or at least allow another app to directly make calls to all (including emergency) numbers.
The thing is I have no idea what changes I may need to do (it all depends on her user experience), so I was thinking perhaps if I created a custom ROM that removed all permissions requirements (so for example, ACTION_CALL would only require normal, instead of system, permissions) I'd have the most flexibility in adjusting the UX.
No one else but my grandma will be using this phone, and no apps will be installed by anyone but me, so security doesn't seem to be an issue.
Is this a good idea? Would this be hard to do, or would it just be a search and replace job in the code?
thanks for any help!
customize it before you give it to her. It's better for her not to be using an insecure phone. the granma spy police might try to hack it

Is there a Pocket like app, but just for bits of text, not the whole pages?

Does anyone know of an app that would behave like Pocket, but instead of saving the whole page it would allow you just to save bits of text from pages?
Its for learning purposes mostly. I spend a lot of times on FB groups or similiar places, and in like 90% of cases I need to save just one post in a thread, or just a short bit of text. Saving the whole page is counter productive cause either I forget why exactly I saved it, or I have to spend a lot of times looking for the exact info I wanted.
Pocket works great for what it's intended, and I would need something similar. Right now copy and paste seems to be the best solution, but when I send it to OneNote it adds it to new page, and what's worse it won't let me choose which workbook.
So, I need to be able to save part of text (saving images too would be a plus) and be able to quickly find it (via tags or something else). And of course, the ability to export it all. Can anyone recommend something?
I use Google Keep in exactly the manner you describe.
Take a screenshot, crop the image to only the important stuff. Move the images to a special folder perhaps, using any file manager. That's how I do it

Photo requirement bypass

Not sure if this this the right place to ask, but maybe someone can point me in the right direction. I'm looking for an app that will either "mascaraed" as a camera, or maybe some sort of feature that can be enabled or whatnot that will allow me to select a jpg file and pass it to the initiating app. For example, when I want to change my profile picture, some apps automatically start the camera app and won't let you just select a file. I want to force the option to select a file. Anyone know of anything like this? It would be awesome if this bypass could feed whatever image into whatever api or driver or however apps obtain camera data. I'm thinking something that can even slip a file into apps that have their own camera utility for capturing photos.

Categories

Resources