Skip to content

Instantly share code, notes, and snippets.

@sagarnayak
sagarnayak / Flutter_Interview_Questions.md
Last active October 15, 2020 07:03
Flutter interview questions

Flutter

Flutter is an open-source UI toolkit from Google for crafting beautiful, natively compiled applications for desktop, web, and mobile from a single codebase. Flutter apps are built using the Dart programming language.

Widgets

Widgets are basically the UI components in Flutter. There are 2 types of widgets in flutter. Stateless and StateFul.

Dart

This is a object orieanted programming language which is used to write flutter code. Dart allows Flutter to avoid the need for a separate declarative layout language like JSX or XML. It uses AOT compilation to make the code run faster on host device.

main() and runApp()

@sagarnayak
sagarnayak / RegularExpression.md
Last active October 1, 2019 11:49
regular expression

Regular Expression

Used to match the string in a sequence of chars. Regular expression is case sensitive.

Searching for literal Chars

  • this is the simplest of all searches. to search ABC just do ABC.

Searching for reserved chars

  • there are some reserved keywords in Regular Expression which has special meaning. like . . so to search for a . we can not just write it like that. we need to escape it. like \. .
  • other special chars in regular expression are - .[{()^$|?*+

Using complex patterns

Pattern Description
@sagarnayak
sagarnayak / DS_Algo.md
Last active September 18, 2019 12:18
Data structures and algorithms

Introduction

data structure are user to organize our data in a specific way to make the operation on the data will be easier and faster. The steps taken on the data structure to get the results out of the raw data is called algorithm.

Types

Data structure is of 2 types-

  • Primitive - The data structure which is provided by the language we ra working on is called primitive dta structure. ex - Integer, Double, Float, Boolean in case of Java.
  • Non-primitive - the data structure which is created with the help of the primitive DS is non-primitive DS. This can again be categorized into 2 types.
    1. Physical - DS which is physically present in the memory. ex - Array, linked list.
  1. Virtual - DS which is user defined and not directly present in memory. this takes help of physical and primitive DS to work. ex - stack queue, tree, graph.
@sagarnayak
sagarnayak / Android_Paging_Library.md
Last active August 14, 2019 09:15
Andoroid paging library Guide

Android Paging Library

This is a library in android jetpack to make the loading data to recyclerview easier and more efficient. It provies with different components like data source, list adapter and boundary callback to use it as per you use case and make you list loading easier.

Docs

DataSource Types

When we are using local Room database we can directly get datasource from the room DAO. but there are case when we need to create our own datasource. like loading the data directly from server. There are 3 types of datasource we can extend and use for loading data from srever -

  1. PageKeyed
  2. ItemKeyed
@sagarnayak
sagarnayak / roomdatabase.md
Last active August 17, 2021 06:05
using room database with android, kotlin

Integrate to Project

App level gradle

.....

apply plugin: 'kotlin-kapt'

.....

    // Room components
@sagarnayak
sagarnayak / Kodein_for_android.md
Last active July 29, 2019 09:20
guide to use kodein in android

Using KODEIN in Android with kotlin

Adding dependencies

    implementation 'org.kodein.di:kodein-di-generic-jvm:6.3.3'
    implementation 'org.kodein.di:kodein-di-framework-android-x:6.3.3'

Declaring Builders

to create a dependency it is required to provide the builder method for that so that Kodein can create it. in this case lets say we want a Repository with a application context.

class Repository(var application: Application) {
@sagarnayak
sagarnayak / Android_Interview_QS.md
Last active June 24, 2022 23:28
android interview questions

Android Interview Questions

OOP Concepts

Object-Oriented Programming is a methodology of designing a program using classes, objects, inheritance, polymorphism, abstraction, and encapsulation.

Access modifiers

  1. Private - can be accessed only in class
  2. Public - can be accessed outside of class
  3. Protected - can be accessed in derived class

Inheritance

Single, multilevel, hierarchial

@sagarnayak
sagarnayak / Dagger_2_23_2_changes.md
Last active July 25, 2019 08:59
There are few changes needs to be done for the existing android projects with dagger after you update the version. this is the guide for that.

Changes to be made to your Android Dagger injection if you have updated to the latest 2.23.2

Scope Structure

@Scope
@Retention(RetentionPolicy.CLASS)
public @interface ApplicationScope {
}

Module Structure