Coder Social home page Coder Social logo

assignment's Introduction

	 	 Application Architecture

src
	├─ Application     (Core code related to the application resides here)
                      ├─ analytics
                      ├─ controller (Base Controller resides here)
                      ├─ model (Base Model resides here)
				├─ data
                                ├─ database (Used Sqllite DB connection Singleton design pattern)
                                ├─ listener
				├─ manager (Base class used for managing network connections)
				├─ parser
                      ├─ utilities (Anything related with utility code)
	              ├─ validator (Can be used for placing common validations used in the project)
	              ├─ widgets

	├─ Modules
                     ├─ Constants (All URLConstants,JSONConstants resides here)
                     └─ projectModule
                                    ├─ controller (containing following classes here)
				├─ Activities
                                    	├─ fragments
                                    	├─ adapters
                                    ├─ models
                                    	├─ data (POJO classes resides here)
                                    	├─ listener (Callback listeners)
                                    	├─ manager (Used as a model for making network call)
				├─ parser (Can be used for response parsing)
                  

Assignment Output 

1. Truecaller10thCharacterRequest: 
For this point, returned the 10th Character of the html response received which with given url returns html response as <!DOCTYPE  so 10th character output is a space character“ ”

2. TruecallerEvery10thCharacterRequest:
For this point, returned a sorted hashmap by key with index as key and character at the index as value  of the html response received. 

3. TruecallerWordCounterRequest:
For this point, returned the sorted hashmap with index as words and its count in response as value of the html response callback.       


Other Best Practices Used ::

Used Factory design pattern to get data callback for separate TextViews. 
Factory determines which data structure to be used as per the problem statement and respond with the correct corresponding class which contains the data retrieval logic.
Advantages of using it :: Extensibility (Open-Closed Principle) , Unit-Testability, Reuse

All network related calls has been decoupled from modules and  made through WebService Class. Its being used for code extensiblity. (Network connection can be made here though Asynctask or Volley or Retrofit or OKHttp connection) 
Used Google Volley library for its asynchronous network transactions and its inbuilt cache.

Used styles, colors, dimen, strings.xml to make code clear and reusable.

assignment's People

Watchers

James Cloos avatar Konark Arora avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.