5

The Android default browser allows anonymous browsing. Is it possible to detect when the user is browsing in an incognito tab of the default Android browser application? (I have no interest in the url the user is visiting)

I am using a Content Observer object to receive updates on the user browsing history. When the user opens an Incognito tab, I don't receive any update, as anyone would expect. What I was wondering is how could I know that the user is browsing anonymously.

I can know that the Browser app is on foreground, and I know that no history url is being registered, but what other information could I retrieve to be sure the user is browsing in an incognito tab?

UPDATE:

Guys, thank you for your comments. I know exactly what I am asking. I know the point of incognito mode and that only the default Browser uses the ContentProvider for logging the browsing history.

I am writing a parental control app, so I would very much appreciate if anyone could answer the question.

Daniel Nugent
  • 40,780
  • 13
  • 103
  • 126
Xavi Gil
  • 10,764
  • 3
  • 51
  • 67
  • 4
    Why would the user of the device want you to know this? – CommonsWare Jan 17 '13 at 13:45
  • The whole POINT of incognito mode is that nothing gets logged or exposed to anyone or anything. – darryn.ten Jan 17 '13 at 13:57
  • @darryn.ten I know that. I think that was clear in my question, thanks. – Xavi Gil Jan 17 '13 at 14:02
  • So why would you want to know, or, for that matter, even care if the user is browsing incognito? – darryn.ten Jan 17 '13 at 14:04
  • @CommonsWare, I am implementing a parental control app, so the user would be a parent wanting to know if his children have browsed in incognito mode. – Xavi Gil Jan 17 '13 at 14:04
  • Since few, if any, other browsers use that `ContentProvider` for logging browsing history, you have bigger problems than worrying about incognito mode. – CommonsWare Jan 17 '13 at 14:18
  • @CommonsWare, I know that. I am only asking about the default Browser. Do you have any suggestion? – Xavi Gil Jan 17 '13 at 14:20
  • 2
    Beyond "do not write a 'parental control app'", I have no suggestions. Most likely, you have no way of telling if the user is in an incognito activity or any other activity (e.g., settings). Also, bear in mind that there are multiple "default Browser" apps. Presumably, you are thinking of the AOSP Browser app. Many devices replace this with something else. – CommonsWare Jan 17 '13 at 14:26
  • Not writing the app is not an option :) Yes I was only thinking in the AOSP Browser app. I thought the app is always shipped with the phone. Thanks for the tip. – Xavi Gil Jan 17 '13 at 14:32
  • Ever get your application finished? – jcaruso Oct 13 '13 at 23:30

1 Answers1

2

Might not be the ideal solution but you can go with the keyboard.

If you know that the Browser app is on foreground, no history url is being registered, but keys are being pressed, something is happening.

Maybe you can write your own keyobard app, and ship it with your parental control. If that's not an option:

How to detect if soft keyboard is on the screen

and

Detecting if keys are pressed

EDIT

Going for that you can also check the network traffic. If the browser is there with the keyboard on, but there is no traffic than you are probably safe!

Community
  • 1
  • 1
caiocpricci2
  • 7,514
  • 10
  • 50
  • 86
  • this question hasn't received too much support so thanks for the answer :) I like the approach, if the keyboard is being used and the Browser is on foreground + no history registered, that could mean the user is browsing in incognito mode. I will think about that and maybe I can use that at least as an alert to the father. Let's see if anybody comes up with something else. Thanks again! – Xavi Gil Jan 21 '13 at 14:21
  • 3
    People are too quick to judge without giving it the proper thought. – caiocpricci2 Jan 21 '13 at 17:48
  • Definitively, this seems to be the best approach: Browser in foreground + no history registered + there is some Browser network activity. It is not 100% accurate though, as the user could be streaming video and that could meet the former conditions. Thanks @gameower – Xavi Gil Jan 25 '13 at 09:05
  • To be honest that shouldn't be an issue. 99% of the time if someone is streaming video or audio besides getting way more traffic the browser will not be in the foreground. I've never watched any video in my browser, as it always give me the option to open in my favorite media player. If you find out any cases which this solution does not cover, please update this post. I'm very interested in how reliable this approach is! – caiocpricci2 Jan 25 '13 at 09:39
  • @ caiocpricci2 nice approach .................. but How can I detect keyboard in browser applications like chrome etc. how network traffic can help ? i have implemented. I have only getting Chrome for both browsing non-incognito and incognito. – Tarun Sharma Sep 01 '15 at 09:51