Intro to Android Development
  • Welcome
  • Syllabus
  • Hack Challenge
  • Resources
    • Lecture Videos
    • Ed Discussion
    • Git & GitHub Help/How-To
    • Setting up Android Studio
    • Starting an Android Studio Project & Making an Emulator
    • Importing, Exporting, & Submitting Your Projects to CMS
  • SP25 Course Material
    • Week 1 | Course Logistics, Kotlin, & Basic UI
      • Relevant Links
      • Demo/Lecture: Eatery Card
      • A0: Eatery Card (Follow-Along)
    • Week 2 | States, Components, LazyColumn
      • Relevant Links
      • Demo: Todo List
      • A2: Shopping List
    • Week 3 | Navigation & Animations
      • Relevant Links
      • Demo: Onboarding
      • A3: Stock Trading (RobbingGood)
    • Week 4 | MVVM and Flows
      • Relevant Links
      • Demo: Eatery Card 2
      • A4: Chat of a Lifetime
    • Week 5 | Dumb Components & UIEvents
      • Relevant Links
      • Demo: Music Player
      • A5: Rate My Vibe
    • Week 6 | Coroutines, Networking, JSON
      • Relevant Links
      • Demo: Retrofit
      • A6: You Should Even Lift, Bro.
  • Bonus Week | Android Job Search
    • Relevant Links
    • Android Technical Interview Question!
  • Textbook
    • 1. Introduction to the Editor and Views
      • 1.1 Introduction to the Editor
      • 1.2 SDK Management
      • 1.3 Kotlin Overview
      • 1.4 Views
      • 1.5 Android Studio Project Demo + Understanding The Editor
    • 2. Jetpack Compose
      • 2.1 Introduction
      • 2.2 Layouts
      • 2.3 Modifiers
      • 2.4 Animations
      • 2.5 Lazy Lists
      • 2.6 Reactive UI
    • 3. Intents and Manifest
      • 3.1 Activities
      • 3.2 Implicit Intents
      • 3.3 Explicit Intents
      • 3.4 Manifest
      • 3.5 Permissions
      • 3.6 Summary
    • 4. Navigation
      • 4.1 Types of Navigation
      • 4.2 Implementation of the Bottom Navigation Bar
    • 5. Data and Persistent Storage
      • 5.1 Singleton Classes
      • 5.2 Shared Preferences
      • 5.3 Rooms
      • 5.4 Entities
      • 5.5 Data Access Objects
      • 5.6 Databases
    • 5.5 Concurrency
      • 5.5.1 Coroutines
      • 5.5.2 Implementation of Coroutines
      • 5.5.3 Coroutines with Networking Calls
    • 6. Networking and 3rd Party libraries
      • 6.1 HTTP Overview
      • 6.2 3rd Party Libraries
      • 6.3 JSON and Moshi
      • 6.4 Retrofit
      • 6.5 Summary
    • 7. MVVM Design Pattern
      • 7.1 Key Idea
      • 7.2 Implementation Ideas
    • 8. Flows
    • 9. The Art and Ontology of Software
    • 10. 🔥 Firebase
      • 10.1 Setting up Firebase
      • 10.2 Authentication
      • 10.3 Analytics
      • 10.4 Messaging
      • 10.5 Firestore
  • Additional Topics
    • Git and GitHub
    • Exporting to APK
  • Archive
    • Archived Native Android Textbook Pages
      • 1. Layouts and More Views
        • 1.1 File Structure and File Types
        • 1.2 Resource Files
        • 1.3 Button and Input Control
        • 1.4 ViewGroups
        • 1.5 Summary + A Note On Chapter 2 Topics
      • 2. RecyclerViews
        • 2.1 RecyclerViews
        • 2.2 RecyclerView Performance
        • 2.3 Implementation of a Recycler View
        • 2.4 Implementation with Input Controls
        • 2.5 Filtering RecyclerViews
        • 2.6 Recyclerview Demo
      • 3. ListViews and Searching
        • 3.1 ListView vs. RecyclerView
        • 3.2 ListView Performance
        • 3.3 Implementation of a ListView
        • 3.4 Searching in a List View
      • 4. Fragments
        • 4.1 What are Fragments?
        • 4.2 Lifecycle of a Fragment
        • 4.3 Integrating a Fragment into an Activity
        • 4.4 Sharing Data Between Fragments
        • 4.5 Fragment Slide Shows
      • 5. OkHttp
      • 6. Activity Lifecycle
      • 7. Implementation of Tab Layout
    • Fall 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 1.5: Beauty of Kotlin
      • Lecture 2 & HW 2: Modifiers, Lazylists and Reactive UI
      • Lecture 3 & HW 3: Animations, Intents and Manifest
      • Lecture 4 & HW 4: Coroutines & Navigation
      • Lecture 5 & HW 5: Persistent Storage, Networking, and JSON Parsing
      • Lecture 6 & HW 6: MVVM, Flows
      • Bonus Lectures & Bonus HW
      • Bonus Lecture: Industry Practice
    • Spring 2024 Course Material
      • Lecture 1 & Exercise 1: Introduction to Android
      • Lecture 4 & HW 4: LazyLists
      • Lecture 6 & HW 6: Networking, Data, and Persistent Storage
    • Spring 2020 Course Material
      • Week 1: Intro to the Editor
      • Week 2: Views and Layouts
      • Week 3: Intent and Manifest
      • Week 4: ListView and RecyclerView
      • Week 5: Fragments
      • Week 6: Networking
    • Spring 2021 Lecture & HW 8: Networking & 3rd Party APIs
    • HackOurCampus Workshop
Powered by GitBook
On this page
  • Textbook: 3. Intent and Manifest
  • Lecture: Google Slides Link, Demo
  • Demo: Google Slides Link, Solution
  • Homework: P3
  • Requirements:
  • Submission

Was this helpful?

  1. Archive
  2. Fall 2024 Course Material

Lecture 3 & HW 3: Animations, Intents and Manifest

PreviousLecture 2 & HW 2: Modifiers, Lazylists and Reactive UINextLecture 4 & HW 4: Coroutines & Navigation

Last updated 6 months ago

Was this helpful?

Textbook:

Lecture: ,

Demo: ,

Homework: P3

We’ll be creating a simple weather app this week. In this app, users can adjust the temperature and weather conditions, get the weather based on the user’s location (not the location’s actual weather!), and send the current weather information to someone as a text.

This is what the app should look like:

The background color and the icon should change according to the weather conditions, and the temperature should change with the slider. The “Get Location Weather” button should also change the icon and the background according to the fake weather value calculated by the user's location.

Requirements:

  1. There must be a Text component that displays the temperature and a slider that changes the temperature.

  2. There must be an Icon component that displays the icon based on the current weather.

  3. There must be 4 or more buttons for each weather condition, and pressing this button should change the Icon and the background color according to the weather.

  4. The icon and color changes should be smooth and done using . You’re free to pick the icons and colors!

  5. There should be a button to get the current location’s color. If location permissions are not granted, this button should say “Request permission” and clicking it would launch a permission request. If permissions are granted, it should say “Get Location Weather” and clicking it should change the icon and background color according to the location weather.

Find the remainder when the location’s latitude or longitude is divided by the number of weather conditions. Use this remainder to deduce the weather condition (remainder of 0-> Sunny, remainder of 1->Rain, etc)

It may be the case that your emulator will return a null location! The best way to test this feature is to use a physical device; however, if you don't have one, you can hardcode the latitude to test the feature and comment out this hardcoded value before you submit.

  1. Add a share button to share the current weather and temperature with other apps (through an ACTION_SEND intent). The text should say "It is currently <weather condition> with a temperature of <temperature> degrees"

Submission

If you have any trouble at all, do not hesitate to reach out to the course staff, we are all happy to help or just talk! Best of luck!

Use to get the last known location. Make sure you add null checks as the returned location could be null!

You may need to add an to start the intent properly, as there may be many possible apps to use to send the text.

After completing the assignment, you will need to export your project as a zip file and upload it to CMS which you can see in the tutorial on this page:

FusedLocationProviderClient
app chooser
Importing, Exporting, & Submitting Your Project
3. Intent and Manifest
Google Slides Link
Demo
Google Slides Link
Solution
Animations