The energy harvesting network in mobile environment is promising for sustainable environment and green communication. How to efficiently use the harvested energy is a key to improve the performance of energy harvesting communication network. This paper considers a point-to-point communication scenario where a static sensor harvests energy and transmits information to a moving agent. From the viewpoint of information theory, we present an optimal power allocation (PA) solution to achieve the maximum channel service. We prove that using a water-filling transmission power, during a single transmission timeslot, the energy depletion time is uniquely determined by the initial energy in the sensor regardless of the energy-harvesting power. On the other hand, the energy depletion time is a determinant of whether the energy is exhausted at the end of the transmission timeslot. Based on the obtained results, an event-triggered transmission strategy is proposed where a sensor harvests energy to a certain amount so as to trigger information transmission towards the moving agent. Some numerical results are provided to confirm the theoretical analysis and our proposed event-triggered implementation approach.