Native to Native Mobile Code Conversion Service

Kamal YOUBI
7 min readJan 20, 2016

Introducing a new way for converting native mobile applications across other mobile platforms without the need to redevelop. Based on semantic driven code conversion and model driven software engineering,

MyAppConverter is positioned as a new way for developers to develop once their mobile applications onto their favourite platform and publish the mobile app to the other platform by converting the initial source native code to the target native code. This article introduces How MyAppConverter work, the initial scope of the private beta and the future roadmap.

1. Introduction

The race in the mobile industry in order to capture and retain the maximum of mobile users worldwide force big players to ring fence the entire mobile eco-system. When it comes to developing mobile applications, it is getting even worse. Indeed, mobile applications, especially the successful ones need to be developed for more than one operating systems. Therefore, the language lock-in for developing mobiles apps makes developers sticking to one or two platforms max.

2. Native Development Platforms versus other platforms.

When it comes to developing mobile applications, most developers still prefer native platforms compared to other platforms, such as HTML5. Although there are still a lot of hybrid app developers, the overall proportion of developers using HTML5 on mobile devices is falling, both through those switching to native code and new entrants adopting native platforms [1].

Advantages for developing mobile application in native mode are clear:

  • Maximum Performance
  • Full access to the smartphone functionalities, features and resources
  • Best user experience

The quest and belief: “Write once, and run everywhere” is still alive and kicking. Hence the Cross Platform (CP) tools and systems have been flourishing to achieve that goal. The latest benchmarking on Cross-Platforms (CP) tools made by Research2guidance [2] has shown there is more than 150 cross-platforms tools falling mainly in 5 categories: App Factories, Web App Toolkits, Cross-Platform Integrated Development Environments Enterprise, CP Compilers and CP Services.

This alone is a proof that mobile developers have desire to overcome the mobile software and hardware fragmentation, but not at the expenses of their developments needs and expectations. It is clear that the majority of the CP tools out there in the market are some strong limitations and some compromises have to be made in order today to be able to develop and ship mobile applications across multiple platforms. Some of the inconvenient are:

· Need to learn a new framework and technologies

· Download of a specific & proprietary SDK

· Limited features compared to native development

· Loss of User Experience

In summary, native mobile application development remains the best choice for mobile developers irrespective of the mobile development platform whether it is iOS, Android, Windows Phone, or others. Despite the huge number of CP tools, developers don’t feel like the porting of mobile applications is a solved issue.

3. Introducing MyAppConverter

3.1 Introduction

Unlike current cross Platform tools, MyAppConverter makes transforming/porting mobile applications through diverse mobile operating systems and smartphone possible through its powerful core engine that extracts the knowledge from a mobile application and then successfully projects it into a ready-to-use mobile application for a different OS.

MyAppConverter can be both used by developers as a plug-in on their preferred IDE and by a wider range user through a software as a service on the web hiding the complexity of the reverse and forward engineering process and turning it into a simple input and output conversion with intuitive user experience.

MyAppConverter is a conversion service based on model driven engineering technics and specifications. Using meta model driven reverse engineering and model transformation as knowledge for its mappings, it’s transformation engine implements an established OMG (Object Management Group) standard specifications.

3.2. How does MyAppConverter work?

MyAppConverter conversion process allow developers to spare the load to rewrite and reproduce all the functional logic of the code, and produce out of it an understandable, evolutionary code which reflects the same functioning and the same logic execution from the source platform to the target platform.

This conversion mechanism focuses on the approach of reverse engineering [1]: the process of analysing the business logic of an application specific to a given platform can be translated and reformulated in an efficient manner. This process includes automatic analysis of the existing code, reverse engineering of abstract high-level models, model transformation to target platform models and code generation.

The semantic Driven Analysis is based on Graph manipulation over the reversed application. Specific applications in a platform are considered as an instance of meta-models through several instances (roughly abstract) forms. These instances are usually anchored by tags / annotations which are specific to each platform.

The reverse process from source platform to target platform porting takes place through four distinct phases: Discovery, Extraction, Transformation and Projection.

Fig. 1. Reverse engineering graph based process

The first step is the discovery of the code of the source application, to build a specific models PSM. This step can be divided into two stages: first, provide an abstract syntax tree AST from the code. This AST is transformed as a graph model according to a meta-model of the source language (ex supported languages in iOS platform: C, C++, Objective-C, Objective-C++, Swift). During the second stage, we build another graph model specific PSM to the physical structure of the source application. this second graph model will be also conforming to a physical meta-model of the source platform.

The second step called Extraction uses a set of specific filters to identify semantic elements from the two models

(physical and technological). The role of this step is to abstract high-level views from the two models to build a semantic graph model PIM that conforms to a meta-model of a generic mobile application [9].

The third step is the transformation of the semantic model graph into a platform specific model of the target application. This step uses a set of node rules to link each node in the source graph model with its corresponding in the target graph model. At this stage, it is important to mention that we should provide a Knowledge Base: a technological repository that match third party libraries in source platform with its corresponding in the target platform. The Knowledge Base will be explained in detail in a future work.

The last step called projection aims to generate the source code of the target application (android project, java source) from the platform specific graph model. To implement this step, we match each node in the model graph with the appropriate template according to the release version of the target platform. So we define three kind of templates: the first one is specific to the target language (java, c++) , the second specific to the application project structure (Eclipse, Android Studio) and the last one specific to the release version of the target platform (android 4.2, android 4.4, …)

The figure 2 represents a high level description of the conversion of a native iOS mobile application to native Android as an example.

1. The developer uploads his source code project

2. The code is then analysed in terms if coherence and integrity.

3. Extraction of the structuring code elements:

- Algorithmic

- Semantic

- Static Resources (image, video…)

- Technological resources (Frameworks used, functionalities,…)

4. The source code is extracted and fits into a pre-defined model which itself is conform to a meta-model describing all elements such as a mobile operating system, a mobile application, a mobile project, framework, etc…

5. Target code generation: this is the final step in the overall conversion process that allows the converted project native code to for the given target OS and device.

The code generation is based on semantic driven code transformation and model driven engineering. This implies that the mobile code is transformed in a way where the conversion algorithmic understands what the source code is doing and generates the native equivalent in the target OS. There is some academic research on Semantic Mobile Code Transformation and Model driven development [3]

Figure 3 illustrates the layered approach from technology to semantic code conversion

In the same manner that we do the technology modelling as described above, the semantic modelling is based on understanding and capturing user interaction with the given mobile application and device.

Semantic transformation techniques ensure the identical user experience within the generated application in the target environment.

4. Conclusion

Compared to current cross-platform tools in the market, MyAppConverter offers a unique and compelling proposition to mobile developers wanting to port their mobile applications to other platforms in seamless and straightforward way. The aim of MyAppConverter is to become the de-facto porting service of choice for mobile developers to develop their mobile apps to service the largest possible smart phone user audience, and this in a simple, fast and user-friendly manner with the followings benefits:

  • Native to native mobile code conversion across multiple platforms.
  • Ability to access the converted source code of the ported application
  • Accelerate the access of the mobile app across multiple stored by the largest possible audience
  • No need for developers to abandon their favourite development language, nor use/adopt a new language, restricted and opaque frameworks

--

--