Coder Social home page Coder Social logo

updatedassignmentrepo's Introduction

	 	 Application Architecture

src
 ├─ Modules
     ├─ AppController
	   ├─ BaseActivity (Common methods containing basic requirements of Activities resides here like checkInternetConnectivity,ShowToast)	 
     ├─ Constants (URLConstants resides here)
     └─ projectModule
                    ├─ controller (containing Activities,Buisness logic here)
			├─ TrueCallerAssignmentActivity (Activity used for the problem statement)
                    	├─ TrueCallerFactoryInterface 
			├─ TrueCallerAssignmentFactory (Factory class for determining class type) 
                    	├─ Find10thCharacter
			├─ Every10thCharacter
                    	├─ WordsCount						
                    ├─ models
                    	├─ listener (Callback listeners)
                    	├─ Asynctask (Used as a model for making network call)
				

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 StringBuilder with the html response received. 

3. TruecallerWordCounterRequest:
For this point, First creating a hashmap with index as words and its count in html as value and then build a StringBuilder from the hashmap and returned it back with the 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 call has been made through background thread via usage of Async Task

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

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.