DEV Community

loading...

A small experiment

Daniel Coturel
Java and PHP programmer.
・2 min read

Hi,
This week I've decided to make a personal experiment. I've been developing for Android for a couple of years, always based on Java native code. That's because I've worked with Java for a lot of previous years.
But last year I've taken some interest in JavaScript, since I'm not strong at it.
The experiment was:

Step 1: Think of a simple Android app
Step 2: Develop that app with my libs and Java code
Step 3: Develop that app with some of the, then unknown for me, tools that use JavaScript code and build native apps.
Step 4: Think about it.

So I thought about an app that allows the user to:
1) Define a subject to collect data. This subject, resembling to a dashboard indicator, has:
a) A name
b) A symbol for the value. For instance, U$S is the symbol for the United States Dollar
2) View the list of values of the indicator
3) Add a new value. The value has a timestamp

So, the app has basically two entities, stored in a local SQLite database.

The app was to be built using the basic templates for each tool, nothing else. And in Java I had the advantage of having a lot of boilerplate code already used in other projects.

Java Android App

This are the screens for the first app I coded, using my well-known method:

List of indicators

drawing

Values of an indicator

drawing

Add new value to an indicator

drawing

Javascript Nativescript app

List of indicators

drawing

Values of an indicator (and includes add)

drawing

Conclusions

1) It took me less time to build the NativeScript app than the Java app. That's something important considering it was my first approach to NativeScript and not the first in Java.

2) The standard look & feel of the NativeScript app is nicer than the standard look & feel of the Java app (remember, I was just using defaults)

3) The NativeScript app has good performance

4) The Java app has a total size of 3,86 MB. The NativeScript app has 29,71 MB

5) The difference in lines of code is abysmal

6) The NativeScript app can be built to iOS, the Java app can't

So, is there any reason to keep producing Java Android apps? What do you people think?

Saludos,

Discussion (0)

Forem Open with the Forem app