This is not a code solution, but the answer to your question, so you can start with where.
In my opinion, your question in the question header asks about two things.
(part 1) Getting user behavior on an Android phone (part 2) (application history, history review, etc.)
1- First part Getting user behavior on an Android phone:
There is a concept called contextual awareness. Short description; it is about collecting various data from the phone, such as a light sensor, motion sensor, sound, location or even user behavior, etc. and depending on your application and the information collected:
- You can send this data to the cloud data warehouse for static use.
- You can make your phone do (behavior) different things depending on location, movement or what ever.
- and etc.
To understand the context, this is an open area for large-scale computer research. And to write not just a few lines of code, it is usually a complete solution depending on the requirements. Example. I created a contextual awareness application to collect noise collected by phones from different places for research purposes inspired by this structure , but I'm sure you can find other frameworks or even create your own, as was the case in my case.
There are several examples in this structure.
2- The second part is devoted to the history of applications, browsing history, etc.:
It is possible, but you still need to create a software world (App) to collect all this information (logs) from your phone. In the future, you can make the phone act on different conditions and / or send it again through the RESTful API through the cloud services data warehouse, there is no limit for this.
The problem is that there is nothing out of the box for your requirement. Even if you find frameworks, you still need to research it and continue working on it.
You can find different examples for your requirement, for example, to collect browser history, here you can find the SO question:
Get browser history and android search result
Or get a list of installed applications:
How to get a list of installed applications for Android and choose one to run
My point is that you need to solve small goals at a time and combine your knowledge at the end.
Both 1 and 2 can also be related to each other, depending on your achievements.
Conclusion
- Set your project.
- Define the basic requirements and objectives of your project.
- Explore your options (technology, cost, target audience, what data I may or may not collect, what I can collect, what restrictions, privacy issues, etc.).
- Divide your project into small assets and try to solve small problems / goals.
- Finally, you can combine the puzzles and create your final app.