Skip to content

Instantly share code, notes, and snippets.

https://developers.google.com/admob/android/rewarded-video
https://developers.google.com/admob/android/quick-start
https://developers.google.com/admob/android/interstitial
https://developers.google.com/admob/android/test-ads
@SriMaddy
SriMaddy / volley_https.txt
Last active March 29, 2017 05:26
https call via volley
⁠⁠⁠public void NetworkCall() {
RequestQueue queue;
StringRequest stringRequest;
queue = Volley.newRequestQueue(getApplicationContext(),new HurlStack(null, createSslSocketFactory()));
stringRequest = new StringRequest(Request.Method.POST, "https://www.thehellofood.com/restaurantapi/getFoodItems", new Response.Listener<String>() {
@Override
public void onResponse(String response) {
try {
Log.e("response", response);
} catch (Exception e) {
-> No SQL (Non-Relational, full of documents)
-> Database - Database, Table - Collection, Tuple - Document, column - field, table join - document embed
-> unique id for every object
-> id will be 12 byte hex, 4 = timestamp, 3 = machine id, 2 = process id of mongo server, 3 = incremental value
-> HTTP request are handled by controller.
-> @RestController over class
-> @RequestMapping("/path", METHOD=GET/POST....) over method
-> @RequestParam(value="name", defaultValue="Some Default Values") : these are query string params in url/ by default its set to required = false
-> java.util.concurrent.atomic.AtmoicLong is counter which returns specified Rest Object
-> Now converting object to JSON by MappingJackson2HttpConverter which is inside spring's Jackson2.
-> light weight framework used to build any type of java apps
-> its non-invasive : does not force a programmer to extend any predefined class (like struts)
-> features :
-> simplicity (non-invasive)
-> testability (no need server/container)
-> lightly coupling
-> modules in spring 1.x :
-> core module
-> context module (J2EE)
@SriMaddy
SriMaddy / poodr - ch 6
Created April 27, 2015 08:42
Practical OOD in Ruby : Addison - Wesley
Classical inheritance :
Message delegation to another object if one object is not respond to message.
-> find abstraction and create abstract class.
-> Unresponsed messages are automatically delegated(forwarded) to its super class and so on.
@SriMaddy
SriMaddy / poodr - ch 5
Created April 26, 2015 12:20
Practical OOD in Ruby : Addison - Wesley
Duck Typing :
-> Abstract class / interface
-> To make code to be easy to change
-> increases flexibitlity
Statically Typing VS Dynamically Typing
Meta Programming : Writing code that writes code
@SriMaddy
SriMaddy / poodr - ch 4
Created April 25, 2015 13:23
Practical OOD in Ruby : Addison - Wesley
Interface : method inside class which should be communicate with other objects with clear message pattern.
Ex : Kitchen
-> serve() is necessary but cookingManner() is not necessary.
-> Make them appropriate private or public interfaces
Use UML, Sequence diagram
Ask for what not for how
Reduce Law of demeter(Message chaining)
@SriMaddy
SriMaddy / poodr - ch 2
Created April 25, 2015 04:12
ractical OOD in Ruby : Addison - Wesley
Class : Doing possible smallest thing
Change :
-> no side effects
-> small change in requirement require small change in code
-> existing code should be easy to reuse
-> add code that in itself must be easy to change further
TRUE princliple
High cohesion : High single ersposibility
Depend on behaviour not on data.
Hide Data Structures(cell[0]: rim, cell[1]: tire)
@SriMaddy
SriMaddy / poodr - ch 3
Last active August 29, 2015 14:19
Practical OOD in Ruby : Addison - Wesley
Recognize Dependency :
-> A class has another class
-> calls method in another class
-> Args that message(method) requires. Gear knows Wheel.new
requires rim and tire as well as order of Args.
More coupling -> More dependency
Tightly coupled two objects act as single entity
Avoid message chaining on different objects
If you cannot remove dependency from class just isolate them.