Android first

The story of eule started when Wellevo was launching its own original Wellevo wellness app to the public. The company had invested considerable amount of effort in application development to create a well-being app which would help people towards healthier living choices and diet. The business logic itself consisted of over 15000 lines of heavily object-oriented java code that handles complex calculations including calories, nutrition contents and excercise plans. In addition it had an attractive UI consisting of over 12 activities, 25 dialogs, 78 xml layouts and custom drawing components.

Next step was iOS

All this was now was a standard Android app that had taken over a year to implement. Close to being released it became clear that in order to succeed in the market, it simply must be published to other platforms also, mainly for iPhone. But the company was in no situation t0 afford to invest in another app development cycle, or wait many months for it to finish.

Teemu had been studying cross-platform solutions for years and knew there was no shortcuts. The obvious options were either to start development in native iPhone environment or go for cross-platform solution like PhoneGap. Given that the Android app already existed, both of these options had the same fundamental problem: it all had to be redone. No matter if you had a design to follow, software development would still be slow and error prone.

Re-using the business logic first

Having no choice but to try, Teemu wanted to check if at least the business logic (15 000 lines of code) could be reused. He found a way to cross-compile it from Java to Javascript and created the necessary Android-like classes around the code so it could run in javascript environment without making major changes to the math or class structure. Surprisingly it worked. This would already enable the business logic to be used embedded in web UI. This was actually done, and the web UI of the application now uses this code to do the same math as the Android app. Whenever calculations are updated, it is a simple matter of recompilation to bring them to the web.

Next step was to re-use the UI

Next step would be to create a cross-platform app that uses the business logic and implements app functionality with HTML/Javascript so it could be delivered for iPhone. At this point Teemu had an idea that what if some of the UI code also be reused? Very well knowing how massive the Android UI framework is, the idea to emulate all of it did not seem very realistic. But what the heck, let’s see how it would work if it could.

So he created a HTML page with javascript code that dynamically creates HTML elements following the original Android XML layouts. If he could even do that, then the rest would be quicker to make. Surprisingly it worked better than expected. After writing some heavy javascript code to emulate in HTML the exact way how Android View class and layout inflation actually works, the UI actually became visible. Rather than re-coding the actual functionality the way the original Android app makes it, it started to be easier just to write some supporting code to run the original code in the new environment.

Solving one problem after another, eventually the whole app was ported to javascript and later released to the Apple store. The company had saved months of coding effort.

Making eule automatic

Since the supporting code that enables all this had been written as separate library from the beginning, the obvious opportunity now was if the process could be repeated for other apps also. After some refactoring and cleaning up app-specific code away, Wellevo suddenly had a tool to cross-compile any app from Android to iPhone (or the web). The first apps of course used some Android classes that were not used at all in Wellevo’s app, but quickly the coverage was extended and soon it became clear which parts were most used by apps. In time, the tool became more automatic and required less and less manual work and shortened the required time schedule even more.

 

What had been a far fetched idea in the beginning became a working solution!

Now our tool is available for everyone. Easy, Cost-efficient and fast. Ask us for a quote!

 

Interested?

Top