Abstract
For maximal market penetration, popular mobile applications are typically supported on all major platforms, including Android and iOS. Despite the vast differences in the look-and-feel of major mobile platforms, applications running on these platforms in essence provide the same core functionality. As an application is maintained and evolved, the resulting changes must be replicated on all the supported platforms, a tedious and error-prone programming process. Existing automated source-to-source translation tools prove inadequate due to the structural and idiomatic differences in how functionalities are expressed across major platforms. In this paper, we present a new approach---Native-2-Native---that automatically synthesizes code for a mobile application to make use of native resources on one platform, based on the equivalent program transformations performed on another platform. First, the programmer modifies a mobile application's Android version to make use of some native resource, with a plugin capturing code changes. Based on the changes, the system then parameterizes a web search query over popular programming resources (e.g., Google Code, StackOverflow, etc.), to discover equivalent iOS code blocks with the closest similarity to the programmer-written Android code. The discovered iOS code block is then presented to the programmer as an automatically synthesized Swift source file to further fine-tune and subsequently integrate in the mobile application's iOS version. Our evaluation, enhancing mobile applications to make use of common native resources, shows that the presented approach can correctly synthesize more than 86% of Swift code for the subject applications' iOS versions.
- A. Bacchelli, L. Ponzanelli, and M. Lanza. Harnessing stack overflow for the IDE. In Proceedings of the Third International Workshop on Recommendation Systems for Software Engineering, RSSE ’12, pages 26–30. IEEE Press, 2012. Google Scholar
Digital Library
- S. Bajracharya, J. Ossher, and C. Lopes. Sourcerer: An internet-scale software repository. In Proceedings of the 2009 ICSE Workshop on Search-Driven Development-Users, Infrastructure, Tools and Evaluation, SUITE ’09, pages 1–4. IEEE Computer Society, 2009.. Google Scholar
Digital Library
- L. Breiman. Bagging predictors. Machine Learning, 24(2):123–140, 1996. ISSN 0885-6125.. Google Scholar
Digital Library
- F. P. Brooks. No silver bullet: Essence and accidents of software engineering. Computer, 20(4):10–19, apr 1987. Google Scholar
Digital Library
- R. Ghatol and Y. Patel. Beginning PhoneGap: Mobile Web Framework for JavaScript and HTML5. 2012. Google Scholar
Digital Library
- R. Holmes and G. C. Murphy. Using structural context to recommend source code examples. In Proceedings of the 27th International Conference on Software Engineering, ICSE ’05, pages 117–125. ACM, 2005.. Google Scholar
Digital Library
- J2ObjC.org. J2objc, 2015.Google Scholar
- P. Jackson and I. Moulinier. Natural language processing for online applications. Text retrieval, extraction and categorization, volume 5 of Natural Language Processing. Benjamins, 2002.Google Scholar
Cross Ref
- J. Kim, S. Lee, S.-w. Hwang, and S. Kim. Towards an intelligent code search engine. 2010.Google Scholar
- L. Ponzanelli, A. Bacchelli, and M. Lanza. Seahawk: Stack Overflow in the IDE. In Proceedings of the 2013 International Conference on Software Engineering, pages 1295–1298. IEEE, 2013. Google Scholar
Digital Library
- L. Ponzanelli, G. Bavota, M. Di Penta, R. Oliveto, and M. Lanza. Mining stackoverflow to turn the ide into a self-confident programming prompter. In Proceedings of the 11th Working Conference on Mining Software Repositories, MSR 2014, pages 102–111. ACM, 2014.. Google Scholar
Digital Library
- L. Ponzanelli, G. Bavota, M. D. Penta, R. Oliveto, and M. Lanza. Prompter: A self-confident recommender system. In Proceedings of the 2014 IEEE International Conference on Software Maintenance and Evolution, ICSME ’14, pages 577–580. IEEE Computer Society, 2014.. Google Scholar
Digital Library
- A. Puder and O. Antebi. Cross-compiling android applications to ios and windows phone 7. Mob. Netw. Appl., 18(1):3–21, Feb. 2013. ISSN 1383-469X.. Google Scholar
Digital Library
- M. Robillard, R. Walker, and T. Zimmermann. Recommendation systems for software engineering. Software, IEEE, 27(4):80–86, July 2010.. Google Scholar
Digital Library
- M. P. Robillard, W. Maalej, R. J. Walker, and T. Zimmermann, editors. Recommendation Systems in Software Engineering. Springer, 2014.. Google Scholar
Digital Library
- G. Salton, A. Wong, and C. S. Yang. A vector space model for automatic indexing. Commun. ACM, 18(11):613–620, Nov. 1975. ISSN 0001-0782.. Google Scholar
Digital Library
- StackOverflow.com. Stack overflow, 2015.Google Scholar
- StackOverflow.com. Usage of /info - stack exchange api, 2015.Google Scholar
- StackOverflow.com. Stack overflow developer survey 2015, 2015.Google Scholar
- W. Takuya and H. Masuhara. A spontaneous code recommendation tool based on associative search. In Proceedings of the 3rd International Workshop on Search-Driven Development: Users, Infrastructure, Tools, and Evaluation, SUITE ’11, pages 17–20, 2011.. Google Scholar
Digital Library
- B. Vasilescu, V. Filkov, and A. Serebrenik. Stackoverflow and github: Associations between software development and crowdsourced knowledge. In Social Computing (SocialCom), 2013 International Conference on, pages 188–195, Sept 2013.. Google Scholar
Digital Library
- www.tiobe.com. Usage of tiobe language use statistics, 2015.Google Scholar
- A. Zagalsky, O. Barzilay, and A. Yehudai. Example overflow: Using social media for code recommendation. In Recommendation Systems for Software Engineering (RSSE), 2012 Third International Workshop on, pages 38–42, June 2012.. Google Scholar
Digital Library
- H. Zhong, S. Thummalapenta, T. Xie, L. Zhang, and Q. Wang. Mining api mapping for language migration. In Proceedings of the 32Nd ACM/IEEE International Conference on Software Engineering - Volume 1, ICSE ’10, pages 195–204. ACM, 2010.. Google Scholar
Digital Library
Index Terms
Native-2-native: automated cross-platform code synthesis from web-based programming resources
Recommendations
Cross-Compiling Android Applications to iOS and Windows Phone 7
Android is currently leading the smartphone segment in terms of market share since its introduction in 2007. Android applications are written in Java using an API designed for mobile apps. Other smartphone platforms, such as Apple's iOS or Microsoft's ...
Native-2-native: automated cross-platform code synthesis from web-based programming resources
GPCE 2015: Proceedings of the 2015 ACM SIGPLAN International Conference on Generative Programming: Concepts and ExperiencesFor maximal market penetration, popular mobile applications are typically supported on all major platforms, including Android and iOS. Despite the vast differences in the look-and-feel of major mobile platforms, applications running on these platforms ...
Beyond web/native/hybrid: a new taxonomy for mobile app development
MOBILESoft '18: Proceedings of the 5th International Conference on Mobile Software Engineering and SystemsCurrently, mobile operating systems are dominated by the duopoly of iOS and Android. App projects that intend to reach a high number of customers need to target these two platforms foremost. However, iOS and Android do not have an officially supported ...






Comments