Also, the difference between device handlers and smartapps is spelled out in somewhat excruciating detail in the following popular FAQ: