The Ultimate Package Structure Guide for Android Developers

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 พ.ย. 2024

ความคิดเห็น • 108

  • @rohittp1585
    @rohittp1585 8 หลายเดือนก่อน +52

    Finally a detailed video on package structure :) Thanks Philipp!

  • @amol1608
    @amol1608 8 หลายเดือนก่อน +14

    It's awesome you are talking about these things. Even the seniors sometimes ask themselves is this approach good, and then there's your video to give more info and to see how someone like you does things. I love your videos because you always talk about different and very important things that many of the Android developers need. I didn't find anyone making Android videos this detailed and concise. Keep it up!

  • @TheMikkelet
    @TheMikkelet 8 หลายเดือนก่อน +16

    I prefer the more monolithic architecture where you have top level data/domain/presentation folders and then subfolders with files that relate. My reason being that app development can be hyper prone to chaning requirements, and needs to be super flexible with. So instead of keeping your usecase feature specific, they should be available from anywhere in the app.
    In my experience, apps that start out using feature-modules suffer from ever-changing reqs and usually end up moving more and more logic/UI from the feature module to the core module, thus invalidating any intent to modularize your app.

    • @Clarence-e6s
      @Clarence-e6s 5 หลายเดือนก่อน

      with large scale project with feature teams (about 30-50 developers) it's not good to have top level

  • @umuttekin4967
    @umuttekin4967 8 หลายเดือนก่อน +6

    I don't call this "Ultimate Guide" but it was informative. Thank you

  • @연어를좋아하는둥이
    @연어를좋아하는둥이 8 หลายเดือนก่อน +3

    The core modules that define the functions for public use will also continue to increase as the project grows in size.
    As the project size gradually increases, many functions will be located in the core module.
    And there may come a time when we have to think about further modularization of core modules.
    What do you think about this?

  • @sijanneupane
    @sijanneupane 8 หลายเดือนก่อน +5

    this was must needed! thanks, philipp!

  • @rikonikotako
    @rikonikotako 8 หลายเดือนก่อน +1

    Perfect and useful as always. Thanks Philip!
    Don't you think to create the second course of Bluetooth? I mean for BLE? It'll be very useful (:
    Thanks, have a good day!

  • @osisuper98
    @osisuper98 7 หลายเดือนก่อน +1

    I think I prefer the hybrid way - combining both layer and feature modules.

  • @geetthakur3253
    @geetthakur3253 5 หลายเดือนก่อน +1

    awesome video thanks philipp
    just one question : database initialization and apiServices we can write in core package, its allow to use all other module commonly
    is that correct?

  • @ChrisAthanas
    @ChrisAthanas 8 หลายเดือนก่อน +2

    Great explanation of a usually very confusing and aggressive conversations

  • @olegleonov1310
    @olegleonov1310 8 หลายเดือนก่อน +4

    What do you think about video with multimodal structure? With API and implementation modules, dagger 2 as di.

  • @pelealexandru
    @pelealexandru 8 หลายเดือนก่อน +2

    Another banger. Thanks Philipp.

  • @LucasSilva-jd2bf
    @LucasSilva-jd2bf 8 หลายเดือนก่อน +4

    What about features referencing each other? For instance, it makes sense for the profile feature to reference the auth feature, as it needs the User model and AuthToken. In that case, would you place these in the core model and reference it in both auth and profile?
    I like the feature-first approach, but I am never able to achieve 100% modularity since there's always a feature that ends up depending on another feature, so now I either put everything in the shared feature or I merge both features together.

    • @iAbanoubSamir
      @iAbanoubSamir 8 หลายเดือนก่อน +3

      I think anything that need to be used by more than one feature is a common or shared and need to be inside core/common module. Since feature module can not depend on another feature module.

  • @samuelwakoli
    @samuelwakoli 8 หลายเดือนก่อน +1

    Thank you sir. I have really been wanting this, and I have learnt.

  • @nrg4285
    @nrg4285 8 หลายเดือนก่อน +1

    Really needed this explanation, thanks Philipp

  • @saifulislamsajon5641
    @saifulislamsajon5641 8 หลายเดือนก่อน +3

    Philipp would you please give some of the resources as a reference from where I can actually relate the things you described in your video. Or I can take them as a reference of your video to deep dive into the architectural file folder structure. Thanks in advance.

  • @Axelfromthehudjelud
    @Axelfromthehudjelud 8 หลายเดือนก่อน

    Philipp, thanks for this video. I usually structure my domain and data layer firstly by types (models, usecases, etc.) and then inside those folders I group them by context (auth, user etc.). What do you think about this approach?

  • @Mel-bw2fn
    @Mel-bw2fn 8 หลายเดือนก่อน

    Great video Philipp
    Would it be possible to have a series of videos where you take a real world project to demonstrate each ?

  • @vsv8161
    @vsv8161 8 หลายเดือนก่อน

    Thank you so much for your videos Philipp, they are amazing
    Could you please make a video on how to create a collapsing layout?

  • @emmanuelmtera5936
    @emmanuelmtera5936 8 หลายเดือนก่อน +2

    Does this apply to ios or swiftui projects too ie when you are implementing apps in kmm

  • @TVHovna
    @TVHovna 8 หลายเดือนก่อน

    package by type at module level, then by feature - that's perfect :)

  • @memedom769
    @memedom769 8 หลายเดือนก่อน +9

    fun fact : our proffesors refrence is you😂

    • @DJOrangeJoe
      @DJOrangeJoe 8 หลายเดือนก่อน

      Then you have a good professor, as he is referring to the best.

  • @danielreinhold8475
    @danielreinhold8475 5 หลายเดือนก่อน

    Just one question: Where would a Repository (interface/abstract class AND implementation class) into this structure? I would say it should be between data and domain. What would you say?

  • @randomtalks9891
    @randomtalks9891 8 หลายเดือนก่อน +1

    Philipp, your videos are incredibly informative, and I've learned a lot from them. Keep up the fantastic work! Thanks!

  • @bensekyondwa
    @bensekyondwa 5 หลายเดือนก่อน

    This is the same package structure I have used in my latest Android project.

  • @alexandrereutola3246
    @alexandrereutola3246 8 หลายเดือนก่อน

    Will you ever make a video about the best package structure for a Ktor project?

  • @maroneda1063
    @maroneda1063 8 หลายเดือนก่อน

    Okay, I will adapt this new packaging structure 😃

  • @NovruzCəfərov-r9w
    @NovruzCəfərov-r9w 8 หลายเดือนก่อน

    Hi Philipp, thanks for these tutorials. Are you think make advanced gradle tutorial for android?

  • @Katzenmuetze
    @Katzenmuetze 8 หลายเดือนก่อน +21

    Just as an addition: This is basically domain-driven design (DDD) :)

    • @ChrisAthanas
      @ChrisAthanas 8 หลายเดือนก่อน +1

      It’s an aspect for sure, but not the only idea

    • @CriticasDeCriticas
      @CriticasDeCriticas 7 หลายเดือนก่อน

      @@ChrisAthanas What happens if I need to create a UseCase that gets it's data from repositories from 2 different features? How do you decide where to put it?

    • @joshflugel
      @joshflugel 3 หลายเดือนก่อน

      @@CriticasDeCriticasThat is explained here: 10:00

    • @justmeagain9302
      @justmeagain9302 3 หลายเดือนก่อน

      Yu-Gi-Oh reference

  • @alikazemkhanloo9514
    @alikazemkhanloo9514 8 หลายเดือนก่อน

    Now this is exactly what I wanted.

  • @ronyrodriguez4472
    @ronyrodriguez4472 2 หลายเดือนก่อน +1

    Waiting for: The "Ultimate" Multi Module Package Structure Guide for Android Developers

  • @SamandarSdk
    @SamandarSdk 8 หลายเดือนก่อน +1

    Thank you Philipp 🎉

  • @JayceedSaymonDeyro
    @JayceedSaymonDeyro 8 หลายเดือนก่อน

    Try to add a navigation module with bottom nav as an example please.

  • @robertfontaine3650
    @robertfontaine3650 8 หลายเดือนก่อน

    Couple of nice tidy ups in here.

  • @omrihz
    @omrihz 8 หลายเดือนก่อน +1

    Thanks! Very appreciated!

  • @sergeykharuk5614
    @sergeykharuk5614 7 หลายเดือนก่อน

    In a multimodule project should we also create data, domain, and presentation packages for the app module? Because the app module is actually collects all other modules together.

  • @AmitJayant
    @AmitJayant 8 หลายเดือนก่อน

    Where should the wrapper helper classes go? Like BillingHandler, GoogleLoginHandler etc.?

    • @Iphonerodesdecero
      @Iphonerodesdecero 8 หลายเดือนก่อน

      You can place these elements in a module called, for example, googleservices.

    • @mathieuperroud7423
      @mathieuperroud7423 8 หลายเดือนก่อน +1

      Considering GoogleLoginHandler, into core/presentation or auth/login/presentation imo as it references context and deeply related to pure ui logic.
      Also, depending of the logic you embed into you handlers you should maybe split it into different parts.

  • @MohamedAmin-wu7oj
    @MohamedAmin-wu7oj 6 หลายเดือนก่อน

    What is the shortcut for creating a new package in android studio ?

  • @thesavoyard
    @thesavoyard 8 หลายเดือนก่อน +1

    So how is it worse if they have 3 modules and features separated by packages inside those modules? You just reversed it and lost most of the advantages of MVVM Clean. If I need a view model, I go to the presentation, then the package I want, then the packages view model. Instead, it's no longer cleanly separated by job but bloated by feature. This is the mess my last legacy project was organised by. Its terrible.

  • @FebinAugustine
    @FebinAugustine 8 หลายเดือนก่อน

    Expecting a video about login/ signup using firebase or mongo db. Also able to login/signup offline with local db and get updated when online...😁

  • @amirrezababaei3300
    @amirrezababaei3300 8 หลายเดือนก่อน

    It was a good article, if possible, design and implement a VPN app.

  • @ozdmromer7
    @ozdmromer7 8 หลายเดือนก่อน +2

    What do you think about future of Android and developers. Demands will be increased for development or decreased due to rise of AI ? :)

    • @seguramlk
      @seguramlk 7 หลายเดือนก่อน +1

      Increased for sure. Companies will say say things like: "The X AI does that in 2 hours, if you can't do that in 1 hour you're out". Unless it's cheaper to hire developers instead of paying for AI subscriptions.
      Unfortunately it always comes down to expenses. We're just numbers pal

  • @henrik908
    @henrik908 8 หลายเดือนก่อน

    Thank you man I appreciate it.

  • @antarezaghifary9670
    @antarezaghifary9670 8 หลายเดือนก่อน

    this is clear arch? this is similarity with modular

  • @GabrieleRugani
    @GabrieleRugani 8 หลายเดือนก่อน

    Hello! I purchased one of your courses but unfortunately, I've lost access to my Discord account. How can I go about recovering it?

  • @omer.ozdemir7
    @omer.ozdemir7 8 หลายเดือนก่อน

    Great tutorial thank you so much.

  • @dairondanilo6067
    @dairondanilo6067 8 หลายเดือนก่อน

    How would you structure it for a server driven UI?

  • @stasleonov5196
    @stasleonov5196 8 หลายเดือนก่อน +1

    Philipp, someone give you great success in life and a lot of money for everything you do)

  • @zakariabouchantouf5141
    @zakariabouchantouf5141 8 หลายเดือนก่อน

    Thanks philip

  • @Clarence-e6s
    @Clarence-e6s 5 หลายเดือนก่อน

    what about the gradle? it will be massive

  • @Jonathan-zq8vs
    @Jonathan-zq8vs 8 หลายเดือนก่อน +1

    Low coupling, high cohesion

  • @jackeblan
    @jackeblan 8 หลายเดือนก่อน +2

    I still prefer the old way you were organizing your packages.

  • @sefke118
    @sefke118 8 หลายเดือนก่อน

    Thank you very much for this! As a begginer, this was very helpful!

  • @sreenag1255
    @sreenag1255 6 หลายเดือนก่อน

    How this works for 30+ featured application?

  • @ddstudio1580
    @ddstudio1580 8 หลายเดือนก่อน

    With Module?

  • @rishabhsaraswat1928
    @rishabhsaraswat1928 8 หลายเดือนก่อน

    can u please make a video on how are all the things put together for an app. Like we make a server using spring boot, using mongodb for storing data and many other things. If u have already main a premium course on it please share the link

    • @jonneymendoza
      @jonneymendoza 8 หลายเดือนก่อน

      Check his sample apps

  • @mustafaammar551
    @mustafaammar551 8 หลายเดือนก่อน

    Thank you BRO

  • @mmmdbdlov5344
    @mmmdbdlov5344 8 หลายเดือนก่อน

    where put service or receiver ?

  • @kambivictor
    @kambivictor 8 หลายเดือนก่อน

    What about if different roles exist, say some users have more privileges than others like super admin to admin, and a normal user role

  • @pushpak03
    @pushpak03 8 หลายเดือนก่อน +2

    Summry Of this vedio
    This video is about creating a package structure for Android apps.
    The speaker, Philipp Lackner, suggests a structure that is clear, easy to understand, and scales to the project's needs. He also mentions that it should be easy to migrate to a multi-module structure.
    Here are the key points from the video:
    * A good package structure should be:
    * Clear and easy to understand
    * Scalable to the project's needs
    * Easy to migrate to a multi-module structure
    * The speaker suggests dividing the app into features, and then creating packages for each feature.
    * Each feature package should contain sub-packages for the presentation layer, domain layer, and data layer.
    * The speaker also suggests having a root package for classes that are shared between multiple features.
    * He concludes by mentioning that this is just a suggestion, and that developers should be flexible with their package structure as long as it meets the criteria mentioned above.

  • @4ytonly
    @4ytonly 8 หลายเดือนก่อน +3

    For us noobs, what is data, domain and presentation? :)

    • @leonardovalle2763
      @leonardovalle2763 8 หลายเดือนก่อน

      they are each layer of an app. search about Clean Architecture, it's actually a pretty simple concept you can even learn from short videos

  • @darshanmukadam
    @darshanmukadam 8 หลายเดือนก่อน

    What about listeners?

  • @sumanshah5750
    @sumanshah5750 8 หลายเดือนก่อน

    Can you tell us how to get api call of spring boot on android jetpack compose .(RESTapi ,jwt athuntication) Because not found any video on TH-cam.please help

  • @ThePratik822
    @ThePratik822 8 หลายเดือนก่อน

    In which package viewmodel is come? Also activity and fragment also need to create package in presentation package?

    • @yeeti3700
      @yeeti3700 8 หลายเดือนก่อน

      Your viewmodel is also included in the presentation layer. For example, LoginViewModel would be included in the Login package (presentation => login => LoginViewModel, LoginState, etc.). The same applies to Fragments / Activities.

    • @jonneymendoza
      @jonneymendoza 8 หลายเดือนก่อน

      Presentation.viewmodel

  • @Elkasinox
    @Elkasinox 8 หลายเดือนก่อน

    Could you do a basic testing course on yt?

    • @PhilippLackner
      @PhilippLackner  8 หลายเดือนก่อน

      I have a few videos, but proper testing is too complex to just make a "basic" course about. This one covers it all: pl-coding.com/testing

  • @_Mr_Megh_
    @_Mr_Megh_ 8 หลายเดือนก่อน +1

    I am first want a heart Phillip ❤😂🎉🎉

  • @vibovitold
    @vibovitold 8 หลายเดือนก่อน

    I know that's not the main point, obviously, but please DO NOT use underscores in package names (use_cases).
    It's against the Kotlin convention.
    "Package and class naming rules in Kotlin are quite simple:
    Names of packages are always lowercase and do not use underscores
    [...]"
    - from the official documentation.

  • @HossamQandeel
    @HossamQandeel 8 หลายเดือนก่อน

    We need a modularization tutorial video?

  • @deviantstudio
    @deviantstudio 8 หลายเดือนก่อน

    package name should be singular: model, usecase etc

  • @shaharkeisar
    @shaharkeisar 8 หลายเดือนก่อน

    why not by layer, than feature?

    • @PhilippLackner
      @PhilippLackner  8 หลายเดือนก่อน

      Didn't I explain that?😄

    • @shaharkeisar
      @shaharkeisar 8 หลายเดือนก่อน

      Not really, well having data + domain coupled to the feature might end with later need of decoupling for sharing in other feature..
      Modularizing the project by
      Layer than feature is my favorite, because i can enjoy the cohesion of each module, and it's not coupled to the feature module
      Would like to hear your opinion😊

    • @PhilippLackner
      @PhilippLackner  8 หลายเดือนก่อน

      @@shaharkeisar each layer is still its own module, just inside a parent feature module. Pure layered modularization pretty much breaks every principle of modularization 😄

    • @shaharkeisar
      @shaharkeisar 8 หลายเดือนก่อน

      @@PhilippLackner would like to hear how does that breaking modularization
      I'm speaking about layer module that has inside feature modules
      Example:
      Data module
      Inside data modules by feature
      LoginData
      NotesData
      I took that advice from here
      (Google modularization guide)
      th-cam.com/video/16SwTvzDO0A/w-d-xo.htmlsi=UjItnHrQfywtQI6T

    • @shahar19971
      @shahar19971 7 หลายเดือนก่อน

      @@PhilippLackner
      the idea is by layer than by feature..
      th-cam.com/video/16SwTvzDO0A/w-d-xo.html
      would like to here you opinion

  • @MonichGPT
    @MonichGPT 8 หลายเดือนก่อน +2

    UseCase, Data, Domain 🤢🤢🤢🤢🤢🤢

  • @barfyman3Six2
    @barfyman3Six2 8 หลายเดือนก่อน +1

    Far from ultimate. I agree with some of this, but I very much dislike the package structure you are showing here.

    • @scrooge2934
      @scrooge2934 3 หลายเดือนก่อน +1

      Can you summarize what you would do differently and why?

  • @leoparda
    @leoparda 8 หลายเดือนก่อน

    i don't know why your voice doesn't match your face seems like someone else is speaking . Also you open your mouth too much , i am saying this because it's too noticeable for people like me :)
    yup it distracts.

  • @midknightgamers7466
    @midknightgamers7466 8 หลายเดือนก่อน

    can you make one video on the same packaging and architecture guide for KMP projects as well, waiting on your next Kotlin Multiplatform video🕥

    • @PhilippLackner
      @PhilippLackner  8 หลายเดือนก่อน +1

      This structure is universal for all client based software 😄

  • @sidbot9622
    @sidbot9622 8 หลายเดือนก่อน

    Thanks

  • @Miasdsadas
    @Miasdsadas 8 หลายเดือนก่อน

  • @a2_50_gourav5
    @a2_50_gourav5 8 หลายเดือนก่อน +1

    Hi Philip Lackner
    Can You help me Out
    Doubt From You Twitch Live Videos
    when i Run the App it Crash and
    it shows this error
    " java.lang.IllegalStateException: Given component holder class com.example.socialnetworkapp.MainActivity does not implement interface dagger.hilt.internal.GeneratedComponent or interface dagger.hilt.internal.GeneratedComponentManager"
    i think there is some issue with my gradle file versions

    • @omer.ozdemir7
      @omer.ozdemir7 8 หลายเดือนก่อน

      Did you add all annotations correctly ?

    • @rishabh-more
      @rishabh-more 8 หลายเดือนก่อน

      Did you add the @AndroidEntryPoint annotation to your MainAcitivity?

    • @a2_50_gourav5
      @a2_50_gourav5 8 หลายเดือนก่อน

      @@rishabh-more yes i did
      But same error

    • @a2_50_gourav5
      @a2_50_gourav5 8 หลายเดือนก่อน

      @@omer.ozdemir7 Yes I think so

  • @-ECE-SOGATAKAR
    @-ECE-SOGATAKAR 8 หลายเดือนก่อน

    Thanks philipp