I want to identify whether a device(could be mass storage, data card, speakers) is external or internal via programmatic-ally. I didn't find any helpful information on the net.
To check whether the memory is storage card or internal memory, you can examines the objects in the root of the device and any folders that have temp attribute are considered to be a external match: