software/app for PC and mobile device
-
Hello,
We plan to use Qt and QML/Quick to make a new software for a computer (Windows/MacOS).
We would like also to make a version of this software for a tablet (Android/Ios).The UI of the PC software will fit in a small size screen (10"), and we will use touch/mouse compatible gadgets. So there should be no big problems to adapt the UI for tablets, with the same (or almost the same) source code.
But, we do not know about the other parts (system files, ...).
(our experience about mobile devices development is very limited)Could you please tell us how the developers, who want to code for both platforms, usually do for that ?
Could it be possible to use the same source code for both computer and mobile devices, with an acceptable number of computer/mobile OS tests in the code ?
Or is it wiser to just keep the UI code for both platforms, and then make two separate source code projects (one for computers and one for mobile devices) ?
Any link regarding this may be welcome as well.
Thank you in advance for your help.
-
Hi and welcome to devnet,
What do you plan to do filesystem wise ?
You essentially have to check what your application will do differently on mobile VS desktop. If exactly the same then there's no need for two different code bases. If slightly different, then again, there's usually no need to split the code base. You take the differences into account using e.g.
#ifdefs
. If the difference are bigger, well, you can do like Qt and have dedicated implementation that you only build when the build targets the platform the code is supposed to run on. -
Thank you for your answer.
The software will just have to open/save/save_as files.
(no system files ; sorry for that mistake)It will use also multi-threads with computers (not sure this is possible with mobile devices).
Would it be possible to know some examples of software/app which have one source code project (with an acceptable quantity of "#ifdefs" commands) and an executable file available for both computer and mobile device ?
-
For managing files you have classes like QStandardPaths that will return the folders which you can access. Currently access to filesystem on mobile OSs have improved but you may have to write some native code to access them.
You can check Qt's own code and examples. You can also find the dedicated QtXXXExtras where XXX is the name of the platform. For example: QtMacExtras, QtAndroidExtras, etc.