How to merge two apps as a one app [on hold]

I know this question have been asked before but the answer still doesn’t satisfy my hunger for knowledge. I want to merge two apps as a one app. let’s say include B(app) in A(app) yes I know that I can import one as a library but what to do next is the reason of my question.

  • Manifest file: To make one apk I need one manifest file, so how can I merge two manifest files and should I delete the B one and copy its information in the A one?
  • .Java: Should I change their directory and place them with th A ones?

    and of course the same question goes for Ressources.

Right now it’s all a mess in my head and I would like a clear answer so generations of people can benefit from this question. Thank you !