r/javahelp • u/[deleted] • Aug 21 '19
Is making Android Apps with Java a good way of learning Java?
Hey guys, so i have to learn Java for my programming class in uni, it's still quite basic stuff, no databases, spring etc.
I've been practicing arrays, hashmaps etc etc. by making random small programs in IntelliJ and its quite uninspiring practice. So i thought it might be more fun making Android Apps that i could actually see the progress in and end up using, but is it a good way to learn the Java language? I won't be making apps in my programming classes, only actual pc programs.
3
u/jefwillems Intermediate Brewer Aug 21 '19
Maybe it's a bit too much to do so soon. I don't know. It'll definitely help but you'll be going very slow learning new concepts on top of concepts you haven't grasped yet as well. I'd suggest making a simple boardgame first. With cli user interaction first, then add javafx on top of it and create a gui. You'll want to separate game logic from ui logic to make sure you can re-use the same code for the cli-game, and the gui-game.
At least that's how we did it
Edit: this is the game we made
3
Aug 21 '19
I think that's a bit much for me at this point, but i'll definitely save this comment for future use, thank you!
2
u/jefwillems Intermediate Brewer Aug 21 '19
Jist break it down into smaller parts and do those. Write the use cases, user-flows, and work from there.
For example, start with the user specifying how many players will be playing. Then let users fill in their name (virtually let them pass the device around, no actual multiplayer needed. In reality you'll just write some sample names...). Then write tests for those functionalities you've written. Continue from here on and you'll notice that building the game incrementally like this will bring you much more joy, as you see the game progressing. Just like creating a mobile app :)
3
2
u/livingdub Aug 21 '19
I fully understand that learning syntax, OOP, and different classes and interfaces in the java framework can get boring and uninspiring. On the other hand the more time and energy you invest in a good foundation now, the better programmer you will be. This will mean you can use all those fancy frontend frameworks and make sexy sexy android apps AND do it efficiently, with good clean code for the backend. Bugs will become trivial to you. You will write code that is scalable and manageable. All this and more!
If things are not inspiring right now, maybe check out websites with coding challenges like leetcode or codingame. Something that takes basics and fundamentals and gamifies it. Also, you could always ask your professor for exercises or challenges.
Just a sidenote, the way you enumerate arrays and then hashmaps... That's some weirdly random stuff to throw into a pile with some etcetera's. People might begin to subconsciously question you actually know what you're talking about.
2
Aug 21 '19
Well im fairly new to Java so i don't really know what i'm talking about, i dont know the termonology for these things, that's why im trying to learn and asking if building apps is a good way to learn.
But yeah the reason i'm writing this post is because creating apps with Java seems really interesting right now and i think it would be a good way to motivate myself to practice even harder, so my question was just wether its a good way to learn Java or if i should stick to coding in IntelliJ and make pc programs
1
u/livingdub Aug 22 '19
I'm gonna try and make an analogy here, so bear in mind that these are hardly ever 100% equivalent. But I'd compare your situation to someone wanting to be able to build a car. You kinda know what the pieces and tubes in the engine do and you've taken a look at the transmission once. But you wouldn't really be able to build that engine. You can put nice seats and a radio in that fucker but driving it would be kinda hit and miss. Of course sexy cars are more interesting than greasy engines. But maybe have a look at front-end development if you're more result oriented like this.
2
u/lapa98 Aug 21 '19
Honestly I’m still learning oop and coding in general, but with a uni, and I thought the same and went ahead to explore it and felt so god damned overwhelmed. Not to discourage it but apps in android with java everything felt like scripts and I felt so out of touch I demotivated, as some suggested, some Jfx or a more simple project might be better but if you feel like it’s your desire go ahead there’s docs, tutorials and help everywhere and I’m sure the appropriate Reddit community will help
2
Aug 21 '19
thanks mate, i already bought a 32 hour online course on udemy that has been very highly rated, that teaches app development in Java.. so i'm thinking that should give me a pretty good basis so i wont feel too overwhelmed
22
u/raja_42 Aug 21 '19
Probably not.
Of course the answer is subjective based on who you ask. But learning Java typically means learning the basics of Java.
Classes Main method Console apps Variables For loops Conditional statements Data types String manipulation Read input Display output Interfaces Concrete classes Method invocations Etc.
None of that needs an Android app. In fact, what might happen with an android app is that you get busy on the nuts and bolts of making an android app work, which has its own nuances and quirks different from basics of Java, rather than focusing on the basic of Java.
An android app uses slightly different Java frameworks, different entry points, activities, app constructs like swipe, fingerprints, ux etc. You don't need to worry about it TO START WITH.
Core Java is way easier and simpler to start and learn.
5
u/joequin Aug 22 '19 edited Aug 22 '19
For you in your situation, it’s a great way to accelerate your way towards being a competent programmer. If you were learning programming on your own and this was the only thing that you were going to be doing, then I’d say you should learn fundamentals of programming in general. But school is going to teach you that. Supplementing your education with learning android programming will be great for you.
2
Aug 22 '19
I used Minecraft to understand java fundamentals in a real and working environment. Taught me way more than just tutorials and books. If you have a project that has no guidelines and you want to make it do something, it teaches you to really think critically and to know you’re language.
2
u/DarthFloopy Aug 22 '19
I will defer to other comments to answer your question directly, as I haven't done Android development before, but I will say from what I've seen it may be somewhat complicated for learning purposes. I learned a lot by doing simple GUI programs with Swing (which is relatively easy to learn, though somewhat dated), as well as going through various versions and editions of "Java for Dummies" from the local library. The "all-in-one" edition was particularly comprehensive (for a beginner, at least). If you are at the level of doing data structures you might also try the Core Java books by Cay Horstmann. Of course you will want to do your own research to decide what you want/need to learn, out of all those.
Mainly I would say to make things you like, as that will help you practice more. For me, that was game programming (and I wrote one chat program very terribly to learn networking stuff).
Hopefully this helps someone .... :)
1
Aug 22 '19
Focus on understanding the bigger concepts of OOP. Developing for Android you might end up focusing on just getting it to work.
Build something that you can add to.
An idea off the top of my head. A command line calculator. Start by being able to add 2 numbers and go from there.
You can start with assuming valid input then build in error handling.
Build a test suite for it. (Automated Testing is huge in the real world).
Slap a GUI On it.
1
u/appdevtools Aug 22 '19
I think i am going to say yes, but somewhat yes. I did a java course 2 years ago was fully a fresher in it and got confused in a no. Of things. Then i started making apps in java and today i think my concepts of java used in android dev are pretty decent. You will get a clear understanding of how functions are called, abstract classes, interfaces, data classes, threading , etc along with some good programming practices , framework and patterns.(note that This happens when you dedicate android dev a good amount of time)
But that's the limit. You won't get prepared for competitive programming, you might never touch input classes or java terminal, nd you definitely won't be working with swinf/javafx/awt. Android os is made to run on fairly powerful devices, so you might not wait to think about program complexities and time consumptions (coz most of the lag and overheat comes from the gui and space/time tradeoffs regarding pure java concepts are simply ignored).
So up to you. Android is very powerful framework to work with, and you will definitely get known to java once you start building apps( although its a low time to be an android-java only dev now, kotlin is our new ruler.)
0
u/onebit Aug 22 '19 edited Aug 22 '19
seems like its interesting to you so why not. plus you can get a job with it.
7
u/[deleted] Aug 21 '19
Obviously any practice with Java is good, but right now i just need to learn to use the difference classes in Java and get good with all the basics, is making android apps and i.e programming in IntelliJ that different?