kuzjka / lighthouse-community

Power line status reporting service
0 stars 0 forks source link

added Android app (default Empty Activity template in Android Studio) #6

Closed kuzjka closed 3 weeks ago

kuzjka commented 3 weeks ago

Unfortunately, cannot explain many things here yet. This is a default project created from template in Android Studio.

Android apps have a choice to be written in Java or Kotlin. Nowadays, Kotlin is more popular in Android and most of the examples/guides/tutorials are written in Kotlin. Although syntax and typing differ a little, I hope you'll get used to it quickly. Kotlin runs on top of the same JVM, so you'll find many familiar things.

In Kotlin every function is declared with fun keyword (yeah, writing in Kotlin has a lot of fun 😄 ). Unlike Java, functions may be declared outside classes - think of them as static methods (in fact, they are really compiled to static methods of a class, associated with a file).

There's a bunch of resource files generated by the template. In Android a lot of things is declared in form of XMLs. When I dealt with Android development some ten years ago, app layouts were also in XML. Now it seems they are created right in Kotlin file...

.webp files are images (Google prefers it over PNG)

Main metainformation about the app is stored in manifest file: AndroidManifest.xml. When you install the app in your mobile, it reads information about version compatibility, permissions for the app, app icon and so on. This file is always present in every Android app.

So, don't dive too deep into it for now, just take a quick look to get familiar of how Android project structure looks like. 😉