  The demand for reducing the energy consumption of location-based applications
has increased in recent years. The abnormal battery-draining behavior of GPS
makes it difficult for the developers to decide on battery optimization during
the development phase directly. It will reduce the burden on developers if
battery-saving strategies are considered early, and relevant battery-aware code
is generated from the design phase artifacts. Therefore, we aim to develop tool
support, eGEN, to specify and create native location-based mobile apps. eGEN
consists of Domain-specific Modeling Language (DSML) and a code generator for
location-sensing. It is developed using Xtext and Xtend as an Eclipse plug-in,
and currently, it supports native Android apps. eGEN is evaluated through
controlled experiments by instrumenting the generated code in five
location-based open-source Android applications. The experimental results show
4.35 minutes of average GPS reduction per hour and 188 mA of average reduction
in battery consumption while showing only 97 meters degrade in location
accuracy over 3 kilometers of a cycling path. Hence, we believe that code
generated by eGEN would help developers to balance between energy and accuracy
requirements of location-based applications. The source code, documentation,
tool demo video, and tool installation video are available at
https://github.com/Kowndinya2000/egen.
