//****************************************************************************//
//************** Android Studio (cont.) - September 13th, 2017 **************//
//**************************************************************************//

- Android Studio open (not so) ominously on stage...
    - "Based on the IntelliJ platform...from the creators of 'Google Search', 'Google Maps', 'Google Cars', 'Google Backpacks', 'Google Eyes', ..."
- M3 is now due on MONDAY due to the hurricane delay; we'll be switching over to a "Monday-to-Monday" schedule from now on
- If you have any errors w/ lab 3, check Piazza; there's some weird stuff w/ Windows you might have to fix
---------------------------------------

- (class demo code will be uploaded to T-Square)
- When you open up this project, there should be 2 directories: "app" and "gradle scripts"
    - In the gradle.build files, you should be editing the "Module" one, not the "Project" one
        - The "applicationId" package name MUST match the "main" Java file's package name (sometimes, Android Studio can use the wrong package name when we import files)
    - "Espresso" is for writing Android tests using JUnit (won't get to this until ~M10) 
    - In the "app" directory, there's a "manifest" folder w/ an "AndroidManifest.xml" file (need to declare all "activities" in the manifest; Anroid Studio SHOULD do this automatically if you're editing code in it, so this only applies to the people creating new file in external text editors)
        - Other cool stuff you can do w/ the manifest, but those are outside this class's scope; 
        - Also has a "java" folder and "res" folder

- In this demo, the app only has 2 screens: "WelcomeScreen" and "DisplayMessage"
    - All activities should start w/ an "onCreate" method (again, Android Studio should make this for you); MAKE SURE the first thing this method does is call the "super.onCreate(...)" method
        - In Android Studio, there's a thing called "logcat" that logs all the debug messages; that's what the "Log" method is for
    - You then set the activity's view using "setContentView"
    - Can get widgets on the screen (button, textbox, etc.) using "findViewById(...)"
        - ID's are automatically given by Android Studio (1st button named "button 1", 2nd "button 2", etc.); you should PROBABLY change the name to be more relevant (ID's are stored in the "layout" XML file for the view)

- The "res" folder is where you put your images, external resources, and most importantly for M3, your "layouts"
    - You'll see an "R" file in there that should be auto-generated by Android Studio; sometimes it doesn't get regenerated correctly, so just clean/rebuild if that's the case
    - Also under "menu" is the "menu" XML file; we'll talk more about this later

- ANOTHER problem you might run into w/ M3: some methods that are "protected" might need to be made "public" so the program can find them

- (something about using "Intent"s to start activities)
    - (...keeps going through methods in "WelcomeScreenActivity" in Java)
        - Hi, it's Jake from the future (9/26/2017). I was SUPER confused when he went over this in class, but he was actually just going through the files we were assigned in M3 as homework, and explaining some of the Android-specific portions of them. I am now still nowhere close to being an Android guru - but I do understand what Prof. Waters was talking about.

- In the "DisplayMessageActivity" class, on the other hand, there's just the "onCreate" method...

-So, that should give you an idea of how Android Projects are set up

- So, in M3, there'll be a "model" and "controllers" folder under app/java/cs2340.gatech.edu.lab3
    - You'll have to edit some of the model files, according to the lab instructions
    - A couple design patterns used in these, Like Singletons, "Build" pattern, & "Facade" pattern (basically an interface)

- On Friday, we'll talk about some of the UI stuff in Android Studio, then get into some design patterns