Mobile - Screenshot Detection

C++, C#, Java, PHP, ect...
Post Reply
User avatar
Xaos
Posts: 946
Joined: Wed Jan 11, 2012 4:01 am

Mobile - Screenshot Detection

Post by Xaos »

Does anyone know how, on a mobile app (Android and iOS), you can detect if the user took a screenshot like in Snapchat?
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: Mobile - Screenshot Detection

Post by Jackolantern »

On most mobile platforms, it is extremely hard to impossible to get the unshared state of another app because of how it is setup. Each app runs in isolation for security, so unless the other app specifically shares that a screenshot was taken with other apps, I'm afraid you are likely out of luck.

About the only thing I could think of would be to continuously monitor the pictures folder, but that could cause false positives if they simply switch apps to the camera and take a regular picture.
The indelible lord of tl;dr
User avatar
Xaos
Posts: 946
Joined: Wed Jan 11, 2012 4:01 am

Re: Mobile - Screenshot Detection

Post by Xaos »

Well I wasn't really thinking of another app taking the screenshot, I was more focused on taking a stock screnshot (IE holding the power button and the home button on some phones, for example). Similiar to how Snapchat does.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: Mobile - Screenshot Detection

Post by Jackolantern »

Oh, you want your app to take a screenshot?

EDIT: And sorry, I am not familiar with Snapchat.
The indelible lord of tl;dr
User avatar
Xaos
Posts: 946
Joined: Wed Jan 11, 2012 4:01 am

Re: Mobile - Screenshot Detection

Post by Xaos »

I want an event to happen when the user takes a screenshot. Basically whenever the user uses the stock way to take screenshots, it triggers an event. With Snapchat, you send your pictures to someone else, and if they take a screenshot, you are notified.
User avatar
Jackolantern
Posts: 10893
Joined: Wed Jul 01, 2009 11:00 pm

Re: Mobile - Screenshot Detection

Post by Jackolantern »

You would have to check to see if there is a public event in the SDK for when this occurs. If there isn't, I am not sure how you could proceed.
The indelible lord of tl;dr
User avatar
KyleMassacre
Posts: 573
Joined: Wed Nov 27, 2013 12:42 pm

Re: Mobile - Screenshot Detection

Post by KyleMassacre »

Found this for iOS but not too sure on android

Doh, forgot the link
http://ios-blog.co.uk/tutorials/how-to- ... -snapchat/
User avatar
Xaos
Posts: 946
Joined: Wed Jan 11, 2012 4:01 am

Re: Mobile - Screenshot Detection

Post by Xaos »

Hey, thanks!
Post Reply

Return to “Coding”