For energy conversion and storage devices, intrinsic properties of materials determine the devices performances. Here I present works on understanding residual strain and its effect in halide perovskite materials with nanoXRD. In addition, I investigate the silver dissolution phenomenon in Zn-AgO batteries, which is a limiting factor for their shelf life and cycle life. The degradation modes of materials were studied with synchrotron X-ray techniques to provide insights for improving device performances.