Ionic Materials for Applications in Sensing and Optoelectronics