this post was submitted on 13 Sep 2023
10 points (91.7% liked)

Android Development

539 readers
8 users here now

Welcome to the programming.dev Android development community!

The Android robot is reproduced or modified from work created and shared by Google and used according to terms described in the Creative Commons 3.0 Attribution License

founded 1 year ago
MODERATORS
 

I'm a very results oriented person. Doing shit for arbitrary numbers in class? Doesn't do anything for me, they're just numbers. However making something that I actually find useful will get me going. I used to take comp sci classes and know Java, even made a few shitty apps for class back in the day. However, I had a hard time sticking with it because we weren't really learning anything to make it immediately valuable. Could dick around in Php for weeks trying to build a website, but cannot focus for classes.

Anyways, my idea is to port PKHex, a popular open source Pokemon save editor. Someone made a port a few years ago, but it doesn't work with anything past Android 11, hasn't been updated in 2 years, and the dev expects you to build the app yourself. So making a new version for Android seems very interesting to me. Is it a good idea for a first 'big' project?

top 8 comments
sorted by: hot top controversial new old
[–] hdsrob@lemmy.world 6 points 1 year ago (2 children)

I've always found building complete things to be the best way to learn (since you have to solve all of the problems for the entire app to finish), so IMO this would be a good project to learn on.

[–] balder1993@programming.dev 3 points 1 year ago

Yeah, this is called “project-based learning” in the literature and there’s an active effort to switch schools to use it instead of the traditional “sit in class and watch your teacher talk” approach.

[–] testAccount@programming.dev 2 points 1 year ago (1 children)

They could even fully rebuild it with Jetpack compose (possibly Kotlin even) instead. Will have to build from scratch and use the old codebase as a reference.

Tho be warned Jetpack Compose is not mature yet.

[–] LeylaaLovee@lemmy.blahaj.zone 1 points 1 year ago (2 children)

I'm gonna ask a stupid question real quick. What happened to Java development on Android? I've heard Kotlin is pretty similar so I'm not worried about learning another language, but I'm curious if Kotlin is a requirement for Android development now.

Assuming I can still build an app the same way I did in school, what's the benefit to switching to Kotlin? Would the app be easier to maintain on Kotlin? Better performance? Like I said, perfectly okay with picking up a new language, just looking for the "why".

[–] testAccount@programming.dev 2 points 1 year ago

Kotlin is now preffered over Java by Google

https://developer.android.com/kotlin/first

You can still build latest apps using Java and traditional view system. There is still insurmountable of Java apps out there easily eclipsing Kotlin apps.

I prefer Kotlin because the language is so much nicer to write in. Also because the future is moving in this direction.

You can read this GTP summary on why Kotlin over Java. Or find some other dozen articles

::: spoiler summary

Kotlin has become increasingly popular for Android app development for several reasons:

  1. Conciseness: Kotlin code is often more concise than equivalent Java code. It reduces boilerplate code, making development faster and less error-prone.

  2. Null Safety: Kotlin's type system helps prevent null pointer exceptions, a common issue in Java. This improves app stability and reduces crashes.

  3. Interoperability: Kotlin is fully interoperable with Java. You can use Java libraries in Kotlin projects and vice versa, making it easy to transition from Java to Kotlin.

  4. Functional Programming: Kotlin supports functional programming constructs, which can lead to more elegant and maintainable code, especially for complex operations.

  5. Extension Functions: Kotlin allows you to add new functions to existing classes without modifying their source code. This is useful for enhancing existing Android APIs.

  6. Coroutines: Kotlin offers native support for asynchronous programming using coroutines. This simplifies managing background tasks, making your apps more responsive.

  7. Default Arguments and Named Parameters: Kotlin allows you to specify default values for function parameters and use named parameters, enhancing code readability.

  8. Smart Casts: Kotlin's type system automatically casts types when certain conditions are met, reducing the need for explicit casting in code.

  9. Data Classes: Kotlin's data classes simplify the creation of classes meant primarily for storing data, reducing the amount of boilerplate code.

  10. Great Tooling: Kotlin is well-supported by Android Studio and offers excellent tooling for Android app development.

While Kotlin offers many advantages, it's essential to consider your team's familiarity with the language and any existing Java codebases. Transitioning from Java to Kotlin can take some time, but many developers find it worthwhile for the benefits it brings to Android app development.

:::

Kotlin doesn't really offer a performance benefit over Java. It's negligible. It's mostly the enchanced type safety.

Kotlin being a requirement really depends on job ur applying for. There is still full Java teams. But imo more are switching to Kotlin. Or taking sorta hybrid approach. Imo Kotlin is great and the only downside i have is that learning it will make you feel annoyed when writing Bloated java again.

[–] balder1993@programming.dev 2 points 1 year ago

The reason is Google kept Android stuck on Java 6 syntax for so long that the community moved on. At the time, moving from Java to Kotlin was a huge deal and then Jetbrains made a good job in making the tools work flawlessly and with no performance penalties as everything is compiled to Java bytecode (besides the nice interoperability).

Now Java has been upgraded on Android but it was too late.

[–] 0x0@programming.dev 1 points 1 year ago (1 children)

You can do both: develop from scratch and after that fix the old port so it works past Android 11 (and implement lessons learned from that into your original version).

What windows app?

[–] LeylaaLovee@lemmy.blahaj.zone 1 points 1 year ago

PK Hex, it's a save editor for Pokemon. Lets you check EVs and such in older games and can act as a sort of Pokemon Home for people on emulators. I'm surprised there isn't someone else doing it already because of how big Pokemon emulation is on Android.