use of languages in android applications

43
Use of Languages in Android Applications Asan Urazimanov 27 November 2018 Software Composition Seminar University of Bern

Upload: others

Post on 15-Oct-2021

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Use of Languages in Android Applications

Use of Languages in Android Applications

Asan Urazimanov

27 November 2018 Software Composition Seminar

University of Bern

Page 2: Use of Languages in Android Applications

RELEVANCE

2

Android smartphone market share > 85%

Used for sensitive applications(e-banking, healthcare, etc.)

Languages influence app development

Page 3: Use of Languages in Android Applications

MOTIVATION

IMPROVING CODE QUALITY

Problems may arise due to the use of complex languages, or their improper integration

Support of practical use

3

LEVERAGING INFORMATION

Not much information is available about the use of languages

"Missing generalization” of languages in Android development

Page 4: Use of Languages in Android Applications

ASSESSMENT TOOL

cloc

4

github.com/AlDanial/cloc v 1.76 T=0.10 s (667.6 files/s, 57257.8 lines/s)

--------------------------------------------------------------------------------------------------

Language files blank comment code

--------------------------------------------------------------------------------------------------

Java 23 442 478 2262

XML 40 221 564 1736

Groovy 3 10 49 47

Markdown 1 24 0 42

YAML 1 5 7 14

ProGuard 1 2 15 0

--------------------------------------------------------------------------------------------------

SUM: 69 704 1113 4101

--------------------------------------------------------------------------------------------------

Page 5: Use of Languages in Android Applications

StructureFile structures used in projects

5

Page 6: Use of Languages in Android Applications

STRUCTURE

6

Page 7: Use of Languages in Android Applications

STRUCTURE

7

Page 8: Use of Languages in Android Applications

STRUCTURE

8

Page 9: Use of Languages in Android Applications

STRUCTURE

9

Page 10: Use of Languages in Android Applications

STRUCTURE

10

Page 11: Use of Languages in Android Applications

BUILD TOOLSFeatures and differences

11

Page 12: Use of Languages in Android Applications

BUILD TASKS

12

Dependency resolution

CleansingCompilation

and build

Dependencies: JUnit, Hamcrest

Page 13: Use of Languages in Android Applications

ANT

Ivy dependencies specified in ivy.xml

13

ivy.xml

build.xml build script

Page 14: Use of Languages in Android Applications

MAVEN

14

Compiles project by using parameterspom.xml (main config)

pom.xml (supplemental config) Plugins

Page 15: Use of Languages in Android Applications

GRADLE

15

Custom DSL based on Groovy build.gradle

Page 16: Use of Languages in Android Applications

LINES OF CODE

16

ANT

GRADLE

MAVEN

9

72

35

Page 17: Use of Languages in Android Applications

BUILD TOOLS OVERVIEW

Ant

Full control over the build process.

Build scripts use XML.

Maven

Flexibility.

Strictly structured, highly standardized.

Complicated.

Gradle

Provides all features.

More intuitive and shorterbuild scripts.

17

Page 18: Use of Languages in Android Applications

PROGUARD

18

Optimization ObfuscationShrinkage

Page 19: Use of Languages in Android Applications

PROGUARD

19

100%

80%

60%

40%

20%

0%

5 76 9+8

software languages

usag

e

Page 20: Use of Languages in Android Applications

LANGUAGESFeatures and differences

20

Page 21: Use of Languages in Android Applications

Want big impact?USE BIG IMAGE

21

Page 22: Use of Languages in Android Applications

XML

Language package(s)

22

Design

Single language Multi-language

Page 23: Use of Languages in Android Applications

JAVAwell-established language

KOTLINnew programming language

23

less lines of code

data classes

null safety

Page 24: Use of Languages in Android Applications

BUILD TIME DIFFERENCE

Without Gradle With Gradle

JAVA 10.82 9.17

KOTLIN 13.12 11.44

24

22% 13%

[s]

Page 25: Use of Languages in Android Applications

LANGUAGE USAGE

25

0%

5%

10%

15%

20%

25%

30%

HTML C C++ Python JavaScript Ruby PHP C# Other

Page 26: Use of Languages in Android Applications

LANGUAGE USAGE

26

0%

5%

10%

15%

20%

25%

30%

HTML C C++ Python JavaScript Ruby PHP C# Other

Page 27: Use of Languages in Android Applications

Why Python?

27

Startup speedLack of

native look

APK size

Page 28: Use of Languages in Android Applications

AMAZING DISCOVERIES

28

Page 29: Use of Languages in Android Applications

STRUCTURE

29

# 1

Page 30: Use of Languages in Android Applications

STRUCTURE

30

Page 31: Use of Languages in Android Applications

31

Page 32: Use of Languages in Android Applications

32

Page 33: Use of Languages in Android Applications

STRUCTURE

33

# 2

Page 34: Use of Languages in Android Applications

9,526,124$

100%

185,244 users

34

Page 35: Use of Languages in Android Applications

STRUCTURE

35

# 3

Page 36: Use of Languages in Android Applications

36

Page 37: Use of Languages in Android Applications

37

Page 38: Use of Languages in Android Applications

STRUCTURE

38

# 4

Page 39: Use of Languages in Android Applications

“ I’ve wanted to be able to run Smalltalk on Android and iOS for many years. I finally decided to do something about it.

3939

Page 40: Use of Languages in Android Applications

STRUCTURE

40

# 5

Page 41: Use of Languages in Android Applications

FORTRAN

41

HEY

Page 42: Use of Languages in Android Applications

OUTLOOK

42

Security Investigation

100%

Automatization

Page 43: Use of Languages in Android Applications

SUMMARY

Structure

no consistent implementation of best practices

Build Tools

many projects lack proper useof build tools

Languages

diverse use of languages complicatesapplication maintenance

43