Advanced piezoresistive and magnetoresistive sensors