Android is Linux-based. In Linus, all mounted filesystem devices are branches of the root filesystem tree. So if by "phone memory" you mean the internal filesystem RAM as opposed to the SD card RAM, it's a matter of where in the filesystem tree you store the data. If my unreliable memory is correct, my own phone's SD card is mounted at "/data".
So for that phone at least, the mere presence of anything under "/data" is an indicator. I don't know if the Android java.io.File implementation can report mountpoints (I'd have to RTFM to even make sure on standard Java!), but chances are that you could Runtime.exec() the "df" Linux utility if the sandbox permits you to.
Of course in my phone, the SD card is only accessible when the back cover is removed, so it's not something I pop in and out like I have on other devices.
An IDE is no substitute for an Intelligent Developer.