Show HN: My first Android App – order-taker for family company that sells wood
github.com
github.com
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
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.
- 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.
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 :/
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.
Sqflite, rxdart, etc have worked well for me, though I will admit that this project is mostly just UI/CRUD so I've had to do very little native work.
I guess I'd say that flutter is already in a really amazing place for apps that aren't heavy on hardware-specific dependencies (like camera, AR, etc.).
I have my fingers crossed that the community will continue to grow to the point that it will flourish even if Google pulls official support at some point...
It's a really great bit of kit. However I'd say also requires a bit more "up front" learning if like me you've avoided js as much as possible.
But the whole toolchain is so smooth and simple.
Then of course I'd intend to build for iOS. Not even looked into that yet
I've also found doing animations and prototyping with UI ideas to be much much easier and faster in flutter than in Android.
> 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.
In my opinion, this is probably the most important chapter in the android developer guide: 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".
What learning resources did you use when building this? Personally whenever I've looked at building an app, I find the concepts for layout and communication entirely opaque and unintuitive.
It looks like you have some hardcoded data. I would move that to resources. You can use some kind of JSON or XML format to store that.
Another thing I would do is split classes into packages. Usually you would have one for UI layer, one for data layer etc.
This is an open question to all.
I want to know how you made the jump to 10+(activity and layout) files in a project, what resources lead you to getting to this level?
This app doesn't use most of them, and I was curious if it mattered.
Why build an "app" when you could build a website?
Is this just an exercise to give you experience? I couldn't fault the urge with everyone wanting to be employable and all but apps as substitute websites is kind of problematic thing. Most of what we're talking about is nearly static data, stuff that used to be on brochures.
An android app that the workers use to collect orders from the customers. After confirming the payment, the App sends the data to the remote server.
So customers aren't meant to install this app. Though, honestly, looking at the video, it still seems like a website could do the same job. Maybe they need it to work offline (and are not aware of/don't want to bother with the web tech that tries to deal with that).
Using an app instead of a site makes it easier for the user and you probably don't even want a browser on the device.
When we put a submission in the second-chance pool, it gets a random placement on the front page. If we guess wrong about what people will find interesting, it soon falls off. This one has gotten quite a few upvotes already, though, so my guess is that I guessed right, at least for some! If you don't think it's interesting, that's fine—nothing interests everyone—but please don't post unsubstantive comments about it, especially not in Show HN threads. Those have special rules (https://news.ycombinator.com/showhn.html), because sharing one's work on the internet puts a person in a vulnerable position.
Instead, simply look at some of the other things there are to read here. If you run out, I recommend the 'past' link in the top bar. It will take you back to the major threads of recent, and not so recent, days.
Edit: there's actually another reason why this is interesting: it's unpredictable. The best things on HN are the ones that you can't predict from any existing sequence (https://hn.algolia.com/?dateRange=all&page=0&prefix=true&que...). I'd say "my family has a business selling wood products which still operates on hand-written invoices, and I decided to learn Android programming by writing some software to try to help with that" is on the one hand a classic HN story, yet on the other hand has elements that are quite uncorrelated. A good mix of familiar and unfamiliar makes for a satisfying HN story.
Yes! This was more interesting to me than, for example, some dross about GPT3 generated poetry. Thank you.
Almost everything is 'on-topic' if we decide it's interesting, and that's why HN is my #1 visited site by a long stretch.