Code Reuse between Java and Android Applications

Yoonsik Cheon, Carlos Chavez, Ubaldo Castro
2019 Proceedings of the 14th International Conference on Software Technologies  
Java and Android applications can be written in the same programming language. Thus, it is natural to ask how much code can be shared between them. In this paper, we perform a case study to measure quantitatively the amount of code that can be shared and reused for a multiplatform application running on the Java platform and the Android platform. We first configure a development environment consisting of platform-specific tools and supporting continuous integration. We then propose a general
more » ... hitecture for a multiplatform application under a guiding design principle of having clearly defined interfaces and employing loose coupling to accommodate platform differences and variations. Specifically, we separate our application into two parts, a platform-independent part (PIP) and a platform-dependent part (PDP), and share the PIP between platformspecific versions. Our key finding is that 37%-40% of code can be shared and reused between the Java and the Android versions of our application. Interestingly, the Android version requires 8% more code than Java due to platform-specific constraints and concerns. We also learned that the quality of an application can be improved dramatically through multiplatform development.
doi:10.5220/0007843702460253 dblp:conf/icsoft/CheonCC19 fatcat:4nedwtqk4rd53mutqgunpryyvm