You measure which wire is positive and which is negative from the power supply - 'usually' screen would be negative and the inner core positive - but measuring with a voltmeter proves this 100%.
For the device, it would be nice to think that black is negative, and red is positive - but this isn't always the case. You could check to see if there's any obvious chassis connection in the device (such as the metalwork of a USB socket), this would 'usually' be connected to negative, but again it's not 100% guaranteed.