23. Xactware
Customers
Want
Mobile
• We
tried
mobile
a
few
Omes…
– Apple
Newton
– Windows
Mobile
– XP
Tablet
EdiOon
– Blackberry
– iOS
(naOve
objecOve
C)
• Too
much
overhead
and
customer
maintenance
• Finally
a
shared
iOS
and
Android
version
24. User’s
Mobile
Experience
• Why
do
they
want
a
mobile
soluOon?
• What
makes
sense?
• Don’t
try
to
include
everything
• Desktop
applicaOon
without
a
mouse
and
keyboard.
25. Mobile
Devices
• Keeping
up
with
new
devices
• FragmentaOon
• When
to
force
an
upgrade
of
hardware
• Internal
tesOng
device
budget
26. Why
We
Chose
1. UOlize
exisOng,
complex
codebase
2. Same
calculaOons
across
plaiorms
3. Speed
of
deployment
4. .NET
developer
recruitment
5. TransiOon
and
training
of
developers
6. RelaOonship
with
Xamarin
29. How
We
Started
• Created
a
new
mobile
soluOon
– Learned
later
on
we
needed
2
soluOons
• One
for
each
plaiorm
Android
and
iOS
– Xamarin.iOS
libraries
are
not
compaOble
on
Android
– Decided
what
assemblies
we
needed.
– Started
adding
empty
projects
and
then
adding
in
files
to
them
and
compiling
– Added
needed
references
and
dependent
assemblies
and
classes
– Got
everything
compiling
as
a
first
step,
nothing
visual
yet.
30. Project
Structure
• We
created
two
soluOons
– iOS
and
Android
– Custom
build
commands
to
replace
the
AndroidManifest.xml
to
have
to
separate
package
names
31. Sketch
Interface
ImplementaMon
• Created
a
test
setup
environment
for
our
Sketch
applicaOon
• Implemented
Drawing
class
for
sketch
• Used
mouse
click
events
and
connected
to
touch
events
and
touched
the
screen
– Jumped
up
and
down
in
excitement
because
20
years
of
code
was
now
running
on
iOS
and
android
32. iOS
CompilaMon
• Edge
Cases:
– Assembly
size
–
We
ran
into
a
case
where
we
could
not
compile
an
assembly
because
we
exceeded
the
gcc
limit
–
we
had
to
split
the
assembly.
33. Memory
Management
• Windows
Desktop
applicaOons
don’t
worry
about
memory
like
you
need
to
on
Mobile
devices.
This
is
a
large
concern
porOng
huge
code
bases
to
mobile
– Events
• Must
release
them.
+=
must
be
followed
with
-‐=,
this
will
kill
you
• NaOve
Controls
–
iOS
–
UITextView
and
all
naOve
controls,
you
must
dispose
them
explicitly.
34. 2
GC
Systems
on
Android
• Use
structs
instead
of
classes
when
your
system
is
allocaOng
thousands
of
objects
per
second.
The
GC
can’t
keep
up
35. GC
on
iOS
• We
had
to
explicitly
call
collect
in
a
few
cases
to
keep
performance
up
• We
had
to
increase
the
number
of
trampolines
• Mixed
library
using
naOve
objecOve
c
librarys
are
really
hard
to
debug,
Just
don’t
do
it
unless
you
have
to.
36. Preprocess
DirecMves
• We
had
to
use
liberal
amounts
of
#if
!MONO
throughout
the
code
base
to
remove
non
.net
pieces
of
our
desktop
applicaOon
37. Lucene
• It
overflows
on
purpose
–
Change
the
compiler
to
not
care
about
overflows
otherwise
it
will
crash
randomly
in
places
that
do
not
make
any
sense.
Total
garbage
call
stacks.