Posts

Showing posts from September, 2017

Sync Adapter Overview

Sync Adapter, as its name it is use to sync device data with server data. This sync can be done on following conditions:- When server data is changed. When device data is changed. At regular interval or specific time. On demand, such as user action. First lets understand SyncAapter Framework. Sync Adapter framework has 4 basic components :- Stub Authenticator. (For accessing account information.) Stub Content Provider (Used when your data is other than SQL) Syn Adapter (Entire Class runs in background thread. You on't need to create your own.) Binder Service (This allow sync adapter framework to call authenticator method.) Note:- Sync Adapter is not only used to sync SQL data, you can sync files, text, and other kind of data with sync adapter but for that need to use Stub Content Provider. Stub Authenticator  Now segregate all the information and come to the flow. So when request Sync. Binder service runs and called onPerformSync after authenticati

Software Design Principles (SOLID)

Image
Before moving on  Design Patterns  let's discuss few things about  Software Design Principles. What are Software Design Principles? Design Principles are set of guidelines that helps to design a software, which needs to avoid these  3 characteristics Rigidity :-  Your design is as flexible as it can be. Because if your design is rigid, your minor change will effect majorly in other part of system. Fragility :-  It means when you make a change in system,  unexpected part of system breaks . Immobility :-  Hard to reuse code in another application because its  tightly coupled . and follow these  Five Rules  ( SOLID) :- Single Responsibility Principle  A class should be designed with one goal but that doesn't mean it will have only one method. It simply means all methods are created to fulfill class goal. Also if we have more than one reason to change a class and (changes)they are not aligned with class goal, then it is better to split them in more than one cla