In order to solve issues such as sustainable energy sources, there is an urgent need for the development of eco-friendly and efficient energy conversion and energy storage materials. Structure-property relationship make structural analysis more important and a new paradigm is urgently needed to accelerate the real-time measurements, on-line structural analysis, and new material design and synthesis processes. In the presentation, the research results in the field of solar cells and batteries using in-situ X-ray scattering/diffraction and grazing-incidence X-ray diffraction will be discussed.