Android display Toast even the app is closed
Say, I have to calculate the sum of two digits and I pass the two values to the server and sever returns the calculated value and the app displays it in a Toast. It works perfectly. But I want to show this Toast even though the app is closed. I am wondering if I could use any other Context to make a global Toast. or what is the best way? Do creating a Notification makes any sense?
Showing toasts when your application isn't in the foreground even if possible is not the best idea. This is because a Toast poppoing out of nowhere can be annoying, uninformative and disrupt whatever the user is currently doing.
As you mentioned, Notifications are the way to go on this one. A notification can be read by the user whenever he decides to do it and they can't be missed as opposed to Toast simple because checking the notification requires the user to take action.
You can read more on notifications and how to implement them HERE.