简体   繁体   中英

How to implement a method which can collect what information is display on the screen in android app

I want to do a research by monitor user behavior using android app. So we want to collect how many time they spend in each page in detailed (not only the total time we need for each portion of page cause the page is very long and scrollable) it's like we want to collect data like this: 时间

Also I want to ask is there any way I can do it without using WebView ?

Some point I forgot to say is "yes we plan build our own app" and "we want build a news app but we don't want to show news article using webview but in our own layout instead"

If any other information is required, let me know!

I would go on like this:

  • Try to put your page in not seeable segments
  • While someones scrolling put a counter on scrolling
  • If counter of scrolling would say your user is on part 1 - part 2 of your page you can start for each part xa new counter
  • If hes closing the page you finally collect the whole time spent in your db or you could use a thread saving the time for each segment and if thread gets closed save time

and I'm personally not a fan of webview, but if you don't want to use this page instead of a webpage you have to make your own native App with this design. (what I prefer more than everything:D + you wouldn't have pages being that long and it would be more smooth for users using your app)

Scenario: Instance variables:

  • global counter -> all counter times together
  • counterP1 -> Counter for part1
  • counterP2 -> Counter for part2
  • scrollcounter -> starting at 0 [Part1 = 0 to 50, Part2 = 51 to 100 etc. (example)]

  • Person starts App -> Automatically Part1 -> start counterP1
  • Person scrolls DOWN -> Scrollcounter++ -> If scrollcounter > 50 then person will be now in Part2 -> Stop counter P1, add time of counter P1 to global counter and reset counter P1 -> Start counter P2
  • Person scrolls UP -> Scrollcounter-- -> If scrollcounter < 51 then person will be back in Part1 -> Stop counter P2, add time of counter P2 to global counter and reset counter P2 -> Start counter P1

and so on:)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM