INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Java and coding resources for beginners  (Read 3581 times)

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 690
Java and coding resources for beginners
« on: October 17, 2016, 10:48:26 am »

Bgentry, just downloaded your killer app from the previous thread and it got me thinking!

I'm interested in building a simple Android app to send custom MCWS commands to a server using buttons. I'm thinking JRemote/gizmo but much simpler, just 4-8 customizable Android buttons, easy to use in the car to send commands to a Rasp Pi server.

I'm a music teacher by profession, so I'm not at all familiar with coding languages. I know BASIC from when I was a kid, can use the Windows and Linux command lines, have flashed Android Roms to phones, and can write batch files in Windows. So I can get around computers, but never coded for computers.

What's the best way to learn how to build an Android app? Do you have a top five set of resources to recommend, with the end goal of my five button Android/Java MCWS app in mind?

In particular, would love to see examples of syntax explained. Lots of 'X means Y' and 'then indent a line five spaces' etc.

Most tutorials seem laden with jargon and vocab. For example, the difference between coding and compiling often isn't clearly explained. I often chase vocab for a while, build a "hello world program," then put 'real' coding back on my some day maybe list.

Thanks for any input you might have!

Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Java and coding resources for beginners
« Reply #1 on: October 17, 2016, 11:33:17 am »

Some various thoughts on this topic:

Programming, or "coding" isn't as hard as a lot of people make it out to be.  It does take knowledge and skill, but it's not rocket science.  Doing it really well is a craft all it's own of course.  Building professional polished apps is much harder than just a little hacked together code.

I know a good number of languages and have been programming on and off for many, many years.  So my approach to learning Android was probably different than yours might be.  I just grabbed the Android development environment, called Android Studio from the official site:

http://developer.android.com

Then I started working through the tutorial.  The tutorial works, but honestly it's rather confusing, and was discouraging to me at first.  I decided to power through it, and then to start doing other tutorials because I REALLY wanted to learn how to do it.

I used Bucky's tutorials on youtube as a big part of my early learning:

https://www.youtube.com/playlist?list=PL6gx4Cwl9DGBsvRxJJOzG4r4k_zLKrnxl

There are a LOT of videos in his series and I skipped a bunch of them.  I was looking for specific information.  His information and style might work for you, or it might not.

Now, Android Studio is kind of the official "front door" way of doing Android development.  There's quite a learning curve; at least there was for me.  I spent many, many hours before I could develop anything that was at all useful.

The other way to approach Android development is with a third party tool designed to make things easier, or to let you use other languages to develop Android apps.  I only researched a few of these and didn't spend ANY time with any of them.  I went straight to the "front door" method and pushed and worked and finally got something working.

I wish I had a good third party recommendation for you, but I haven't used any of them, so I don't.  Kivy has looked interesting to me several times, but I've never tried it.

https://kivy.org/#home

Finally, some vocabulary explanation about programming:

There are generally two types of programming languages:  Complied languages and interpreted languages.  Compiled languages use a three step process for development:

1.  Write some code.
2.  Run the compiler to turn it into machine language.
3.  Run the machine language program and test it.

If #2 fails, you have to go back to #1 and fix the problems, then try #2 again.

With interpreted languages there is no compiler:  The code just runs right away and you get to find your mistakes right away.

Java is weird because it's interpreted, but it's also "byte compiled".  The up-shot is, running Java code produces obscure error messages that you have to track down and fix, just like any complied language.  Unless you never make any coding mistakes.  :) 

If I can help answer any questions or guide you toward something, let me know and I'll try to help.

Brian.
Logged

drmimosa

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 690
Re: Java and coding resources for beginners
« Reply #2 on: October 17, 2016, 12:07:33 pm »

I went straight to the "front door" method and pushed and worked and finally got something working.

Fantastic, thank you. As a interesting aside, most musicians will attest to your above quote as the number one method for learning new skills. It works, and a lot of research backs this up (Anders Ericsson's articles on deliberate practice come to mind).

Your explanation clears up a lot of things, especially distinction between complied languages and interpreted languages

I will download Android Studio and work through the Bucky tutorials. A quick glance at his videos and it looks like it will be very productive, he seems methodical and very thorough. Perfect for this project. I'll look at Kivy as a backup plan once I am more familiar with basic programming concepts and development processes.

Thanks again, I really appreciate your time and thoughtful response.

-Phil
Logged

mattkhan

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 4226
Re: Java and coding resources for beginners
« Reply #3 on: October 17, 2016, 12:43:50 pm »

Java is not interpreted, it is compiled to byte code and this byte code is what a JVM executes (aka converts to machine code). How this (byte code execution) happens exactly varies by jvm, the current android compiler is an AOT (ahead of time) compiler which means it compiles byte code to machine specific executable at app install time. This contrasts to the oracle JVM (which you will find on the desktop or server) which uses a JIT (just in time) compiler which chooses what to compile (and decompile) on the fly based on what it sees at runtime.

Anyway the point for the developer is that many languages target the jvm these days. If you find Java tricky then perhaps one of those other languages might be easier, ruby (via rubuto) might be a nice option (though I have no idea how mature rubuto is)
Logged

blgentry

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 8014
Re: Java and coding resources for beginners
« Reply #4 on: October 17, 2016, 04:56:07 pm »

Phil, depending on how much effort you are willing to expend, you might find the Android Studio route to be a bit of a steep learning curve.  You're really learning 3 or 4 things simultaneously:  The Android Studio environment and it's complexities, the Java programming language, the XML layout language/environment for Android screens, and the programming environment of Android and it's toolkit.

If you want to become an Android programmer, learning all of this is probably worth the effort.  If you just want to do a one-off program as you have described, one of the rapid development tools that do a lot of the internal work for you might be a better choice.

I wish you good luck whichever way you go! :)

Brian.
Logged
Pages: [1]   Go Up