r/learnjava • • Nov 24 '20

Any Java project suggestions?

Hello all. I'm new to Java(coming from Python) and Python(for me) is very different. I want to get good at Java because I would love to develop android apps and desktop software in general. And I came here for some suggestions. I came up with a project myself(Discord bot), but the API was so complicated I couldn't follow, and so I'm here looking for other ideas. Thanks in advance.

45 Upvotes

30 comments sorted by

3

u/knoam Nov 25 '20 edited Nov 25 '20

Were you using the API directly from Discord documentation? It's probably easier if you use a wrapper library. I just found 2 by googling "java discord api wrapper".

APIs are invaluable if you want to make anything significant. They're definitely something you'll want to learn fairly soon. But I can understand if they're a bit overwhelming since they'll hit you with a bunch of new concepts at once. I unfortunately don't know any good explanations off the top of my head to point you to. I learned it myself pretty gradually over time. If you tell me more specifically what you're getting hung up on maybe I could help point you toward something.

Learning Android is a lot more complicated than learning an API. It's just that it's more straightforward to find a tutorial or class that will walk you through it.

1

u/Aeternus44 Nov 25 '20

Hello. Thank you for taking the time to answer, I do truly appreciate it. For the Discord bot, I was following along a video that was using a dated version of JDA, and I got stuck having to adapt the new one to the code in the video. It frustrated me somewhat quickly. And what frustrated me even more, is that I did everything right, adapted the new code well, but still it didn't work. The bot just sat there and didn't react to anything I did(although I set it to react in certain ways).

2

u/knoam Nov 25 '20

The other library, Discord4J has been updated just 2 days ago, whereas JDA has been last updated in June. JDA has more stars on GitHub so it wasn't a bad choice at the time, but given your problems I'd try Discord4J. Unfortunately with free libraries like these the developers tend to just be working on a volunteer basis so you can't expect too much. And for something like an API wrapper library like this, a lot of more capable developers that could help maintain the library aren't going to bother trying to use someone else's library that's fraught with risks like this when they could more easily use the REST API directly.

It's bad news to be making changes to something before you have it working. Having something working that you can fall back on and try again is way better.

1

u/Aeternus44 Nov 25 '20

I guess I'll try my luck at Dicord4J. Thank you for the help.

1

u/knoam Nov 25 '20

I think I misunderstood. If it's the video you were following that was outdated then I'd find another video or tutorial to follow. And just start small. You have to be able to successfully connect before your chat bot can try to react to something. Did it connect successfully? At that point you're trying to debug to figure out what's going on, which is a whole big skill in itself. Throw in some logging and try hooking up your debugger and step through your code.

1

u/Aeternus44 Nov 25 '20

And I also want to ask whether it's normal that sometimes, for me, programming just seems impossible. I doubt myself a lot, as I know very well I'm not very smart. So I just want to know whether it's normal that it seems like a sea of impossible information and concepts(considering I'm studying on my own at home).

2

u/knoam Nov 25 '20

It would be abnormal for you not to feel that way. Anyone who says they haven't experienced that is lying. It's a lot to learn and there's no resource that can hold your hand through learning everything you need to learn.

r/learnprogramming

r/AskProgramming

r/cscareerquestions

All those subs are full of fellow self-teaching programmers that experiencing the same thing.

17

u/[deleted] Nov 24 '20

I have a simple yet useful app idea id like someone to make me. I have a 1 year old for whom I give two types of medicine for. 1 type I can give him every 4 to 6 hours, the other every 8 hours. I need to know how much in ml I've dosed him and I cannot give any one type of medicine more than 4 times a day. Also, the medicine is given to him by myself and my partner but often at night time and sometimes during the middle of the night whilst one of us are asleep, so basically I also need to know what was given to him and when and an easy way to say it was done, like for instance hit 1 for type 1 and that just accepts default chosen value based on his age and weight that I have entered in(age obviously increases over time automatically but his weight varies). Feel free to ask me anymore questions but a nice simple gui interface would be good otherwise a console app would also work.

20

u/Lurkin_N_Twurkin Nov 25 '20

While this seems relatively basic, the implications of a failure are terrifying.

11

u/ssstudy Nov 25 '20

As someone who works in QA - I have to boldly agree

2

u/mmishu Nov 25 '20

Can you elaborate?

7

u/pyordie Nov 25 '20

It's a liability nightmare - if the app has a logical error, person could get too much or too little of a medication. I'm sure there's ways to get around it by constructing a solid license for the app, but its way too much for a beginner to take on (unless its just for fun and not meant to be used).

1

u/mmishu Nov 25 '20

Yeah that makes sense I just didn’t understand how it would be difficult from a strictly technical QA point

1

u/ssstudy Nov 25 '20

The point of quality assurance is to make sure there’s no errors, and also includes assuming (testing) all possibilities. Something like this would require a lot of testing to publish for use when it involves giving meds to a child.

1

u/mmishu Nov 25 '20

The liability issue would still exist

1

u/ssstudy Nov 28 '20

Heavily

5

u/grimonce Nov 25 '20

Can't you use a piece of paper and pen for that? Or some white board.

Turning an app for that is a lot of startup time. Not comfortable to wait for an app just to tick a button, not to mention hardware might fail registering interaction leading, you not noticing that and then overdosing the little one.

4

u/[deleted] Nov 25 '20

It was a project idea simple enough to implement in java. I can code, and I would make sure it worked as intended. This user asked for project ideas, so I gave a real world idea that I'd been thinking about doing. And yes paper might work nicely but it's fairly tedious writing down your dosages at 3am and my writing is messy, we also live in a two story house, so we would have to bring down the paper with us or whatever. But basically he/she asked for ideas so I gave one.

1

u/grimonce Nov 25 '20

Aye, sorry didn't mean to sound like I am bashing the idea.

11

u/free-puppies Nov 24 '20

Theres a Coursera for Android Development that you may want to check out. Most of what you’d want to pick up in Java coming from Python is general syntax and then domain specific stuff. So I’d definitely lean into your intended domain.

9

u/onlyforjazzmemes Nov 25 '20

I've been getting into Android apps lately, and it's honestly been a lot of fun. Tim Buchalka's Udemy course was a good way to get my feet wet, and the Android documentation is pretty easy to read if you have specific issues or questions.

I've done a couple desktop apps with JavaFX too; documentation and resources don't seem quite as abundant, but it's been fun.

1

u/Johnnycarroll Nov 26 '20

I want to get back to looking at Android apps, I never had luck years ago but I imagine I've improved since then to make it at lest make more sense. Is there a specific one of his? I found it by his name but the one I found mentioned Android 7. I'm fine learning an older but that just felt like it may be dated especially to pay for.

1

u/onlyforjazzmemes Nov 26 '20 edited Nov 26 '20

The one I watched was called Android Java Masterclass, going over Android 7 & 8 I guess. A lot of the basic stuff shouldn't be too different, and if something happens to be deprecated, Android Studio and the official Android documentation are awesome at letting you know the more modern implementation. The biggest difference for just getting started is probably Android Studio itself.

5

u/Chocolate_Banana_ Nov 24 '20

Since you want to build android apps and desktop apps, then build one of those as a small project. A very simple counter app that will increase a number on a label as you press a button.

5

u/travishummel Nov 24 '20

When I was learning Java, I was about to turn 21. So I made a text based game to play blackjack and count cards. It was pretty solid

4

u/Nzen_ Nov 25 '20

Consider reimplementing things you've made in python. That way, you are not learning a language and domain at the same time, as you sensed with the discord bot.

Consider changing an existing discord bot in small ways. Maybe take a simple one and change its ban command to output a warning. Or, see if you can add voice chat music to its commands.

If you are just looking for a list, then this one has lots of options. If you are mathematically inclined, Project Euler has lots of challenges that typically require some computation to solve.

4

u/Bajocan Nov 25 '20

Im doing my first Java project. Its a bot that can read .txt files and makes you pick from differents authors, quoting those .txt randomly. Its pretty hard. My first contact with Java was a month ago. Im copying some code and learning un the process, but im also writting my own code.

4

u/locomocopoco Nov 24 '20

Hyperskill will be a good start.

2

u/slipperySquidd Nov 25 '20

If you're learning for Android, Kotlin would be better, less verbose too.

2

u/desrtfx Nov 25 '20

Since you come from Python, you should really start over with a good tutorial. Python is so fundamentally different to Java that even some of the most basic concepts (for loops for example) don't translate well.

Best, you "forget" (or actually better worded "ignore") just about everything you know about Python when you work with Java.

Start with the MOOC Object Oriented Programming with Java from the University of Helsinki.