S
S
Sergey Sulakov2016-02-11 10:23:53
Java
Sergey Sulakov, 2016-02-11 10:23:53

Is it possible to separately write the software part in java and separately "layout" in Android?

You need to write an application on Android, is it possible to immediately write the software part in java (calculations, logic), and then "pull it into layout" on Android?
Or is it better to do everything together?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
S
svd71, 2016-02-11
@svd71

You can listen to a bunch of tips on how it is more convenient to turn a Java framework into functional programming for Windows, but it’s better not to do this.
Your reasoning is very correct and correct: the business logic of any application should be separated from the design. Then any change in the design will not lead to changes in the business logic. Moreover, in Java this is not easy, but very simple.
You create classes with business logic, you can add testunits as an option to check the normal functioning of this logic. Debugging can be done even in the console. After that, you can attach any graphic research to the created objects.

V
VZVZ, 2016-02-11
@VZVZ

Not really, there are a lot of specific things on Android, these are things like an API for sending SMS, and code-behind for the same layout.
But let's say a library for working with Excel, Word, other file formats, a convenient library for working with a network - it can be compatible with android, and at the linking stage (jar nickname can be added to the project), and at runtime (if not specific things and some other conditions are met, for example, apk cannot be too large in size)
And in any case, an abstraction is possible and highly desirable, so that there is a framework with wrapper classes for literally everything.
Let's say on Windows desktop writing under the bare OS API is a nightmare for any developer. And for some reason, on android, in the order of things - with all the consequences.
Even Toast on android is poor and one-sided:
Toast.makeText(this, "Hello", 500).show();
Agree, it would be much better if it were possible like this:
MessageBox.show("Hello");
And for this you just need to write a wrapper class named MessageBox

D
Deadkenny, 2016-02-11
@Deadkenny

MVP fits perfectly on Android. Divide everything into views (showProgress, showContent, etc.), views (communication with the interface, business logic) and models.
Describe the display as an interface, which is then connected to a real interface, and you can describe and test the views and model without an interface.
antonionoleiva.com/mvp-android

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question