Android : Passing data between main thread and worker threads.There may be situations where you want to spawn a thread from your Activity or Service to handle long running and may be blocking tasks. In such cases, its sometimes necessary to pass data back and forth between the main thread and the worker threads. E.g. if the worker thread finishes a task and returns the result to the main activity to display the results OR you want to keep a worker thread around and ask it to switch between tasks depending on some message you pass to it.
ChatterBean: Flexible Alicebot
Basically, a chatterbot is a computer program that when you provide it with some inputs in Natural Language English, French … responds with something meaningful in that same language. Which means that the strength of a chatterbot could be directly measured by the quality of the output selected by the Bot in response to the user? By the previous description, we could deduce that a very basic chatterbot can be written in a few lines of code in a given specific programming language. Let’s make our first chatterbot notice that all the codes that will be used in this tutorial will be written in Java. So, it is assumed that the reader is familiar with this language
The following diagram shows the important state paths of an Activity. The square rectangles represent callback methods you can implement to perform operations when the Activity moves between states. The colored ovals are major states the Activity can be in.