how to take android user homepage screenshot programmatically? - android

I'd like to take the Screenshot of user homepage Could you please guide me how I could do that Currently I am using
LinearLayout linearLayout = (LinearLayout )findViewById(R.id.layout);
linearLayout.setDrawingCacheEnabled(true);
Bitmap bitmap= linearLayout.getDrawingCache();
Its working for my views but how I can find the Homepage view and take the screenShot of User homepage.

If by Homepage you mean the rootview of the screen then
getWindow().getDecorView().findViewById(android.R.id.content)
see question 4486034

Fortunately, this is not possible, for obvious security and privacy reasons, except perhaps on rooted devices.

I believe you can only do this on rooted devices using adb or something along those lines, Ive seen it done before, just not sure how, try finding out how to use ddms using an app on the phone

Related

Android SoftKeyboard shortcut

I have a question. I wanted to develop an app that would add a shortcut to the keyboard (Samsung SoftKeyboard).
The shortcut should be accessible via the dots at the top right (see attachment).
I would like to add a circle ("floating") over my app, as shown in the picture on the right.
Something specific should then be carried out via this circle (but that's not the point yet).
I've done a little research, but don't really know what to look for.
I hope you can help me.
thanks in advance
Example
afaik there is no such possibility to add anything in there. it's another app with own custom settings and options, you can't edit such or change in any way. your last chance is possibility of published API/some communication way for that app, which would allow to add such actions, but I very doubt Samsung made such API for own keyboard app and allowed ANY 3rd-party app to mess in their software... (btw. that would be very insecure for user)

Take screenshots from other apps as image source

I'd like to offer an app to modify images. In order to have the user give an easy access to the that feature, it would be the easiest solution to just let him directly take a screenshot to have the source picture taken or respond to a screenshot event and access the latest screenshot.
Unfortunately it seems to be a problem, since an app or even a service from the app runs in background cannot easily react to events and I haven't found any solution that would go only little close to that kind of thing.
So my questions are (lets assume all necessary permissions are given from the user):
Is there a possibility to register my app as kind of standard screenshot app (or additional screenshot app triggered by another key combination of the device) and how ;-)
Can an app stay in a state to notice if a screenshot is taken and
can access it?
If not: Any ideas for an workaround other than let the user select a taken picture, which is rather kind of roundabout and annoying?
Any hints are very welcome! Thank you in advance!
(Since I had a misleading headline, I reposted this question - sorry!)

Android-Show overdraw areas option not working

I want to use show overdraw areas option in Android to check my own app whether there exists overdrawing. I followed this guide : https://developer.android.com/studio/profile/dev-options-overdraw.html#VisualizingOverdraw , but I found that the option works fine with Android system and most of apps on my phone except my own one. I can't use the tool to check any view/viewGroup on my app. I googled a lot but got nothing. I just wonder why, and how can I use the tool to check overdrawing situation.
BTW, Profile GPU Rendering-On screen as bars doesn't work either.
Hope someone could help.
Delete this from manifest
android:hardwareAccelerated="false"

android screen capture without layout root view

Actually in android mobiles when we press the home button and the side button at a time we can make a screenshot. which event is running at the time of pressing?
In the camera event we fire android.provider.MediaStore.ACTION_IMAGE_CAPTURE.
Posts about how to make a screenshot:
This: screenshot in android
or this: How to programmatically take a screenshot in Android?
or maybe this: https://stackoverflow.com/a/10482368/1164919
But i did not find anything about some kind of provider as you describe in your post.
It looks like there is a dedicated service running from android 4.0 and up which helps to take screenshots by the way you have mentioned here.
But I am not aware of how it happens in the previous versions of android.
Here is a link to the Service TakeScreenshotService. When you look into it you will be able to see another class which actually is responsible for capturing the Screenshot and storing it. And here is the link to the class GlobalScreenshot.

How to take a screen shot in android

I want to take a screen shot in android irrespective of the application and without rooting the phone. I have seen into the previous thread link
I followed this instructions but they are specific to one application. And we need to change the layout file of every application.
I also came across the link which is a library. One thing which is not clear to me in this is that whether the manifest.xml file should be changed for every application.
Can you please let me know if any other ways are possible? I know this is a security issue but if the application doesnt mind I need to take the screen shots.
Thanks.
if you don't need the status bar (or keyboard) you can do this in your activity:
View root = findViewById(android.R.id.content);
root.setDrawingCacheEnabled(true);
Bitmap bm = Bitmap.createBitmap(root.getDrawingCache());
root.setDrawingCacheEnabled(false);
Completely untested but it should work.
After seeing your comment about taking screenshots of other applications I do not believe that what you want is possible without rooting the phone.

Categories

Resources