4 ms·
Motivation: My family owns a company that sells sawn wood and plywood products. Although I am currently not engaged in its business, I am very interested in fi
by maherdeeb 6y ago
Motivation:
My family owns a company that sells sawn wood and plywood products. Although I am currently not engaged in its business, I am very interested in finding out how the family business does. Moreover, I would like to put data-driven options on the table to improve the company in the future. The company is still following the 19th-century best practice. The workers handwrite all invoices, and technology has no role in making decisions. Besides that, there is no clear strategy about passing experience to the next generation. I want to change that by creating a pipeline that makes transferring data, experience, and insight happened near real-time.
Design:
I am very interested in the community's feedback regarding my App and code design:
I used activities instead of fragments. I had the feeling that the fragment was not the best option because the navigation plan can be too complex. am I right?
I used a class to initiate my data classes and share them between different activities instead of using the intent to share data. Do you think my option was correct and what could be the best practice for sharing data classes between activities?
When choosing the products, I used only a single activity and used code to change the design of the activity. I thought it that can be faster than using many activities and keep the download size smaller. Does it make sense?
For more info you can check the demo here:
https://www.youtube.com/watch?v=8MdLv3h-j-o https://www.youtube.com/watch?v=8MdLv3h-j-o
My background:
I am a Data Scientist, and I come from Python World. My programming experience is good enough to tackle advanced challenges especially in the case of Machine Learning and Deep Learning. As a problem solver, I enjoy utilizing all possible resources to come up with a valuable solution. I believe that DS people can perform better when they have the right communication channels with developers and stockholders. That is why I am here.
If you have any questions, suggestions, or feedback, I would be happy to answer.
- Benjammer 6y agoI didn't dig too deeply into the code itself and the logic flows, but at a very high level I could start with some project organization feedback that might make your life easier down the road: - You don't have to use a Navigation Component in order to use Fragments. You can still use a single-activity model that just manually calls the fragment manager to make fragment transactions if your app is simple enough to not require a full Navigation graph. The overall reduction in complexity with single-activity are still very worth it, imo. Much easier to attach interfaces than deal with activity results and scene transitions if you don't need to. - You don't have to just have one "app" module in your project. You don't even have to call it "app." You can rename the module to whatever you want, like "wood-client" or something more informative than "app." You could create a second module called "wood-data", and then have all of your data classes defined in separate files in a "model" package. I don't see much reason to pack all your data classes into one file. Android Studio is a fully fledged IDE built on IntelliJ IDEA with things like shift-shift search, and ctrl+o. no reason to compact things into one file. - Speaking of packages, you should think better about your package naming scheme. "com.example.woodinvoicetest" is messy to call it "example," and confusing to call it "<something>test" when it's not actually a test code package. A simple starting point could be something like "com.woodinvoice.client," "com.woodinvoice.common," "com.woodinvoice.data," etc. - Don't worry about download size right now unless you are packaging a lot of graphics content into your APK, like bitmaps and large icons or something. This is a problem for future you to deal with, honestly. You don't have enough workflows yet to worry about app size. You're not building a social/consumer app, so user dropoff for a long download time doesn't mean anything to you right now.
- maherdeeb 6y agoThat is great feedback! It is really helpful and I am going to consider those points next time! Thank you very much for your time and effort.
- thetanuj 6y agoHaving dealt with fragmentManager and supportFragmentManager a lot, I highly recommend using Navigation Component. It may be confusing to set it up initially, but once you do it, it makes navigation really easy to handle.
- rohan1024 6y agoHey if you are starting with Android development, take a look at http://flutter.dev http://flutter.dev
- balladeer 6y agoI may be wrong about it (because I haven't tried it enough) - Flutter feels kinda "reacty" (I think it is) and "javascriptish" to me. I was made/forced to work on react/javascript/angularjs for few months which started in the guise of "urgent help needed for 2 weeks in another team". It was trauma. Besides I had never been able to get into anything JS or related. I started coding on C, then Python, then Java (very little Scala) and now Java and Kotlin. I dabbled with Go a little and it was nice. Recently I had to make some changes to a react native component in one of our Android apps and it was a nightmare even though I was able to make those changes and ship very quickly. These just never made sense to me. As in - "why"? I think I am just averse/allergic to react/js/etc, or maybe I am not able to think deep enough, or something like - I am not wired a particular way :/
- 10-1-100 6y agoI've only done some light dabbling with JS (jQuery, Angular, and a few react/Vue tutorials), and I'm not much of a fan. Flutter, however, has been awesome. I'm actually putting the final touches on a project I've built during the quarantine with Flutter. It started out as an Android app built with Java, then I rewrote it in kotlin using the new (at the time) architecture components (which I found to be a big step forward from Java). Eventually I just couldn't find the time to finish the iOS version and decided to start fresh in flutter, and the experience has been amazing. I find almost all of the framework much much more intuitive than either native platform's, and continually think to myself "this is how app development should have been all along." Also, the app performance is buttery smooth :) Anyway, clearly I'm a fan so I'd say Flutter is worth looking at. For me, perhaps the biggest advantage is that I have found the learning curve and tooling to be way easier to get through and understand than with either native platform.
- jamil7 6y ago
- quantummkv 6y ago>I used activities instead of fragments. I had the feeling that the fragment was not the best option because the navigation plan can be too complex. am I right? > When choosing the products, I used only a single activity and used code to change the design of the activity. I thought it that can be faster than using many activities and keep the download size smaller. Does it make sense? This is where fragments come into picture. You break up parts of your UI in fragments then swap then in and out of your activities. You can also use multiple fragments to compose the UI in an activity. A good way to think of this is to consider an activity as a Room. All the various tables, furniture, etc inside the room become fragments that you can move in and out of rooms according to your need. To extend this analogy a bit more, you can use multiple activities to separate the various logical parts of your app. Similar to how an apartment has many rooms, with each room having a separate function. Btw, This is the kind of thing that got me into programming as a kid. An excellent use of technology to solve a personal pain point in a traditional business. Keep working on it.
- maherdeeb 6y agoYour illustration about activity vs fragment is awesome. I wish I knew this before. Thank you very much!
- Farbklex 6y agoThe biggest pitfall is saving and restoring the app state when the configuration changes or the process is killed. Your app runs into UX problems and at one instance a crash, when the app is restored after the process has been killed. In my opinion, this is probably the most important chapter in the android developer guide: https://developer.android.com/guide/components/activities/activity-lifecycle#asem https://developer.android.com/guide/components/activities/ac... When a user puts the app in the background, the app is at risk of being closed. Who knows, maybe someone gets a call in the middle of an invoice creation. Or someone wants to check an email from a customer again. > I used a class to initiate my data classes and share them between different activities instead of using the intent to share data. The problem here is, that the data class gets lost if you only keep it in memory without persisting it. The good thing about intent data is, that the intent data is stored even between process kills. A good way to test this behavior is to go into the android developer settings and set "Background process limit" to "No background processes".
- maherdeeb 6y agoThank you very much for your feedback. This will the first important point to consider in the next release.