15. App Development Crash Course From an App Developer

(I swear I've never been more grateful that I'm not a complete hermit, and do in fact have friends)
How the actual conversation went lol
Like I knew my friend is an app developer, but I kind of felt bad to reach out to someone just for the purpose of getting their help, so by some divine providence my friend reached out and over a meal (my treat obvs) and coffee he helped me sort through all the confusion with Android Studio and got things off the ground basically.

Here's what I managed to accomplish by myself, struggling with basic things like custom fonts and image importing

Yeah it was just that other app from that basic tutorial, just with a different colour, an image, and the app name (which is also an image, I am a disgrace).

Here's the results of my one day crash course with my friend!

Finally figured out typography and better image handling, buttons, tab customisation, etc. I know it doesn't look like much, but most of the time was spent more on learning about the inner workings of Android Studio, which greatly helped me be able to continue on the rest of the fine-tuning on my own.

This is the Project View tab, where you can find every little aspect of the app to tweak to your needs. The first option, Manifests, is kind of like the main container. In the Java folder, the Activities and Fragments make up the books and pages that go into that main container. Java files determine what those books and pages do, while the .xml files in the Layout folder (highlighted) determine what your books and pages look like. The drawable and mipmap folder hold the images (though I'm not quite sure what the distinction is between the two), custom fonts go into the Font folder, the Menu folder handles navigation, while Values contains things like your strings and colour codes.

Gradle Scripts handle the permissions needed in your app, such as Bluetooth connectivity or the use of the phone's microphone.

Other key things to note:
1. "px bad, sp/dp good"
 – basically, I need to throw away my mindset with pixels on screens and think of how the sizes work relative to the different resolutions and pixels per inch (pixel densities) that the various android devices have. dp, or "Density-independent Pixels", will be used to determine things like layout distances and button sizes, and sp, or "Scale-independent Pixels" will be used for dealing with font sizes.
2. File naming and syntax
- I realised that one of the issues I has with the custom font was simply that the file name did not fit the naming rules and thus Android Studio refused to recognise it. I learned to be more careful of naming in general
3. Hard code vs Values
- I should try my best to always put things like text and colours in the Values folder which I mentioned previously. Putting the text directly into the .xml file, or "hard coding", runs the risk of whatever I write being read as code and not text, thus screwing up the whole file.
4. Linear vs Relative Layouts
- Linear layouts are kind of like stacks. each block is placed in its own position
- Relative layouts have blocks which are placed relative to the Parent
- These layouts have different uses, and need to use different syntax when styling.

References:

Developer.android.com. (2017). Fonts in XML | Android Developers. [online]
Developer.android.com. Available at:
https://developer.android.com/guide/topics/ui/look-and-feel/fonts-in-xml.html

Developer.android.com. (2017). More Resource Types | Android Developers. [online]
Available at: https://developer.android.com/guide/topics/resources/moreresources.
html#Dimension

Developer.android.com. (2017). Requesting Permissions | Android Developers. [online] Available at: https://developer.android.com/guide/topics/permissions/requesting.html#normal-dangerous

Comments

Popular posts from this blog

5. Arduino Explorations