described in the previous section, generates a full
working prototype supporting the model-based
navigation metaphor exploited in this paper.
Figure 8 presents the architecture of
JUSE4Android. The visitor pattern was used in the
code generator component. The link to the source
code will be made available in the camera-ready
version of this paper.
5 VALIDATION/ RELATED
WORK
5.1 Related Work
Some related generative tools for Android exist.
Basic4Android (Uziel) and App Inventor (MIT)
follow a “visual programming” style. These are not
model-driven tools and, in both cases, developing an
app for a moderate sized domain would require a lot
of effort. In our case, for an available model, the
effort is very small, since it will mainly consist in
defining a few annotations.
A closer related work, since it is also model-
driven, can be found in (Parada and Brisolara, 2012).
The input model is expressed through a UML class
diagram and sequence diagrams, thus encompassing
an increased modelling effort. The generation
process itself requires advanced Android knowledge
(i.e. the input for generation is not a plain PIM like
in our case). A similar approach, suffering similar
drawbacks, can be found in (Kraemer, 2011).
Last, but not the least, we have the IBM Rational
Rhapsody (IBM) (D. Holstein, 2011) that presents
itself as a complete model-driven solution for
generating Android apps. However, in order to
properly generate an app, every detail must be
specified, making the code generation almost a
mapping 1-to-1, thus encompassing a strong burden
on the developer’s side.
5.2 Case Study
We present herein our preliminary validation effort
based on a case study – the Projects World project
(Figure 1). Even for such a moderate small sized
model, the output is considerably large, in both
number of files and code length, even when applying
the aforementioned code reuse techniques. In Table
3 is shown our tool full generative capabilities, i.e.
besides outside the scope of this paper the tool also
generates other layers with the exact same model. If
this source code were produced manually, it would
certainly corroborate the “time-consuming app
creation problem” that we referred to in the
introduction (Parada and Brisolara, 2012).
Table 3: Code generated for the Projects World exemple.
Layer Type Files LOC
Business Layer(Model)
Java 17 4517
Control Layer (View-
Model)
Java 4 420
Presentation Layer (View
and View-Model)
XML
Java
117
28
3345
8365
Persistency Layer
Java 1 230
It is worth mentioning that more than two thirds
of the source code relates to the presentation layer,
this is mainly due to the need of supporting a
considerable range of screen sizes and resolutions
for both orientations that characterize the multiple
mobile devices that run Android nowadays. Without
adequate code generation facilities like the one we
presented herein, Android app programmers face
“massive” code development.
Our goal to support different screens sizes and
two different layouts (one pane for smart phones and
two panes for tablets), both following the Master-
Detail Flow, was met. Finally, by implementing
proven techniques, namely by the usage of the
default_layout_styles.xml and pane_decider.xml files
separately, we provide an independent and feasible
way to change resolutions, sizes and layouts to more
specific goals outside the presented standard scope.
6 CONCLUSIONS & FUTURE
WORK
On this paper we presented our GUI generation
principles and navigability approach, aiming at
producing BIS apps. We do not require the
description of every possible scenario to generate a
lot of screen sizes for both orientations and different
devices running Android. We have shown how
easily we can change one view for all possible
configurations, based upon a UML class diagram
and a template, thus avoiding “massive” code
development.
Our MVVM-based architecture grants a
separation of concerns that increases maintainability,
namely by granting a “strong separation between
data, behavior, and presentation, making it easier to
control the chaos that is software development”
(Smith, 2009).
We could not find any related work applying
MVVM in the context of Android. Our architecture
seems to be a good choice by comparison to other
MODELSWARD2014-InternationalConferenceonModel-DrivenEngineeringandSoftwareDevelopment
406