V
V
vladimirice2014-03-25 22:51:55
PHP
vladimirice, 2014-03-25 22:51:55

Android Java application and web service with php back-end. Duplication?

Hello! Thank you, Reader of my post, for the fact that you exist and gave him your precious attention!

There is a web service with a PHP back-end that provides some client services.
You need to write an Android application. Its capabilities, in comparison with the web service, will be curtailed. This application is not a wrapper for communicating with a web server, but a full-fledged (albeit stripped down) standalone application that duplicates a web service.
Let's say you decide to write an Android application in Java.
The web service is dynamically developing, i.e. the back-end code is constantly changing.
Do I understand correctly that in such conditions there is the following significant problem:
The Java code of an Android application is a duplication of PHP code, with all the unpleasant consequences that follow. Those. the back-end of the server will have to be constantly rewritten in Java.
How to solve this problem? Write an Android application in PHP using the appropriate toolkit?
In my opinion, the ideal option for writing an Android application in such conditions is to take server php code, truncate it according to certain algorithms (reduce capabilities) and transfer it to Android. If the back-end changes, then the pieces of the changed code are synchronized with the Android application code.
The same question concerns the front-end written in JS, HTML, CSS. Can it be transferred according to the above strategy?
Colleagues! Please constructively criticize everything that I have written here =)

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Stepan, 2014-03-26
@L3n1n

Move the logic to the rest api, and write the web / app under the rest :)

S
Sergey, 2014-03-25
Protko @Fesor

Writing an Android application using PHP is somehow not convenient and stupid. Of course, you can look towards the recently appeared JPHP, with which, in theory, you can integrate php code into a java application, but the project is still raw, and the attempt itself raises doubts.
In fact, yes, without duplication in your case, in any way. There is still a real option to implement the server in java, and move the common parts into libraries.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question