Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Mobile Development - BTalk

Mobile Development - BTalk

Talks about general iOS development and some mobile stats on BTalk - a mobile messenger.

Sing Jie Lee

January 09, 2013
Tweet

More Decks by Sing Jie Lee

Other Decks in Technology

Transcript

  1. Agenda • Lifecycle of App • Mobile Design Principles •

    Responsive • Memory Management • Network • Maintainability • Other Stuffs Monday, January 21, 13
  2. Different states of App Active Background Suspended Inactive Not Running

    Free up memory Disconnect Reconnect Monday, January 21, 13
  3. Mobile Design Principles • Performance • Responsiveness • Optimal memory

    usage • Network • Maintainability Monday, January 21, 13
  4. Responsiveness • Never block the main thread • Always dispatch

    complex data handling to background threads • Utilize cache Monday, January 21, 13
  5. Responsiveness • Image Processing User selects a picture Process Image

    Main Thread Update UI Background Monday, January 21, 13
  6. Example: Image Processing BBImageLoop::Post(^{ processedImage = ImageProcessor.Process(image); BBUILoop::Post(^{ [self updateUI:processedImage];

    }); }); User selects a picture Process Image BBUILoop Update UI BBImageLoop Monday, January 21, 13
  7. Responsiveness • Queues • BBUILoop • BBSoundLoop • BBImageLoop •

    BBDLCoreData • BBDBLoop Monday, January 21, 13
  8. Responsiveness • Queues/Operations are cancelable // Sending out Request tcp.requestNearbyBuddies();

    handler = BBUILoop::DelayPost(^{ showTimeoutScreen(); }, 5000); ... ... // Response received BBUILoop::Cancel(handler); Monday, January 21, 13
  9. • Queues • Use one queue per subsystem • Know

    your queues / threads • Can be cancelled Responsiveness Monday, January 21, 13
  10. Memory Management User Experience Low Memory Usage App is in

    Background/Suspended Monday, January 21, 13
  11. Memory Management • Active? • Use comfortably, but be practical

    • Inactive/Background? • Free up memory as much as possible • If not, Apple kills you in background Monday, January 21, 13
  12. Anything lesser than that is a good gauge Memory Management

    Apps in Background Monday, January 21, 13
  13. Optimal Memory Usage • Stay SAFE in background • Utilize

    system’s memory warning • Ensure no memory leaks Monday, January 21, 13
  14. Network • Minimize network requests • Timeout is necessary •

    Always assume: Network is BAD Monday, January 21, 13
  15. Network • Bad network : Delays • Prevent sending out

    same requests before timeout • Cache responses Monday, January 21, 13
  16. • Bad network : Disconnect • Queue critical requests •

    Fast / Safe Queue • Resend requests after reconnection • Requestid is essential Network Monday, January 21, 13
  17. • Fast Queue • Safe Queue Network Client Client Server

    Server Chats Daily Life Monday, January 21, 13
  18. Maintainability • Modular Code • Easy to Read • Proper

    class/method names Monday, January 21, 13
  19. Maintainability • BTalk is built on modular code Core Network

    FileSystem MediaEngine ... DailyLife ... Video Draw Monday, January 21, 13
  20. Tracker • PivotalTracker • Schedule management tool cum bugs tracker

    • Manages schedule for you • Generate Weekly Report Monday, January 21, 13
  21. Insights on Mobile Stats • Uses Flurry SDK • ~20kB

    per session • Client stats collection is needed Monday, January 21, 13