Similar apps with similar code and one project

General Tech Bugs & Fixes 3 years ago

4.56K 2 0 0 0

User submissions are the sole responsibility of contributors, with TuteeHUB disclaiming liability for accuracy, copyrights, or consequences of use; content is for informational purposes only and not professional advice.

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 3 years ago

Hi and first of all thanks in advance, i have a question related with project structure.

Imagine the following situation: we have 4 apps with mainly the same functionality. Let's call them A, B, C and D. Everyone is build natively in Swift/Objective-C. We can assume that almost 85% of the code is the same between A, B, C and D. The same for resources but probably with a lower percentage.

What I have now is one git project with with at least 4 branches (one for each of the apps). When I develop a new feature in app A, I use git checkout --patch A  to bring the changes I'm interested to the other apps. The process is slow since i have to do the same 3 things to bring changes to all the other 3 branches. Imagine that Swift version inside the app is upgraded and almost all the files need to be updated... It would be better than to do the same 4 times, but still slow.

Is there an optimal to way to handle this? In iOS, since the package name is not related with the name of the folders where code files are located, this is indeed an option (slow, but an option), but how to achieve this in Android? The same Activity with almost the same code is located in two different paths (com.company.A.Activiy and com.company.B.Activiy) between branch A and B, so checkout --patch does not work. Any solutions? Any optimal way?

0 views
0 shares

profilepic.png
manpreet 3 years ago

For that scenario, I would extract out the core of the application, which would be identical for all of the projects">projects into it's own library project, then reference that library in each of the 4 projects">projects. Any changes in that library simply requires a recompile in the 4 UI projects">projects.


0 views   0 shares

No matter what stage you're at in your education or career, TuteeHUB will help you reach the next level that you're aiming for. Simply,Choose a subject/topic and get started in self-paced practice sessions to improve your knowledge and scores.

Similar Forum