Week 7 (in 5 mins)

Debugging your App 

 

7.2:  Dependency Injection

https://developers.google.com/ml-kit/vision/text-recognition/v2/android

Summary so far

Server side:

 

1. Python Server

2. REST API

3. Docker (server that never shuts down)

4. Retrofit 

5. ChatGPT Api

 

Now OCR App -> Debugging

Wallpaper, Weather, Video chat + 

Goal:

  • To Have enough projects for your Resume
  • Experience for 3 year Software Engineer in 3 months
  • Few Important concepts -> More projects

Today's schedule

  1. HW discussion and clean up for OCR App
  2. wallpaper App with exciting fill in the HW
  3. Dependency Injection

2. Wallpaper App -> Concepts

Retrofit code -> Same for interview as Android Developer

Last Class Question

Layout Inspector

Log Statements

Debugger

Homework:

1. Remove the things you don't need from the Project

2. Make the UI as the Figma design

Project Idea Description
Multilingual OCR OCR system for recognizing and translating multiple languages.
Handwritten OCR Develop OCR for recognizing handwritten text.
Receipt Scanner Extract and organize information from receipts.
Document Summarizer OCR tool that extracts and summarizes document content.
Code OCR  Recognize and transcribe code snippets from images.
Business Card Scanner Extract contact info from business cards to digital address book.
License Plate Recognition Identify license plates for traffic and parking management.
Prescription Scanner ->  OCR for verifying and dispensing medical prescriptions.
Text-to-Speech Converter Convert OCR-recognized text from images to speech.
Historical Document Archive OCR for reading and preserving historical records.
Interactive Language Learning Real-time object recognition for language learners.
Real-Time Translator Translate text from images in real-time for travelers.
OCR for Medical Records Extract and categorize medical data from patient records.
Legal Document Scanner OCR system for extracting legal document details.
Handwriting Analysis Tool Analyze handwriting for forensic or personality assessment.

OCR Ideas

1. Layout Inspector to find the views / Fragment / ACtivity

2. Put break points or Log statement to navigate

3. Hit Debug app 

4. find text you're looking for "1+1?"

5. Send to ChatGPT(1+1?)

Dependency Injection (DI)

What is depenency

Class 1

Class 2

e.g one is Client other service

sometimes both

Activity

Retrofit

Internal vs Outside Dependency

1. Instantiation

2. Static Method call

3. Static Global variable

 

Receives dependency from outside -> Injection

3 ways to inject 

1. Constructor

2. Method

3. Field

3 ways

    class Client(private val service1: Service) {

        private var service2:Service? = null

        lateinit var service3:Service
        fun setService2(service2: Service){
            this.service2 = service2
        }
    }

val Service = Service() // new object (RAM) service = existing_service (Saving RAM)

 

Inspiration

Functional & Construction of objects

val object = Object()

val object = existing object

val object1 = Object()

val object2 = Object()

val object3 = Object()

val object = Object()

val object1 = Object()

val object2 = Object()

val object3 = Object()

val object1 = existing object

val objec2 = existing object

val objec3 = existing object

Biggest Benefit

1. Single Responsibility Prinicipal

2. Reusablitiy

3. Testability

Sources

https://developer.android.com/training/dependency-injection/hilt-android

https://developer.android.com/codelabs/android-hilt#8

RecyclerView

https://developer.android.com/develop/ui/views/layout/recyclerview

Week 7

By Harnoor Singh

Week 7

  • 226