Showing posts with label testing. Show all posts
Showing posts with label testing. Show all posts

Thursday, 17 March 2016

Mobile@Scale 2016

Last month Facebook invited mobile developers into their London offices for a collaborative discussion on scaling mobile development.

The focus was mainly on native development — and the attendees were mostly iOS and Android developers — but the scope expanded to include scaling development processes as well as how to scale apps for lots of users.

Jim Purbrick @JimPurbrick, Engineering Manager in Facebook London’s office, introduced the talks by saying that on mobile, the bug stakes are higher — once a bug is released, the app is on people’s phones and is much harder to fix. You can’t just update the code and see people get the fix in the next page refresh.

And for all the focus on ending up with a native app in the platform-specific app store, two of the big themes were sharing code across platforms and being able to make quick changes to apps that were already deployed.

I was impressed by the inclusivity of the conference — not only were the speakers from a variety of companies (not just Facebook or Facebook partners) but the audience were encouraged and given time to ask questions and discuss with the speakers.

The talks and discussions were all videoed and I’ve linked to them below together with my notes highlighting the points that made an impression on me.

Scaling iOS @ Google

Michele Aiello @micheleaiello, Tech Lead Manager on the Calendar app, Google

Michele gave a really detailed talk about how the iOS teams at Google deal with handling large amounts of code shared amongst many geographically spread developers. There’s lots of useful nuggets in here — and it’s interesting to see where Google have invested time and effort in order to make cross-platform and large team development easier.

Scaling iOS @ Google - Michele Aiello

Posted by At Scale on Monday, 28 March 2016
  • Google has more than 60 apps in the Apple App Store!
  • iOS devs have moved from London to every office worldwide
  • strategy on how to share code really important
  • design & ease of use crucial for scaling apps
  • yearly gathering of all mobile developers
    • often start shared efforts there
  • regular tech talks in local offices + recorded & streamed around the world
  • have feature specific “Tiger teams”
    • one goal: ship a feature
    • cross functional: Android, iOS, web, PM, UX, API, etc
  • have trouble with merging & reviewing xib, project & storyboard files
    • so Chrome team developed GYP: JSON for structure & dependencies
    • GYP: “generate your project”
    • use storyboard & xibs for prototyping, then shared code for elements
  • release management:
    • regular releases every 2-6 weeks
    • with feature flags to toggle new features
    • compile time flag during initial dev, then runtime flags for later
    • known as the release train
    • heavier-weight trains need synchronising with marketing etc — ok to be a little late
    • 75%-80% of users are using auto-update so automatically get updates
  • testing:
    • XCTests for functional and performance
    • KIF & Earl Grey for UI tests
  • sharing code
    • single repo
    • HEAD is always stable
    • all code is available and shared
    • making a change in shared code: see the test results and roll back if issues
  • for any shared code
    • enforce documentation & example code
    • catalog app for UI elements
  • for cross platform sharing
    • try to share model cross platform and to server too
    • makes offline easier
    • have tried webviews & javascript
    • now using C++ & J2ObjC
      • C++ easy on iOS, complicated on Android
      • used in Chrome
      • j2ObjC used for Inbox
    • j2ObjC even lets you debug into transpiled Java code in Xcode
      • breakpoints, stepping, variable values all work
    • if code is simple, look at sharing the tests rather than the code
  • swift at Google: currently playing with it
    • have found that development is faster
    • probably waiting a few months to bring into production apps
  • user testing using beta releases (testflight, android beta)
    • metrics in the app
    • surveys after testing
  • have tools to search whole repo to find out if code is still used
  • sharing layout
    • done using sharing layout logic

When mobile IDEs need to scale

Al Sutton @AlSutton, Facebook

Al talked about how Facebook builds Android apps, and how they feed back improvements to their build process into the open source community (e.g. IntelliJ community edition and the Buck build tool). By using Buck, they allow their developers to choose whatever IDE they want.

Nuclide

James Pearce @JamesPearce, Head of Open Source at Facebook

James continued from Al’s Android introduction to talk about Facebook’s new Nuclide IDE for building iOS apps… It’s exciting to see some competition in the iOS IDE world — whilst Xcode is great at some things, it often leaves a lot to be desired. JetBrains’ AppCode is a useful challenger but to have an extensible open-source IDE for iOS could be a game changer. The only downside for me is that Nuclide relies on Buck, so you have to change your project to buy in to the Facebook toolchain. Perhaps if someone could create a Fastlane plug-in…?

  • unlike IntelliJ, Xcode is not open source, so can’t contribute
  • existential issue for Facebook…
  • started extending Atom from github
  • aded Flow, Babel, Clang & Buck
  • created Nuclide
  • also added Chromium dev tools to help debug into app
    • lets you debug into Javascript, Objective C, etc all in same place
    • transpiling keeps source maps to help with line numbers
    • also lets you inspect into UI hierarchy for ReactNative apps
    • includes highlighting
  • now have 2/3rds of committing engineers using Nuclide
  • have analytics built-in
    • tracking feature usage
  • internal infrastructure team has become a product team
  • now available at http://nuclide.io
    • analytics kept for internal
  • other open source projects
    • pop: iOS animation library
  • doesn’t have refactoring yet

6 lessons learned scaling mobile at SoundCloud

Next up were a couple of sessions from smaller companies (though still not small!) showing how they built and adapted their apps faster to keep up with demand. SoundCloud spoke about using ReactNative (more on that later) and how they structured their dev teams to include mobile developers.

Jamie McDonald (Android) @jdamcd & Matej Balatic (iOS) @skavt, SoundCloud

  • building out new SoundCloud Pulse app for people creating sounds
  • most engineers busy on main SoundCloud listener app
  • got a partner for Android, but built iOS app with ReactNative using web developers
  • shared design & feature set across platforms saves a lot of time
    • were previously designing features twice
    • marketing was more complex too
  • mobile specific API
    • mobile-specific features: background sync, batch fetches
    • “back-end for front-end” idea from ThoughtWorks
  • developed C-based mobile playback library (skippy)
    • initially for Android, now rolled out across iOS too
    • e.g. optimise streaming for emerging markets
  • tried to spread mobile devs through feature teams
    • but spread too thinly
    • weren’t able to pair and share knowledge
  • instead created clusters of feature teams
    • mobile engineers shared amongst each cluster
    • could be in enough numbers together
  • release train model
    • each feature team can take responsibility for shipping
    • allowed action but also feedback and responsibility
    • use feature flags — team responsible for turning on when ready
  • tools used:
    • iOS:
      • FlipTheSwitch
      • stable CoreData stack — specific use of framework
    • Android, use LightCycle (soon to be open-sourced)
      • forward life cycle events to small independent modules
      • receives callbacks but doesn’t need to know which activity its attached to
      • enables better unit tests as can separate things out more effectively

Backend-driven native UIs

John Sundell @johnsundell, iOS Developer, Spotify

Spotify have an almost completely content-based app and are constantly tweaking to change the presentation and priority of different music. John and his team came up with a way of handling that change by controlling the whole app UI from the backend API.

  • define components in backend API
  • generalised data binding
  • generalised components
    • implement standardised components which can be picked up from API
  • can put cacheing, and lots of standard stuff in the generalised app
  • control the UI from the backend
    • API contains view models rather than raw models
  • Ed.: makes sense if you have an app with lots of similar components
    • especially for a content-based app
    • similar to Google’s code-based component library
  • were able to delete 20,000 lines of code on home page browse view
  • overall have been able to delete 100K lines of code across iOS & Android
  • use layout traits to control layout
    • e.g. full width, separator, stackable
  • request sends a lot of data about the device to the backend
    • can return different components & layout depending on device or screen size etc
    • sometimes send extra data in response so can handle quick changes e.g. screen rotation
  • support infinite scroll using metadata with URIs for follow-up pages
  • can set up fallback components — if this not available, fallback to previous
    • enables playing around with new features & UI but still supporting older builds

Infer: Moving fast with static analysis

Dulma Churchill, Software Engineer, Facebook

Taking up Jim Purbrick’s challenge of dealing with the higher stakes of bugs in mobile, Dulma gave us an introduction to Infer — Facebook’s static analyzer that can check for memory and resource leaks and null pointer issues each time you compile.

  • static analyzer that doesn’t require pre/post conditions
  • compositional, so doesn’t need to process whole project at once
  • very intertwined with compiler
  • infer can find inter-procedural bugs not local to single file
  • used with CI can be set up to only process newly compiled files
  • within facebook: fix rate around 70% in recent months
    • high rate due to getting results on continuous integration
  • there’s an Xcode plugin
  • integrated with codeboard
    • web-based IDE to teach programming in classroom
    • Java, Python Haskell…
  • see their blog post about being used at Spotify

3000 images per second

Henna Kermani @tokyotwilight, Software Developer, Twitter

Some interesting stats from Twitter here, in Henna’s story of how Twitter scaled up their image and video handling.

3000 images per second - Henna Kermani

Posted by At Scale on Monday, 28 March 2016
  • image uploading used to be all in the same API call as the tweet itself
    • any point of failure would fail whole thing
    • waste of bandwidth for client & server
  • split out image upload from tweet content
    • also allowed segmented, resumable uploads
    • used multi-part POST requests with separate INIT, APPEND & FINALIZE API calls
    • massive drop in upload failures, especially in developing world
  • did research on age of images:
    • 15 days 50th percentile
    • 150 days 90th percentile
  • so kept original + 20 days of variants
    • balance between storage increase per day and computation on each request
    • saved $6m in 2015 just from this change!
  • image formats
    • tried using WebP for 6 months last year in Android app
      • ~25% smaller than PNG or JPG — better engagement
      • but not supported on Android <4 or iOS…
    • converging on progressive JPEG instead
    • used Facebook’s Fresco library in Android app

React Native

Pieter De Baets @javache, Facebook

Pieter gave a detailed intro to React Native — building native apps for iOS and Android using just JavaScript and HTML-like markup.

  • if you ship a bug in a mobile app, there will always be a user out there running that bug — no matter how many updates you apply…
  • write UI declaratively, code in Javascript
  • share lots of code between iOS and Android
  • Apple’s guidelines don’t allow you to update code in a running app
    • but there’s an exception that lets you update JavaScript over the air
    • so you can update React Native apps instantly

Don’t forget the web

Jeremy Keith @adactio, Founder, Clearleft

After all that talk of native development, Jeremy brought us back to thinking about the web and how it will always be the largest, widest target. It isn’t a “platform” and it will never be the leading edge of mobile, but it is for everybody.

Don’t forget the web - Jeremy Keith

Posted by At Scale on Monday, 28 March 2016
  • when building for the web
    • start with core functionality
    • implement with simplest techology
    • enhance!
  • can be done for whole service but also for individual components
  • Ed. is this that much different from native?
    • especially for different OS levels, Android features etc
  • there’s always something new that’s not fully supported

Sunday, 10 November 2013

MomoLondon: MWC2014 Stand Competition Live Final

10 companies competing to win a place on the UKTI stand at Mobile World Congress 2014 and press & media activity to go with it. ICT KTN, Mobile Monday London, UKTI and Cambridge Wireless all work together to whittle down the competitors to a shortlist of 10, all competing for five places on the stand.

All the companies this year were remarkably different — in their approach, their development stage and their presentation styles.

In the audience vote, I went for Changify, but the five who were selected were PeachInc, 5 Tiles, 23 Snaps, Capito and Viewranger.

There’s also an official blog post with pictures on the Mobile Monday London blog.

Red Glasses

Adam Martin, Founder

http://MyEarthApp.com @RedGlassesApps

  • embedding rich content into 3D objects
  • have built a native 3D engine for iPad that deals with data
  • also built two sample apps:
    1. visualization of magnified Earth heights
    2. showing videos on a 3D globe
  • aim to partner with media & content organisations
  • have built bespoke apps for clients for last 15 years
  • want to expand to a white-label product
  • other demos:
    • showing travel time from a point across the globe
    • luxury retail, where purchasing from

Changify: Design for Social Change

Priya Prakash, Founder

http://www.changify.org @Changify

  • basic idea:
    1. spot & share ideas for problems
    2. get support from friends & neighbours
    3. ideas get backed by brands & biz
    4. earn credits for making the change
  • partnering with Clear Channel to make a digital bus stop
    • crowdsourcing local opinion by voting on screen
    • touch & NFC
  • council get realtime data of reports
  • running a 3 month trial with Guardian Data at Elephand & Castle
  • working with councils & local businesses
  • http://changify.org has been available for 6 months
  • also accessible via SMS

Coveritas

Sean Redmond, CEO

http://www.coveritas.com @Coveritas

  • based in Bletchley Park
  • founding team did functional verification of hardware verification
  • have applied same system to software functional testing
  • specialise in machine to machine interoperability
  • uses randomisation & rules (constraints) to generate end to end use case tests
    • 3GP took 9,000 hours of test engineering
  • looking to partner with domain experts in M2M standards testing
  • customers are those companies with massive test labs for M2M interoperability
  • have an annual time-based license model

SpatialBuzz

Leon Hardwick, Director Global Sales & Marketing; Andrew Blake, CTO

http://www.spatialbuzz.com @SpatialBuzz

  • cloud-based customer experience management for mobile operators
  • delivering info on status and capability of network
  • give the operator an idea of how customers are reacting
  • can also provide an early warning to operator of issues
  • mix together operator outage & planned works with crowd-sourced input
  • can cater for any service delivered geographically
  • deployed with Telefonica UK & Germany, also Tesco Mobile
  • benefits seen:
    • reduction in calls
    • reduction in response times
    • improving customer satisfaction

PeachInc

Dr Daniel Morris

http://www.peachinc.com @PeachInc

  • mobile ticketing using the “MorrisCode” — 2D barcode
    • patented format
  • optimised to be read from electronic displays
  • at the moment PeachInc are the only people who can read them
  • displays well on small screens
  • stores a 16 digit number
  • have built a suite of apps
    • can receive tickets via SMS (even on iPhone)
  • also make hardware
  • will be integrated into a
  • biggest customer so far Saudi Professional football league
  • versus QR codes:
    • reads faster and more successfully
    • reads at 20 frames a second with most mobile cameras
    • 5,000 people at an event with 100% success rate
    • 60,000 football matches in Saudi Arabia with no problems

5-Tiles

Michal Kubacki, Inventor & CEO; Piotr Pieczynski, CFO

http://www.5-tiles.com @fivetiles

  • keyboard for Android
  • business model based on app sales & licensing deals
  • works well for smartwatches (with a touch screen)
    • takes a small amount of screen space
    • have a demo on i’m watch Android smartwatch
  • looking to port to Windows & iOS
  • also getting keyboard tested by RNIB
  • currently have 100s of users on Android
    • and 4,000 downloads of the training app
  • takes about 30-45 minutes to learn the combinations
  • working to make the learning curve lower all the time

23snaps

Meaghan Fitzgerald, CMO; Ivailo Jordanoc, Co-Founder

http://www.23snaps.com @23Snaps

  • mobile-first private social network for families
  • spans across different generations
  • also organise photos by date & location
  • 500K registered users
  • posting one photo every second
  • make money by selling photo print products
  • have users in 179 countries
  • going to be launching in Brazilian Portuguese
  • content owned by creators
  • also provide a one-click export of all content
  • wanting to meet consumer electronics, mobile networks, etc
  • don’t want advertising next to family photos
  • may go for other monetization such as premium features

Available for iPhone, Android, Windows 8, email, web and printed books!

Capito Systems

Tony Ballardie, CEO

http://www.capitosystems.com @CapitoSystems

  • speech assistant technology specifically for mobile commerce
  • about to sign first customer
  • language variations, background noise?
    • have focussed on language understanding rather than speech recognition
  • aiming to license to mobile commerce companies
  • have built support tools to enable customers to build up a speech corpus of domain language

Viewranger

Ben Howard, Marketing & Sales Exec; Craig Wareham, CEO & Co-Founder

http://www.viewranger.com @viewranger

  • digital mobile platform for outdoor activities
  • interest-based social network
  • publishing platform
  • trail guide marketplace
  • over 2 million app downloads
  • used by over 100 search & rescue teams in UK, Ireland, USA, Canada, Germany, Ukraine
  • work with 22 mapping agencies & trail guides from 400 brands
    • including CAMRA :-)
  • wanting to engage with handset OEMs & wearable manufacturers
  • earn revenue through:
    • premium in-app data & services (maps & guides)
    • premium services & analytics for brands
    • syndication of content
    • could go for advertising in the future (have steered away so far to keep UX well)
  • main competitors are still dedicated devices
  • there are sport-based apps that seem to be fragmenting the need

Available for iPhone & iPad, Android and Nokia

UBIAPPS (Nquiring Minds)

Nick Allot, CEO

http://www.ubiapps.com @nallott

  • secure end to end framework for managing apps both online & offline
  • server management + enterprise-grade security is proprietary
  • protocol is open-source (JSON-RPC over HTTP)
  • all nodes are two-way — can manage apps and IoT devices using the same system
  • easy & quick to integrate on any device
  • looking to work with system integrators
  • seen most interest so far from asset tracking systems

Announcements

Tuesday, 29 October 2013

Droidcon 2013

I went to Droidcon UK last week and my brain is still catching up… So many new ideas (and good ones too!).

I’ve put together several posts from Droidcon 2013 — this one gathers all the short notes that I took that didn’t deserve a full post of their own. They’re still worth checking out though!

A big thank you to the organisers and the contributors who made it all possible, especially Thibaut Rouffineau for whom this is his last Droidcon as organiser.

Cupboard SQLite access

https://bitbucket.org/qbusict/cupboard/wiki/GettingStarted

  • easier design than ORMlite
  • works better with Android framework
  • doesn’t require a custom activity

testfairy

http://www.testfairy.com/

  • send your APK to them, they instrument it and return it to you
  • or you can ask them to sign it themselves and manage the testers for you
  • results include one frame per second video of app UI, synced to logs and any exceptions

would you code blindfolded?

Gonçalo Silva, Novoda @gnorsilva

  • Pretotype — most cost effective prototype
    • e.g. using wooden blocks wrapped with paper to test mobile device ideas — use in real world situations — as used by Jeff Hawkins to test the PalmPilot
  • Light Table IDE — animate your code with live test results
  • estimations have a very limited lifetime
    • valid up to a month, maybe two
    • more of a gut feeling rather than a specific time
    • just to help you and guide you, doesn’t tell you when you’ll be complete
    • don’t adjust your estimates — look at the performance in retrospectives
    • make estimates based on difficulty, not time
    • anything bigger than a 4 should be broken down into smaller pieces

android script

http://androidscript.org/

productising a modern Android Device

Craig Arnush, Vertu

Vertu sell hand-made Android phones for £7,000+…

  • made a changes to Android to allow secret alert + new vertu key
    • secret alert makes the phone pretend to be dead (including the home button)
    • modified phone window manager
  • added own analytics (couldn’t rely on Google etc, as wanted security)
  • have an internal Vertu API
    • if interested, get in touch
  • tools: use OpenGrok

Tesco hudl

Novoda were showing off the hudl — a cheap Android tablet sold by Tesco.

Apparently Novoda were involved at a fairly deep level in the project, which explains why it’s actually pretty good!

demo camp

Each presenter had a couple of minutes to show off their app or service — the entries were judges by a panel of venture capitalists offering investment.

amateur football management

  • http://football-tracker.com
  • manage leagues & players

5-tiles keyboard

http://etaoisystems.com/

Download on Google Play

  • normal users reaching 40wpm — almost twice as a normal keyboard
  • speed freaks reaching 100wpm
  • works on small devices — ported to I’m Watch smartwatch: immediately useable

apiomat

http://www.apiomat.com/

  • easy to create APIs
  • graphical UI to create basic database w/relations
  • also does push notifications
  • auto-generates code for iOS, Android, PHP, Python, etc

scoopt

http://scoopt.com/

  • fashion facebook
  • retailer with fashion leads

indoo.rs

http://indoo.rs/

  • got 2-5m just using wi-fi in business design centre (on Android)
  • iOS can’t use wi-fi positioning as Apple don’t provide wi-fi signal strength
  • 6 patents
  • support crowd-sourced mapping
  • €100/mth for access to SDK

apponsor

http://apponsor.com/

  • in-app sponsorship by signing up to newsletter
  • automatically fetches user name and (verified) email address from device
  • requires read context, read local account + internet permissions

pogo from Activ8rlives

http://www.activ8rlives.com/

  • import healthcare data from devices that require USB
  • patients no longer have PCs to upload their data and don’t have the latest Android or iPhone devices to pick up Bluetooth LE or
  • instead have created a hardware box that converts USB into audio jack so can be picked up by an app on even legacy devices
  • indiegogo campaign

genymotion

http://www.genymotion.com/

  • native Android emulation for app testing & presentation
  • integrates with laptop camera & fake location services
  • introducing pro version next month

CapturaTalk

http://www.capturatalk.com/

  • assistive services for students, esp. disabled & dyslexic
    • also useful for those with English as a second language
  • OCR text into an editable format
  • can get word definitions, including easily confusable words
  • being sold to schools

NOBU BYOD

  • remote android workspace for any device
  • provides easily securable data for enterprise
  • uses multi-user android servers
  • have iOS client + HTML5 client
  • can be run inside a data centre

NOBU won the demo camp top prize.

Droidcon 2013: Ship Faster With Open Source from Square

Pierre-Yves Ricau, Square @piwai

Sample project: http://github.com/pyricau/shipfaster

  • look out for talk later at devoxx about how square got rid of fragments
  • debug panel in app, slides from right
    • lets you adjust the settings

dagger dependency injection

https://github.com/square/dagger

  • create object graph in application
  • injection happens in activity onCreate (prob. base class)
  • can switch between modules when create graph (e.g. using build settings)
  • resolves dependencies at compile time as it’s annotation based
    • don’t get errors at run time
    • doesn’t use reflection so faster
  • also generates dot files so can view dependency graph

otto

https://github.com/square/otto

  • (the bus driver in the Simpsons…)
  • broadcasts are not type safe and fragile
  • define event classes
  • the bus then calls the event methods for all subscribers
  • also provides an event logger
  • events are called synchronously

dagger & otto together

  • use a custom annotation with dagger bindings
  • can then add subscription/unsubscription easily

robolectric

http://robolectric.org/

  • main developer now at square…

retrofit REST client

https://github.com/square/retrofit

  • define an interface for API
  • methods take a callback method
  • callback will happen on UI thread
  • suggestion: use otto bus to fire events on return
  • create a RestAdapter and plug it in using dagger
  • has a log level to show you all headers
  • also works with protocol buffers
  • async by default, but can also do sync if you want to do multiple serialized calls from a background thread
  • can use underneath robospice

picasso

https://github.com/square/picasso

  • image loader from URLs
  • placeholder & error images
  • resize dimensions
  • don’t need to deal with http or caching at all!
  • has debug indicator corners on images:
    • green from memory
    • yellow from filesystem
    • red from network
  • can apply transforms to images
  • handles large images well
  • adjusts threads for downloading & encoding according to network status (wifi, 3G)
  • but may not respect cache expiry headers… (poss only when not used with OkHttp)

OkHttp

https://github.com/square/okhttp

  • Android has switched from Apache HttpClient to URLConnection
  • HttpClient no longer maintained in Android :-(
  • OkHttp now part of AOSP!
  • create a client and retrieve an HttpURLConnection
  • used by retrofit and picasso by default

more info available

Droidcon 2013: Gradle for Android

Hans Dockter, CEO Gradleware & Founder of Gradle @hansd

http://gradle.org

http://tools.android.com/tech-docs/new-build-system

buildTypes

  • automatically picks up different source & resource directories
  • can add code specific (e.g. setting constants)
  • can adjust settings across multiple tasks
  • automatically creates new tasks (e.g. packageTest, packageStaging)
  • allows different dependencies for different types

productFlavors

  • just like build types, but another axis
  • can alter package name
  • extends tasks further (e.g. installFreeTest, installPaidStaging)
  • configure different things than buildTypes (not proguard, etc)

flavorGroups

  • allows unlimited extension
  • e.g. ARM/intel
  • tasks allow you to run groups of things — e.g. test all debug builds

other features

  • gradle wrapper
    • allows specifying the version of gradle in source control
  • additional plugins
    • manymo — devices in the cloud
      • has gradle plugin to run tests against selections of their devices
  • has a rich model & deep API that allows additional scripts in build
    • e.g. real-time warning if a test runs for longer than 20ms
  • can combine with wrapper to have your own custom gradle installation
    • put scripts in .init of gradle installation to apply to all builds
  • Android Studio picking up gradle built types
    • so can switch and see effects in the visual designer
  • in future want to specify virtual devices in gradle
    • so IDE just executes gradle
    • IDE has less to do :-)

Droidcon 2013: Boundbox & Memento + Annotation Processing

Stéphane Nicolas, Octo Technology

Matthias Käppler, Soundcloud @mttkay

boundbox

Slides available online

https://github.com/stephanenicolas/boundbox

  • break encapsulation to ease testing (with Android in mind)
  • let’s you access things from Android SDK that you wouldn’t normally access
  • also lets you add fields (e.g. for stub Android jars that only have methods available)
  • can indicate how far up the hierarchy you want to expose
  • don’t need to change your code — just adjust your tests
  • access using reflection, but access checked at compile time
  • open source on github
  • compares with WhiteBox from PowerMock
  • intended for helping test UI layer
    • find views by field name
    • invoke methods & inner classes directly
    • faster and more direct than robotium & UIAutomator
    • as fast as espresso

memento

https://github.com/mttkay/memento

  • dealing with keeping state when the screen rotates
  • the activity gets destroyed and recreated and all your state is thrown away…
  • can use onRetainNonConfigurationInstance to pass objects through configuration changes
    • but what if you need to retain more than one object
    • deprecated in place of fragments — these keep their configuration using setRetainInstance
    • but watch out: setRetainInstance doesn’t work for child fragments and is super-prone for data leaks
  • but what if you have multiple fragments sharing the same state?
  • mark a package private field as @Retain
  • override the new onLaunch method (used to indicate first time initialisation of the class i.e. not after a config change)
  • then use Memento.retain(this)

annotation processing in general

  • use JavaWriter from squareup
  • look at how square does it for dagger dependency injection
  • Google has a library so you can assert over java source files
    • lets you compile with a processor and check the output
  • want to split up the annotation processor into two:
    • one for the client-side annotation itself and any required classes
    • one for the processor (don’t want it in your app)

Wednesday, 6 March 2013

NSConference 5: Day Three

iOS Tools at Flipboard

Evan Doll, Flipboard @edog1203

avoiding crap work

  • use jenkins
    • run clang: +leakToEnsureClangDidRun
    • can also use to send out a beta using TestFlight/HockeyApp
    • jenkins build types:
      • beta
      • beta-external
      • ios-debug-device
      • ios-debug-simulator
      • ios-debug-unittests
    • takes some time to get things sorted with signing etc
  • app icon versioning
    • stamp app icon with the version
    • ImageMagick shell script build phase
  • use multiple bundle identifiers
    • allow app store, beta & debug builds to coexist on device
    • define a custom build setting called BUNDLE_SUFFIX
    • then reference the variable in the Info.plist
  • use JetBrains AppCode as an additional bug finding tool
    • unused code, mismatched types, etc
  • HockeyApp is great for beta handling & crash reporting

squashing bugs

  • useful to capture app state without plugging in to Xcode
    • CocoaLumberjack - high performance logging library
    • bring up a console log on the device
    • also added view hierarchy explorer & file explorer to debug builds
    • tweaker: in-app property inspector launched from pressing and holding on any view
    • see also DCIntrospect & CBIntrospector on github
  • bug reporting UI
    • launched by gesture from anywhere in the app: Flipboard use the volume buttons
      • do some basic checking in case there is actually audio playing…
      • useful to have a hardware gesture
    • attaches view hierarchy, file system, etc
    • can also take screenshot
    • Flipboard attach app feed state to each bug
      • then have in-app bug browser
      • can replicate feed state in app directly from bug

give yourself superpowers

  • testing gestures in the simulator is a pain
    • instead use keyboard shortcuts
    • http://bit.ly/ios-keyevents
    • override UIApplication to capture key events at a deep level
    • doesn’t mess with other text views
    • can use dlopen & dlsym to load private framework in debug code, without linking public app
    • some shortcut examples:
      • enter login info
      • block UI thread for 1 second
  • feature switches
    • exposed in the app
    • can force on/off first launch flow
    • e.g. early iPhone introducing app re-ordering jiggle
      • special shortcut to show an overlay to adjust rotation, shift & frequency
      • handed to Steve to adjust…
      • (see also the Calculator Construction Kit)
    • change the language without resetting the whole phone
      • need a wrapper round NSLocalizedString
    • if arguing about design options, try it both ways
    • freeze content in app for marketing
    • e.g. always show advert
    • make them dynamic at run-time
  • pseudolocalization
    • map all localisation keys to unicode accented characters with extra length
    • For more info on Pseudolocalization, watch the “Internationalization Tips & Tricks” video from WWDC 2012
  • WebTranslateIt
    • shared strings for iOS & Android
  • escape hatches: brains on the server
    • change your mind after the app has been released
    • JSON file for settings
    • sync NSUserDefaults
      • comment from the audience: GroundControl from Matt Thompson (@mattt) can provide remote settings
    • also replace Localized strings
    • in-app help
    • UI hints
    • even adding new social services…
  • chaos monkey
    • process in the app that randomly makes things fail
    • memory warnings, delete cached content, closing network connections
    • ensure there’s some obvious part of the UI that indicates when the monkey is running

communication

  • use pivotal tracker: task management tool
    • testers report into Jira
    • then prioritise using pivotal
  • github pull requests to communicate about code
    • talking about code in progress
    • not just for reviewing
    • start earlier
    • get designers involved
  • GitX + email for lightweight code reviews

User Identity

Markos Charatzas @qnoid

  • stop using passwords!
  • the password policy is one of things wrong with passwords
    • each company has different rules
    • then just as you remember the password, you have to change it
  • security questions for when you forget…
  • need to innovate on user authentication
  • residence based authentication

Reverse Indie

Alexander Griekspoor, Papers

  • 100% Indie (until 31st Oct 2012…)
    • bought by Springer Science+Business Media
  • started making free apps just for the fun of it
  • won an Apple Design Award
  • then made Papers while waiting for postdoc to start
  • free apps drove adoption of paid apps
  • also gave 40% discount to students — fuelled word of mouth marketing
  • then had to figure out how to grow from one person to two?
    • how many more copies do I need to sell just to employ another person?
  • then iPhone & iPad got released…
    • suddenly could support an extra developer
  • iOS enabled growth
  • got handed a love letter to Papers at WWDC 2009 :-)
  • when app gets popular requirements start getting bigger
    • choose between lifestyle business or let the product fly
    • restrict the business to the size of you, or let the product free and take a step back
  • offer of being taken over by a big company
    • wanted to keep independent direction and not get eaten by the beast
      • take advantage of big marketing & sales + common HR & legal
    • need to be able to speak to the guys at the top
    • if the process gets difficult, need to go back to them and check if things are still on track
    • get the financial stuff sorted early
    • get professional help early
    • bring soft issues up immediately
      • they won’t go away

Rethinking Syncing

Charles Parnot @cparnot

http://cocoamine.net

  • syncing-friendly-driven development :-)
    • start with a sync-friendly foundation
    • use a syncing-friendly data model
    • make syncing-friendly decisions
    • keep things syncing-friendly
  • can just use dropbox
    • but two devices accessing same file can get corruption
    • can use a lock file
    • or File Coordination APIs (controls all access so single machine only)
  • have multiple databases, one read/write, others read only
    • log events rather than just storing data
    • then can get latest event
  • rather than having entire record as an event, can use a key/value store with timestamp
  • fetching data involves iterating through required keys
  • can open multiple databases in CoreData
    • one as R/W
    • others can be loaded as read only
    • CoreData will manage reading from combined data and writing to R/W db automatically
  • example: crash reports library
    • shared amongst multiple developers using dropbox
    • key/value database for adding/modifying crash report files
    • UI layer has an in-memory cache of latest data
  • inspirations

Independent, but Not Alone

Craig Hockenberry @chockenberry

Principal at the Iconfactory

  • Weightbot: crazy idea to add personality
    • but it makes the app fun & accessible
    • designer challenged developer to make the app work in a better way
  • “Design is not just what it looks like and feels like. Design is how it works” — Steve Jobs
    • “Developers don’t know how their product works” — @chockenberry
  • developers think of a product from the inside out
    • think about underlying stuff at the beginning
    • UIs reflect the underlying design
  • designers think of a product from the outside in
    • don’t even know what orthogonal means
    • not worried about how it works, or how hard it might be to implement
    • think about your app in the same way that a customer would
  • a designer is your first customer
    • they will give you feedback that may hurt your feelings
  • provide help with tough decisions
  • explaining problems to a non-technical person helps you think differently about the problem
  • how do you make the design - code - review process shorter and tighter?
    • for Twitterrific (iOS & Mac) had a couple of attempts…
    • first attempt: AppTheme
      • application-level settings
      • extract fonts, colours, etc into a file that the designer can edit
      • can still be objective-c
      • still need to train designer to build & install
    • improved attempt Theme: used UIAppearance
      • one Theme for every view class in the app
      • some view classes only exist to be customisable
      • used some macros to make images, insets, gradients etc
      • in Chameleon, when remove root view controller from window, can reset UIAppearance to a new theme (don’t forget to add it back afterwards…)
  • Interface Builder is the uncanny valley of UI design…
    • hard to visualise results
    • really easy to screw things up
  • most important tool to work with designers is version control

Copywriting is Design

Nik Fletcher @nikf

  • even “serious” products are known as Apps
  • Nik is trying to purge the word Cancel from our app vocabulary
    • negatives are hard to scan quickly: “Delete” “Don’t Delete”
    • go for opposites: “Keep”, “Never”, “Not Now”
  • try not to repeat words in sequential alerts
  • disclosure
    • iOS 6 introduces data isolation instead of CLLocationService.purpose
    • localised Info.plist strings instead (see this blog post)
    • can reset:
      • OS X: tccutil reset ..
      • iOS: Settings > Reset All
  • photo access has implicit access to past location history
    • either disclose usage or scrub it before you upload
  • don’t use checkboxes to turn stuff off!
    • tell QA when you find it
  • don’t talk about the “File System” or the “Keychain”
    • again — it’s implementation detail
  • app state: not running or stopped; instead open or closed
  • example: Realmac developer found an awkward bug in Quick Look
    • developer just added a “QuickLook sucks” alert
    • Nik got an email saying “what’s your problem with Quick Look?”
    • …from the engineer at Apple who worked on Quick Look
  • “personality” can be useful in copy
    • but don’t trivialise important things
  • nice trend of moving errors inline
    • avoiding unnecessary alerts
    • e.g. Mobile Safari has error pages rather than alerts
  • your copy (and maybe your company) needs a style guide
    • anyone in the company can use it
    • even developers…!
  • customer? user?
    • Apple uses “you”
  • use genstrings & ibtool to get all the strings into a file to check through
  • recipe for a great alert:
    • title: how did I get here?
    • title & copy: what am I doing here?
    • buttons: how do I do that?
    • buttons: where do I go from here?
  • see more on http://talks.nikf.org/nsc13

Controlling an animation with a UIGestureRecognizer

Eelco Lempsink @eelco

  • want to use a gesture to scrub across an animation
    • e.g. Photos app on iPad lets you slowly pinch/zoom open each event/album
  • control animation: CA...Animation* animation ... animation.speed = 0; animation.duration = 1; animation.timeOffset = position; // 0 .. 1
  • use UIPinchGestureRecognizer
    • adjust scale to fit the UI element size and animation
    • objects should stay under your fingers as you move them
  • decide what to do when you release the gesture
    • end state, duration, animation curve
    • during gesture you probably want linear animation
    • but when you let go it should probably be something different
  • if you have a complicated animation you can add a property to control the offset
    • can then derive other properties from the value of this new property
    • simplifies code
    • but you have to do some interpolation maths yourself

The Art of Shipping

Alan Cannistraro @accannis

http://facebook.com/alancannistraro

  • worked 12 years at Apple
  • started on iOS apps in 2006 before iPhone even announced
  • now working at Facebook London
  • 5 stages to shipping a product

conceive

  • Steve Jobs: “Creativity is just connecting things. When you ask creative people how they did something, they feel a little guilty because they didn’t really do it, they just saw something. It seemed obvious to them after a while.”
  • de Bono lateral/horizontal thinking exercises
  • e.g. “Random Entry”
    • define a focus
    • choose a word from a 2000 word table
    • spend 10-15 mins generating ideas
    • repeat
  • then distill ideas
    • filter for crap or technically impossible
    • gather into a cohesive story

design

  • Steve Jobs: “sweat all the details”
  • Alan uses wireframes to help to decide the design
  • then generate screenshots
  • does it flow? can you simplify it?
  • design up front is easier…
    • (but not always possible)

build

  • make a scaffold: has all the bits
  • Steve Jobs: “Simple can be harder than complex: You have to work hard to get your thinking clean to make it simple.”
  • don’t mess with MVC
    • don’t have a UIView that references an NSManagedObject!
  • Cocoa SDK API has a team that scrutinises the code and strives to simplify it
    • use their API as your yardstick…
  • tried a project by designing it all in UML first
    • the developers stopped coming in…
  • start with simple bits
  • avoid shortcuts unless you’re 2-3 days away from release…

refine

  • track everything
  • set a date
  • don’t be afraid to punt issues to the next release
  • prioritising bugs:
    1. data loss
    2. crashes
    3. visual polish (!)
    4. regressions
    5. bugs in new features
    6. everything else
  • why visual polish so high?
  • Donald Norman: Emotional Design
    • aesthetically pleasing objects appear more useful
    • cognitive bias: beauty bias
      • when something is beautiful, we believe its other properties have prowess
    • the halo effect
      • not about success in one area leading to another
      • instead our brains assume that beautiful apps are better, whether they are or not

review

  • Steve Jobs: “My job is not to be easy on people. My job is to take great people and push them.”
  • be honest about first impressions
    • but leave your ego at the door
  • if it feels wrong, don’t ship it

one more thing…

One thing that Steve said to Alan was “the most important thing you need to do surround yourself with people smarter than you.”

Thursday, 8 September 2011

iOSDev UK: Making Money with In-App Purchases

Dave Verwer, shinydevelopment, @daveverwer

Developing in-app purchases in the Explore Flickr app

  • purchases can be:
    • content, functionality (permanent purchases)
    • services, subscriptions (repeatable purchases)
  • have to design your own store
  • in-app purchases restrictions:
    • no promo codes or volume purchases
  • store should answer:
    • what is this store?
    • what will I get if I upgrade?
    • big green friendly buy button
  • ruby script to switch info plist based on DEBUG/RELEASE — needed to switch between versions
  • measure success with analytics
    • log each stage to capture where people fall out
    • e.g. store shown, video played, upgrade button tapped, upgrade process complete
  • 1.6% conversion from Explore Flickr (from those who view the store)
  • A/B testing for store designs
    • HuffPost do A/B testing on headlines
    • have 3 choices for first hour, then automatically chosen
    • be consistent with presentation (don’t let people know we’re A/B testing them)
    • need to know if we’re still A/B testing
    • put both bits of code in app, and choose according to web check on first launch
  • Results:
    • store -> video -> upgrade pressed -> upgraded
    • A: 100% -> 7.5% -> 3.2% -> 1.6%
    • B: 100% -> 9.5% -> 3.5% -> 1.8%
    • interesting stat is that video
  • What next?
    • make the store more dynamic
    • downloaded plist file for wording
    • HTML for whole store page (but would need to download and cache it)

iOSDev UK: Adapting Content for Apps

Dave Addey & Alyson Fielding, Agant Ltd, @daveaddey & @alysonf

  • Why an app?
    • Can you do something with it in dead time?
    • It’s always there when you need it
    • Would you use it yourself?
  • Preparing content
    • content definition lets you split up content into small pieces
  • iPhone vs iPad
    • use cases are different
    • e.g. full page illustrations just don’t work on an iPhone — universal app just doesn’t show them
  • network content:
    • assume no network and make as many things possible as you can
    • then download & cache what you need when network becomes available
    • same goes for submitting stuff — add it to a queue and submit it when a network becomes available
    • e.g. QI app submit a fact
    • provide the app bundle with some initial content to get started
    • if you have information always show it — but show how old it is

content formats

  • HTML
  • Property list
  • Custom XML
  • NSAttributedString
  • Core Data store
  • SQLite database
  • bundled media files
  • text files — e.g. QI facts to rate
  • PDF
  • e.g. QI app
    • books came as ePub (HTML)
    • needed tidying, but was very useful
    • errors could be spotted & fixed directly
    • however, not the right format to put in the app
    • used script to transfer into NSAttributedString
    • better presentation
    • better layout for images & text
    • better pagination
    • content definition really helped
  • e.g. Malcolm Tucker
    • email views driven from plist
    • Aly edited directly in XCode and rebuild to check
    • email content in HTML
    • attachments in PDF
  • e.g. Arsenal app
    • already had a CMS for the website
    • beginning of project — defined an API
    • tweaked the API throughout development, but had something to work from right at the beginning

Helping content experts

  • work hand in hand with them from the beginning
  • make sure they have a real device that they’re using every day
  • try to let the content expert able to make their own build of the app as they change the content
    • anyone working on the content has XCode installed and knows how to build it
    • they also have access to check stuff back in
  • let them play with your toys — it’s fun!
  • put the content in with the development

stats

  • 2.7 million stations are picked from UK Trains picker every month (~88k per day)

Q&A

  • testing
    • looking to do more
    • UI testing is a bit of a faff, but is possible

iOSDev UK: Tap to Experiment

Chris Ross, Osmosis Apps, @darkrock

An attempt to find success on the AppStore

  • App: Tap to Chat
    • Other chat apps look very similar — buddy lists & tab bars
    • Decided to try something different — picture-based
  • Go along to a nearby group (e.g. Brighton iPhone Creators)
  • Experiment #1: universal Facebook chat app with a novel UI
    • 1.5 weeks each for two people
    • Used pre-existing code from other apps (Facebook XMPP chat)
  • Collaboration helps — both to evolve good ideas and filter bad ideas
  • Can appeal app store rejections, even if you don’t change the code (e.g. if your app relies on a third party that was down during testing)
  • Don’t underestimate the phenomenal power of the Christmas period
    • e.g. EA drop their prices just before Xmas, their apps go to the top, and their downloads rocket
  • Experiment #1.5:
    • iAds seeing only 10-15% fill rate
    • Apple pay you just to show the advert
    • Admob have a higher fill rate, but only pay you for click-through
    • More differentiation with paid app
    • Removing adverts is not enough to get people to buy the paid version
    • Added “share app on friends’ walls”
    • had a spike -> 1000 shares a day
    • revenue jumped to £4-4.5K / month
  • Experiment #2:
    • Started a company to house the app
    • Rewrite the code
    • Changed the facebook (spamming)sharing since Facebook complained…
    • but they were polite
    • Added Google chat, AIM + others
    • More free apps: one per API — better upgrade path (get all in one app)
    • Got a designer
  • Aimed to do all that in two weeks…
    • but took three weeks from 6am-11pm
    • downloadDidFailWithError is a private API
  • Got an expedited AppStore review to be in store in time for Apple Design Awards
  • Results:
    • Revenue jumped to c.£6k/month
    • Difficult to convert people from v1 to v2 (especially since v2 was on a new (company) iTunes account)
  • Success in the AppStore?
    • Overall stats:
    • Mean amount of money made: £30,000
    • Median amount made: £600
    • Tap to Chat:
    • 18% revenue from paid apps (18K downloads)
    • 82% revenue from adverts in free (500K downloads)
    • £40K made so far
  • Moving to using mopub to do advertising
    • provides more control on the server side
  • Mistakes
    • changed sharing in v2 — less visibility
    • no push notifications in v2 (but kind of a choice anyway)
    • transitioning to a new iTunes Connect account
  • Next steps
    • building a backend server for push notifications
    • building libraries for MSN & AIM
    • improving user retention:
    • Osmo character offers advice and news

Q&A

  • Facebook App ID
    • can share same app ID between apps
    • v1 & v2 (different iTunes Accounts) and free apps use same facebook app ID
  • Facebook spamming guidelines
    • you must have a single action per share
    • you must allow the user to edit their text on others’ walls
    • If there is an issue, facebook contact you to say that you have to resolve the issue in 24hrs — but they need you to respond in that time
    • you can ask for a grace period
    • Tap to Chat asked for 2 weeks
  • Transferring iTunes Accounts
    • can convert a personal account into a corporate account if you ask
  • Experiments with price?
    • v1: 59p
    • aim to bump the price with each added network
    • “no point putting things for less than £2 on the app store — if people have made a decision to buy it, then they’ll buy it…”

Wednesday, 7 September 2011

iOSDev UK: Using TDD to write an iOS App

Graham Lee, professional in-betweener, @iamleeg

Or, “What is TDD and why should you use it?”

  • discovering bugs is not the point of testing at all
    • instead, you are proving that there aren’t bugs
  • once we’ve fixed bugs, we don’t want to see them ever again
    • tests can ensure that regressions don’t come back
  • TDD allows us to prevent bugs from ever happening!
    • you won’t prove that the app works how the customer expects, but you will at least prove that it works how you expect it to work…
  • TDD imposes black-box thinking for the developer
    • makes you think about how the code should be designed and scoped
  • accurate planning: we know how much we’ve done
    • and we can be honest how much we have done
  • TDD does not:
    • ensure that the developer understood the requirements!
    • ensure that the requirements remain static
    • ensure that pieces work together (unless you add integration tests)
  • tests should be short and have descriptive, English names
    • e.g. testDatesOnTheSameDayAreConsideredSame
    • general pattern
  • tests should be fast — well under a hundredth of a second each, so a second or so for all of them
    • avoid integration tests in unit testing since they take too long
    • don’t interrupt your concentration by waiting for tests
  • as a result, your classes will be smaller and have obvious effects
    • any side-effects are few and easy to predict
    • if your test fixture gets big, then that’s a sign that you need to refactor (possibly including the tests!)
  • TDD encourages “tell, don’t ask” configuration
    • inversion of control
    • pass in helper data rather than discover it internally
  • avoiding testing everything at once:
    • use fake objects (with same interfaces) to provide simulated interactions
    • use mock objects to record and verify interactions
  • Objective-C mock frameworks:
  • Code coverage is useful for adding tests to an existing app
    • Not so useful for building new code
    • If you’re not covering code with TDD, then you’re kind of cheating yourself

Q&A

  • @pilky knows about using the accessibility framework to write automated UI tests using javascript
  • can use XCodeBuild to run unit tests from command line
  • use GHUnit instead of built-in OCUnit to output JUnit XML reports
  • iOS Enterprise Development — O’Reilly book by James Turner
    • includes lots of useful
  • squish automated GUI testing?
  • test code linking…
    • app should be plugin host, providing linked libraries
    • but it doesn’t work — have to link yourself from test code

Monday, 20 June 2011

MomoLondon: Web vs Apps

I couldn’t make tonight’s Mobile Monday on location, so I thought I’d post my delayed notes from last time’s debate on Web vs Apps.

It was a lively session with both sides arguing strongly, though (unfortunately?) sometimes for the other side! The team members started by taking turns in giving short presentations — notably all of team web had slides (including beautiful ones from Bryan as usual) whereas all of team apps had decided just to talk.

Team web ended up with the audience vote (just!), but personally I thought team apps had the better argument. Yes, there are billions more mobile devices out there that can access web sites rather than have apps, but as we’ve seen (and as even Tomi Ahonen has been repeatedly caught out by) slick user experience drives mobile devices more than anything else. Web sites are great for finding stuff — but people don’t keep coming back to the same web site like they do to a favourite, well-designed app. And the skew in stats that we’ve seen since the iPhone came out (iPhones and similar devices punch way above their weight in usage compared to number of devices) applies even more for apps vs web sites. In his 5 minute presentation, Mauricio put up some Flirtomatic stats saying that they made about three times as much revenue from mobile web as from apps, but then revealed that their iPhone app provided 11% of revenue from 0.8% of sessions!

Anyway, enough ranting… Here’s my usual semi-structured notes:

Panel

Chaired by Leila Makki

Team Apps

Team Web

5 min presentations

Each team member made their own presentation, but my notes have all the points mixed together. Viji Pathy has posted a pretty comprehensive report of the session on the Mobile Monday blog that gives a bit more detail on the presentations side.

  • Discoverability
    • App store pre-installed
    • Browse, search, one-click install
    • Web is about information — apps are about utility
  • Building a mobile web app is not just about knowing HTML and CSS with a bit of Javascript
    • Easy to get very bad results on mobile
  • Numbers: 77% of 6.8 billion people have access to a mobile device (5.3 billion)
    • only 100 million iPhones (only 2.015%)
    • for 1/3 of population internet access is only via mobile
    • the other devices are mostly “feature phones”
    • but this is not an argument for web vs native… since many of the feature phones either have limited mobile web, or else support native apps!
  • Linkability — if you don’t have the app installed, sending someone direct content doesn’t work so well
    • this is Tim Berners-Lee’s fear, but apps can integrate with a web-based backend (e.g. instagram) and app stores themselves can be web-enabled
  • Non-technical people actually don’t understand what a website is…
    • Big successful web sites are understandable on a human level: eBay/Amazon are shops; Facebook is the pub
    • Similarly, apps are a more human thing — you get a nice shiny icon
    • The blank browser scares many people
  • AW: When you get the iPad, it’s totally useless until you put apps on it
  • From content perspective: Google prioritises quantity of content, whereas apps can highlight small limited quality
    • For example, instagram has many less features than flickr but has grown to 5 million users very rapidly
  • Flirtomatic — iPhone native has 11% revenue from 0.8% sessions…
    • and Mauricio is on Team Web…?
  • At Tesco, have seen that mobile web used for research but not for re-use and habitual long-term usage
    • app use encouraged by push notifications and widgets
  • 1 in 4 mobile searches in the US are on Google Voice search
  • Mobile web seems to be doing well for mail order & delivery shopping sites — searchable content with larger payments
  • Tesco made money back from iPhone app in less than a week
  • Targeting mobile devices: build it and see who comes, then target appropriately

Summing up — pro apps

  • Tangibility
  • Ownership & engagement
  • Native apps are faster
  • Using hardware
  • Lots of web browsers available, but are they ever going to be your customers?

Summing up — pro web

  • Don’t just target the rich west — reach beyond
  • Discoverability for apps can be one of the biggest problems

Q & A

  • What about using web apps on a long flight?
    • Not really
    • but this is possible now
  • Hard stuff: two-way voice with echo cancellation etc?
    • Not in a web app
  • Fragmentation of web browsers?
    • Design your site appropriately: it depends on who you want to target, but it’s still a larger number than just iPhone apps
    • e.g. target a touch-enabled mobile site and get both iPhone and Android at once
  • Mobile social
    • Good example of having both a mobile web and native strategy
    • e.g. Facebook native users add photos more; web users add quick status updates
  • Mobile ads — is there a problem keeping competition away from apps?
    • Tesco doesn’t have external ads in their apps
    • The end-user wants the curated experience…
  • Testing across multiple devices?
    • AW: It’s a problem for mobile computers — they don’t work some of the time…
    • AW: Apps are a reliable experience
    • The mobile web is no better and sometimes harder
  • Apps are good for some things and webapps are good for others… It’s like asking a carpenter which is the better tool: a hammer or a saw?
  • Monetisation?
    • Not for web games… yet
    • Flirtomatic has in-app purchases of virtual currency, but it’s a whole range of transaction
  • How do costs compare for native vs web?
    • It depends… You can spend more or less on each
    • Tesco: cost seems quite similar — especially since mobile dev has to be optimised for various devices
  • App-store owners take a cut; will it be the same for web?
    • probably — billing partners will always take a cut…
  • Will it be a digital divide between those who have apps and those that don’t?
    • Some people just don’t want apps on their phone — e.g. mother has a binatone phone with big buttons and doesn’t even use a mouse
    • There’s just a time lag to the rest of the world
  • What about lock-ins?
    • By choosing HTML, your development environment is free from manufacturer tie-ins
    • However, by choosing HTML, you play into the hands of Google making things free, operator content filtering etc.
  • Mobile web currently over-promises and under-delivers, but we’re all hedging our bets as mobile web catches up…?
    • Panel: yes!
    • BR: mobile web is catching up very fast, and depending on your business may already be a better bet
  • How do you find where your customers are?
    • Analyse the web browsers of your mailshot emails

Notices

Thursday, 28 October 2010

Droidcon London 2010 - Day One

I’m heading home with my brain stuffed full of new knowledge from Droidcon London 2010. And this was just the first day, with unplanned, unprepared barcamp-style presentations!

Most of the presentations today were technical (tomorrow there’s a design and business thread as well) but they varied from doing continuous integration through discussing low-level TCP details to a Q&A session with some of Google’s Android team.

I’m seriously looking forward to the second day’s programme.

In the meantime, here’s my notes for the sessions I attended:

Android UI tricks from Sony Ericsson

  • limit of 200ms to respond to user interactions — don’t do long running tasks in the UI thread
  • so how do you deal with longer lasting processes? use the Handler & Service classes
  • …and use Toasts to show quick popup status
  • number of devices on 1.5 is below 10%
  • all demos will be available on the Sony Ericsson developer blog

Handler

  • don’t use inner class Runnables inside a Handler (save heap & garbage collector)
  • within XML use onClick for buttons
  • handler.sendEmptyMessageDelayed(message, delay);
  • then have a message handler that deals with loop & sends next message
    • any UI activity should be in a Runnable called with runOnUiThread(runnable)
  • don’t forget onDestroy

Service

  • used for downloading
  • pass a message from service to activity by implementing your own Application class
  • Application defines callback interface and methods to fire & receive
  • use IntentService for your service
    • deals with sequential handling automatically
  • call to the application (need to cast getApplication())
  • don’t use AIDL interfaces — unless you want to share service with other apps or between multiple processes in your app

Animation

  • create an AnimationSet and add Animations within the getAnimation call
  • second parameters for RotateAnimation are relative to view, not screen
  • can also do animations in layout.xml
  • Twitter app removed animations from their home screen…
    • the background was a live wallpaper — consumes a lot of battery
    • continuous animations can use up battery so be careful
    • shouldn’t be a problem with performance though
  • see also Zooming demo and

BootListener

  • when the phone is rebooted, the alarms are cleared
  • don’t listen for boot completed unless you really have to
    • slows down startup if you have too many
  • can have a broadcast receiver that is disabled
  • in app xml set bootlistener disabled by default
  • then in listener when intent comes through: {{{ context.getPackageManager().setComponentEnabledSetting( new(ComponentName(context, BootListener.class), PackageManger.COMPONENT_ENABLED_STATE_DISABLED, PackageManager.DONT_KILL_APP) }}}

3D & OpenGL with Android views

  • combine the strengths of Android views (text, layout, etc) with OpenGL (3D but not text)
  • create a bitmap
  • use MeasureSpec method
  • draw the view onto the OpenGL texture bitmap
  • GLUtils.texImage2D(...)
  • if you do this today, suggest you use OpenGL ES 2.0

Location services

led by Nick Black, Founder & Head of Products at Cloudmade

cloudmade

  • cloudmade will support Android later this year with a Maps SDK
    • based on OpenStreetMaps
    • worked out a way to squeeze vector data onto the device
    • map data comes as you need it and is stored locally on device
    • downloadable data includes searchable street names, etc
    • early access available end of this year, early next year
  • cloudmade also has http://maps.cloudmade.com/editor to let you choose and configure your design —- your style will work on mobile too!

Impleo

  • formed from ex-Motorola & Alcatel employees
  • also adding tracking for insurance
    • includes accelerometer info so can tell how good a driver you are!

cloudmade location-based advertising

  • created a network that finds highest value ads from other networks
  • goes out to other ad networks, will also go out to more specialist networks
  • trying to deal with the fill-rate problem…
  • some android apps got backlash when adding advertising after the app release
    • put the ads in at the beginning!

map data

  • most owned by Google, Nokia or Tomtom (Navteq)
  • skobbler Android app - built on cloudmade’s navigation service
  • cloudmade see navigation services not as an app but as a feature within apps
  • Google don’t allow access to driving directions API on Android

google latitude and other services

  • Is anyone using the latitude API?
  • GPS in Android drains the battery quite heavily
  • if things are further away then turn off GPS temporarily
  • battery management isn’t good built-in
    • have to manage your own choice between coarse and fine location services
  • Motorola went to use Skyhook instead of Google location API on Android
    • that way they would get data for their customers WiFi location
    • Google forced them to switch back to Google location
    • Skyhook now suing Google…

Always in sync client & local unit testing

Carl from Novoda (@charroch)[http://twitter.com/charroch]

RESTProvider

  • available on github
    • depends on JacksonJSON etc
  • makes a RESTful API available as a Content Provider
  • couple of branches — caching_carl one stores locally in SQLite
  • can start service with loads of requests — it will handle them in a queue
  • can add params: putExtra("params", new List(...))
  • Tip: adb shell setprop log.tag.Database VERBOSE
    • slows it down a lot
    • can add your own tags too
  • ResultReceiver: a way of passing back status to app UI
  • if connectivity is lost, it stops the queue
  • need to watch out for the user setting to disable background downloading
  • extend HttpQueuedService
    • override getMarshaller
    • create a LoggableJsonRequest with a marshall method to store data using a ContentProviderOperation
  • library supports ETags too — saves a download as server data is just a HEAD response
  • also created novoda.mixml (minimal XML) which works in same way as Jackson JSON
    • integrated into RestProvider to cope with XML content as well as JSON
  • hopefully have time to build a more stable version over the new year
  • end goal: to have declarations in application XML and service definition

Unit testing of android classes without emulator

  • see also the RestProvider code on github
  • android.jar only contains stubs, so can’t even instantiate
    • major problem for your subclasses even when you only want to test your additional methods
  • PowerMock works somewhat
  • need to find a different way of doing the tests
  • Carl has copied the source of the Android classes into his test source and modified them to ensure no call to the system…
    • not too hard — just need to ensure that the constructor can work
  • have to keep your code copy up to date with the base Android source
    • but it doesn’t matter that much as you won’t be testing Android code
  • possible next step: Android will run on Intel — could run locally with unit tests
  • currently have three projects:
    1. main classes
    2. local tests using this mechanism
    3. instrumentation tests
  • changing to have a single folder with tests marked with annotations
    • want to have some tests marked as local if possible
    • android instrumentation tests should run all of tests (including local tests)
  • maven could be overkill for Android development
    • build process is quite well-defined, not that many other libs
  • SBT could be interesting (simple build tool, written in Scala)

App Analytics from Capptain

  • combining in-app analytics with CRM
  • collect/measure -> analysis -> engage
  • send messages to users and get feedback
  • SDK available in Android and iOS
  • similar services: motally (acquired by Nokia) & xtify
  • released beta two days ago
  • have REST/JSON API for data
    • not publicly available right now, but available on a case-by-case basis
  • also have a real-time API

  • pricing:

    • free during beta period
    • haven’t decided pricing structure
    • probably freemium — pay for additional functions/users

new analytics capabilities

  • how long users are spending in each screen of your app
  • really nice user path — based on screens, not events
  • real-time analytics — can monitor where people are in your app right now
  • crash logs with device, firmware, etc details
  • as per other analytics, store data locally and send later if not connected
  • Android SDK automatically picks up activities

CRM

  • announcements and polls
  • target by carrier, country
  • test before publish by sending to a single device
  • schedule for particular times

Qualcomm Alljoyn

http://developer.qualcomm.com/dev/alljoyn-p2p

  • exposes a shared communication bus based on DBus
  • automatically uses Wi-Fi and Bluetooth as device allows
  • Java and C interfaces
  • Java interface lets you just send/receive/call POJOs
  • Wi-Fi uses mDNS to find services by well known name (a URI)

Continuous Integration with Maven & Hudson

Hugo Josefson from Jayway (founded Maven Android plugin)

http://code.google.com/p/maven-android-plugin/

Slides and Hudson installation script available from http://code.google.com/p/maven-android-plugin/wiki/Presentations

Android and Maven

  • there’s also a proguard plugin — can use to trim unused classes
  • maven can handle inter-project dependencies
    • keep pure Java code in a Library (so can have local unit tests)
    • then can have app depend on library and on-device tests depend on app
    • see Samples project for MorseFlash example
  • there’s also an Eclipse plugin that helps ADT & Eclipse understand that they’re dealing with Maven
  • the process that takes the longest time is the DEXing

Android, Maven and Hudson

  • don’t see any reason to run Hudson in Tomcat — it comes with its own webserver
    • though it should work fine within Tomcat too
  • Android emulator plugin for Hudson: http://wiki.hudson-ci.org/display/HUDSON/Android+Emulator+Plugin
  • emulator settings: 2.2, mdpi, hvga, en_US, 64M
  • can loop through different settings for emulator
  • Hudson server needs some X libraries but will still run headless
  • currently don’t find out which tests fail when Android tests fail — have to look at logs

Google Q & A

I only noted down one question from the second Google Bootcamp Q & A session:

  • can you target apps at Android tablets?
    • can target large screen devices (currently Galaxy Tab + Dell Streak)
    • will also hit Evo 4G as that has hi resolution too, but smaller screen