Post on 28-Jul-2015
Getting Your Next Mobile Project Right!
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
About Me:
Gilad Haimov
7 years Mobile Developer
Lectures on Mobile Tech in Israel & Abroad
CEO of Mobile Edge Ltd.
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
Will Cover:
1. Mobile Resource Management
2. Expected User Experience
3. Correct Test Methodologies
4. Server Push
5. BASS for Server Side
6. Create in-house Libraries
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
Will NOT Cover:
- Universal Truth
- Low level Programmatical Best Practices
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
1. Respect Resources Device
- Battery
- RAM
- CPU
Battery Over-Consumption = consistently major reason for uninstalling apps
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
1. Respect Resources Device – Cont.
Battery Drainers:
- GPS
- Networking (Continuous bursts!)
- OpenGL Animations
- CPU Processing
Golden Rule: Remember to turn off!
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
1. Respect Resources Device – Cont.
- Memory: - Load only when needed; Remove when not - Special care for image loading - Use DDMS regularly - Use Weak Reference Containers - Set android:largeHeap=True - Run large memory components of dedicated
processes
- CPU: - Offload heavy calculations to server - Give medium/low priority to CPU-bound threads - Cache intermediate results
Golden Rule: Load/Calculate only What you Need!
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
2. User Experience – Be Slick
Mobile Users are Spoiled! Will Expect The Best
- Responsiveness - Slick UI - Smooth Animations - Smooth Scrolling (vert/horiz)
- Best Practice: Keep UI Thread for user interactions only: - Delegate heavy duty tasks to other threads - AsyncTask - Executers - Use Strict Mode for Testing
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
2. User Experience – Be Slick
- Awareness - location related Data - Friend Related Data - Immediate Update!
Case Study: Passive Location Provider + Pre-fetching
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
2. User Experience – Be Special!
Give Features and Capabilities Others Do Not
- Hidden APIs – Unpublished Capabilities• CB• BT Services• Tethering• Access HDMI Port• Read Internal SMS DB
- Use Latest OS Features
- Rely on Non-Global Hardware (NFC)
- Requires: Code Branching; OS Sources
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
2. User Experience – Be Special!
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
3. Mobile Testing
Remember: Interleave into Development Process From Start!
- Create a deployment Matrix - Popular Devices - Future Devices
- Test for Mobile Special Conditions: - Incoming Call/SMS - Network Interface Switch - LifeCycle Shifts: Home/Back/Task-Switch - Analyze CPU/Memory Usage - Screen On/Off. Lock-Screen On/Off.
- Use External Tools - DDMS - Robotium - Agilent
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
4. Server Push is Your Friend
- Will always do smarter treatment of small buffer transmission
over your own server
- Don't use if low latency is required (real time transmission)
- Don't use for large packet
- Other than this: just open an XMPP channel from your server to
e.g. Google GCM servers and let them handle per device notifications
- Prefer JSON over XML -- 40-60% less CPU required for parsingMobile Edge | www.mobileEdge.co.il | all rights reserved |
5. BAAS Server Side Solutions
- BAAS = Backend As A Service - Storage - Configuration - Biz Logic - Security, load Balancing, Fail Over..
- Vendors: - Parse - StackMob - Kinvy - Mobile Backend Starter (Google)
- Typically: No need for Backend developer
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. In-House Libraries
For Complex Problems:
(BT Connect Logic)
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. In-House Libraries - Cont
- Do so when Copy/Paste is not an Option
- Consider open Sourcing for the Community
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. In-House Libraries - Cont
- Do so when Copy/Paste is not an Option
- Consider open Sourcing for the Community
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. Cross-Platform Frameworks
Have Realistic Expectations!
- Cross OS platform sounds great
- Allow for web-like prototyping of app
- Latency problem
- VERY bad memory management
- Considered low-end solution
- More popular in the past where experienced native developers where hard to find
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. Cross-Platform Frameworks – Cont.
Have Realistic Expectations!
- Platforms: - PhoneGap – use WebKit renderer
- Titanium: Pre-compiled to native
- Xamarin: Native UI, biz logic only; dotNet dev env
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
6. Cross-Platform Frameworks – Cont.
An Alternative:
- Use one platform (Android) as golden-copy and diff changes to update the other platform
- Work in cycles of Fix and Match. Use a diff tool!
- In-house Results: - 2nd platform will take ~ half the time to Develop - Change consistency near 100%
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
Questions?
Mobile Edge | www.mobileEdge.co.il | all rights reserved |
Thank You!
Mobile Edge | www.mobileEdge.co.il | all rights reserved |