There are several questions you can ask yourself to gain practice in deciding that question.
- Was the system originally sold without this program? Angry Birds may be a "Killer App" for a smart phone (the reason why someone buys it), but it is still a separate third-party app written long after the phone was introduced. Writing it would have been applications programing. But the display driver of the same smart phone is essential to using it at all, so it would have been systems programming.
- Can you imagine porting the code to another platform without largely rewriting it? TeX and
troff have been ported to virtually any system with few changes, so they are applications, even though they are located towards the bottom of the tool chain that people typically use. The file system that TeX writes its output to, e.g. UFS or VFAT, is a borderline case. You could port a file system to a different OS if it was totally awesome, but usually people just take over awesome ideas and write their own file system for their own OS. That makes file systems software.
- Is the functionality implemented in the kernel or in separate binaries? (File systems occupy a middle ground here as well. many parts of many file systems are in fact kernel code, but many have substantial parts in user-space.) Graphics display drivers can in principle be pluggable external components, but they are often implemented in the kernel or at least with privileged direct access to the kernel (or even to the hardware). That would be systems programing. On the other hand, computer games that use the graphics display stack are applications.
To your questions, writing the Android OS was definitely systems programming. Writing a program that uses Windows API calls is application programming. It is not as portable as if would be if you used cross-platform libraries such as SDL or OpenGL, but it can in principle be ported, it is third-party-code, and it runs in user space. A console app that exposes the state of the Linux kernel is an interesting thought experiment. I would definitely say it involves systems programing, since you'd have to know a lot about the structure of Linux (note that "Linux" is properly only the kernel, not the distribution) to write, and probably even to use it!