this post was submitted on 20 Apr 2024
7 points (66.7% liked)

Learn Programming

1647 readers
1 users here now

Posting Etiquette

  1. Ask the main part of your question in the title. This should be concise but informative.

  2. Provide everything up front. Don't make people fish for more details in the comments. Provide background information and examples.

  3. Be present for follow up questions. Don't ask for help and run away. Stick around to answer questions and provide more details.

  4. Ask about the problem you're trying to solve. Don't focus too much on debugging your exact solution, as you may be going down the wrong path. Include as much information as you can about what you ultimately are trying to achieve. See more on this here: https://xyproblem.info/

Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient

founded 1 year ago
MODERATORS
 

Does anyone else find javascript/electron-based code editors confusing? I can never understand the organization/hierarchies of menus, buttons, windows, tabs. All my time is spent hunting through the interface. My kingdom for a normal dialogue box!

I've tried and failed to use VSCodium on a bunch of occasions for this reason. And a couple other ones. It's like the UI got left in the InstaPot waaaay too long and now it's just a soggy stewy mess.

Today I finally thought I'd take the first step toward android development. Completing a very simple hello world tutorial is proving to be challenging just because the window I see doesn't precisely correspond to the screenshots. Trying to find the buttons/menus/tools is very slow as I am constantly getting lost. I only ever have this in applications with javascript-based UIs

Questions:

  1. Am I the only one who faces this challenge?

  2. Do I have to use Android Studio or it there some kind of native linux alternative?

edited to reflect correction that Android Studio is not electron

you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 3 points 7 months ago

All of what you mention is possible. Which is why I’m wondering if I need android studio to learn? Or can I use something simpler for now?

So, lets unpack what exactly you mean by learn in this context. There are multiple layers of skills necessary in order to program an Android app.

At the base layer, you've got conceptual skills like Object Oriented Programming (OOP). There are a variety of languages that are classified as OOP, Java/Kotlin happen to be among the more popular ones at the moment. But all OOP languages will have certain design principles in common and understanding those will allow you to not only structure your own code well, but also to understand why certain APIs are designed the way they are. You don't even need a computer to learn these skills, although having one to play around with will certainly help.

Next up from that you have the actual language. Kotlin and/or Java in the case of Android. Technically you don't need an IDE to learn the intricacies of these languages, although it will probably help mostly in regard to your interactions with the standard libraries. What an IDE will give you is the ability to quickly navigate to class, method, and property declarations, both in your own code and in libraries. It will also provide you with auto-completion of all of the above, so you can explore library APIs in a more organic way by taking an instance of some class and simply scrolling through what methods and properties it has available. That said, if you have a web browser open you can technically accomplish the same thing by just keeping the language reference open, so this is really more of just a time saver.

Finally there's the Android APIs. These are distinct from the standard library of Kotlin/Java and are going to be the most opaque portion of the learning process. Due to the size and complexity of these APIs, you really do want to be using an IDE here. You can write an Android app without one, but it's going to be much harder and far more error prone.

Tutorials I find seem to want you to use AS.

That's because Android Studio is the official IDE that google has endorsed for Android development, much like XCode is the IDE that Apple has endorsed (and developed) for iOS (and OS X) development. Unlike in the case of iOS/OS X you don't technically need to use Android Studio, it's entirely possible to cobble together your own set of scripts and tools to accomplish the same thing, but once again you're going to have a much smoother time if you use Android Studio. While the actual code can be written in almost anything, Android Studio is going to provide you tools to do things like UI design, easy access to launch your code in an emulator (or connected device), as well as a very easy to use debugger, plus the benefits I mentioned previously for exploring and understanding the Android APIs.

Does it do anything special?

Basically all the stuff I mentioned previously. The ability to very easily navigate to class and method declarations or instances of interfaces is invaluable when understanding and designing your apps, and being able to easily breakpoint and step through your code is absolutely critical for fixing bugs.

Overall I'd say take a layered approach. First make sure your OOP fundamentals are good, for that you can work with anything you happen to be comfortable with. Next learn Kotlin. Once again you can use anything you want for this, although it would be a good idea to at least use something like IntelliJ community edition or Android Studio. I recommend not writing an Android app for this, instead make something simple that just prints to the CLI like a hello world type app, although hopefully with a little more going on.

Only once you're comfortable with the above, then I'd explore making an Android app, and I would also recommend using Android Studio to do so. Once you've got a good understanding of OOP and Kotlin then a lot of what Android Studio provides will start to make sense.