Similar apps with similar code and one project

General Tech Bugs & Fixes 2 years ago

0 2 0 0 0 tuteeHUB earn credit +10 pts

5 Star Rating 1 Rating

Posted on 16 Aug 2022, this text provides information on Bugs & Fixes related to General Tech. Please note that while accuracy is prioritized, the data presented might not be entirely correct or up-to-date. This information is offered for general knowledge and informational purposes only, and should not be considered as a substitute for professional advice.

Take Quiz To Earn Credits!

Turn Your Knowledge into Earnings.

tuteehub_quiz

Answers (2)

Post Answer
profilepic.png
manpreet Tuteehub forum best answer Best Answer 2 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?

profilepic.png
manpreet 2 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.