Notes – Model View Presenter (MVP) in Android

• View and Presenter (Mediator) can see each other • Presenter can only see Model • Unit Test Friendly • Each Presenter is mapped to a View but it’s possible a complex View can be driven by multiple Presenters • Presenter is really Mediator Pattern – Mediates between an arbitrary view and it’s model; Mediator formats data for view; Defines callbacks • View will have a dependency on a Presenter…

Share
Read More

Notes – Unreal Engine Physics

Physics bodies In Unreal Engine, physics are not an intrinsic part of a 3D mesh. A proxy shape is used for performing physics simulations. Physic bodies are simplified 3d meshes for this purpose. They come in the shape of boxes, spheres, capsules and convex hulls. Understanding the Physics section of Static Mesh Details Simulate Physics – When true, the body will use physics. If false, the body will move exactly…

Share
Read More

Notes – Blueprint Communication

Working BP = Blueprint that is issuing a Request Target BP = Blueprint that will receive the Request Method #1 – Compile Time Single Instance Assignment Get a reference to Target BP through a variable; that variable has an instance assigned to it Ex/ Character wants to turn a light on. Inside the Character BP, create an editable variable called TargetLight:BlueprintCeilingLight. Rule: Only expose variables, function and events that are…

Share
Read More

Notes – Best Practices for Developing VR on Oculus Rift

Platform Development -> Virtual Reality Development -> Oculus Rift Development https://docs.unrealengine.com/latest/INT/Platforms/Oculus/QuickStart/5/index.html Quick Start Step 1 to 4 is installing Oculus Runtime software Skip to Step 5. Testing out the Rift and UE4 1. Create a New Blank Blueprint Project a. Mobile/Tablet b. Scalable 3D or 2D c. No Start content d. Name the project “Rift_Test” 2. In UE, goto Play Menu -> Selected Viewport to VR Preview and put Rift…

Share
Read More

Notes – Square’s OkHttp

Features – HTTP/2 support – Google SPDY (“speedy”) support: Reduces latency through compression, multiplexing and prioritization; However, SPDY will be deprecated in the future since HTTP/2 will handle what SPDY would have done – Silently recovers from common connection problems – If there are multiple IP addresses/redundant data centers, it will fall back to alternate address if the previous connection fails. – Uses modern Transport Layer Security (TLS) and falls…

Share
Read More

Notes – Open Web Application Security Project’s Top 10 Attacks

ATTACK #1: SQL Injection Solution: – Use prepared Statement with parameter markers (i.e. ?) – Don’t use just prepared statement alone and avoid concatentating strings to form a query Command Injection – Exploit: Define linux commands into a string where that string is ultimately used inside an exec() function Normal use: exec(“cat log_” + $filebase + “.txt”); Abuse case: exec(“cat log_hits; rm -rf /; : .txt”); // This recursively deletes…

Share
Read More

Notes – Android Network Service Discovery API

STEP ONE: Register Your Service on the Network 1) Define your service as a NsdServiceInfo object 2) Init socket server if using one 3) Create a NsdManager.RegistrationListener object 4) Call NsdManager.serviceInfo:NsdServiceInfo, protocolType:int, listener:NsdManager.RegistrationListener STEP TWO: Discover Services on the Network 1) Create a NsdManager.DiscoveryListener object 2) Call NsdManager.discoverServices (serviceType:String, protocolType:int, listner:NsdManager.DiscoveryListener) When defining this listener, it needs to handle: – Verification the type of service – If it has found…

Share
Read More

Notes – Android Native Development Kit

Process – NDK Only works on > API 3 – script: ndk-build – generates binaries and adds those binaries to the project path – Even if your Android app has no Java src code, .dex will still be created. – ‘native’ keyword: Compiler hint to look for implementation in native library than in Java code. – .so files: Native shared libraries – .a files: Link to other native library –…

Share
Read More