Showing posts with label sync. Show all posts
Showing posts with label sync. Show all posts

Tuesday, 29 October 2013

Droidcon 2013: App to App — design & surface local APIs

Ty Smith, Twitter (ex-Evernote) @tsmith

  • e.g. Samsung Note S Note app — locally synced with S Note grouping in built-in Evernote
  • tapping on a note in Evernote, opens it in S Note; then back button goes back to Evernote

intents

  • when sharing content to another activity, need to provide URI permission
  • when offering edit, you shouldn’t send your original file
    • the third party might crash, corrupt, etc
  • also can’t rely on setResult
  • user might hit back and think their changes will be saved
  • set last modified — when activity returns can check to see if changed — then offer user to save if they want

content providers

  • can provide temporary permissions to access provider in an intent
  • can pass through file handles

account manager

  • see an example in the open source github app
  • can request an authenticated token
  • makes accounts visible to user in a standard place
  • can do OAuth1 or 2
  • has method to refresh OAuth2 token automatically

sync adapter

  • does a lot of management for you automatically (network, battery)
  • again, can expose to third parties
  • can be scheduled & started with cloud messaging
  • requires content provider & account manager
  • but watch out for all the syncs coming at once
    • especially as networks often send out heartbeats on the hour every hour
    • devices wake up and think: I might as well sync now…
    • Evernote received DDoS load spikes…
  • so add a jitter to the sync period (random 1hr -> 1hr5min)
  • also add a “wait until” in the sync adapter — do your own checking

bound service

  • much stronger contract than others
  • other apps need to include your AIDL source code
  • example: plugins for DashClock

tips

  • testing is hard
    • use mock integrations
    • hard to debug integrations
  • add analytics to the lower level components so you know what’s going on
    • might want to consider rate limiting
  • use crash reporting (plug for crashlytics, now owned by twitter)

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.”

Tuesday, 5 March 2013

NSConference 5: Day Two

Thriving in an App Store World

Michael Jurewitz @jury

Jury used to be an Apple Developer Evangelist. He is now Director of Product Development at Black Pixel.

work well with apple

  • need to be looking forward - focusing on future (tech/features/hardware)
  • stay on the radar of apple contacts
  • Apple looks at devrel as “animal husbandry” :-)
    • Apple wants to sell devices & make customers happy
    • so apps should feed into that
  • Apple has laser focus on future and simplicity
    • expecting & embracing change
    • they force themselves to keep going forward
    • won’t look at apps that don’t fit in to that
    • must stay current
  • no secret agenda, but often hard choices
  • can get featured by taking advantage of new OS features
    • but it’s a time limited offer…
  • example:
    • Eventbrite getting featured on Passbook feature page increased new user sign up by 664%…
    • got in right at the beginning – only 15 apps on the feature page
  • “if users aren’t upgrading their OS, they probably aren’t buying your software either” - Wil Shipley
  • Gatekeeper vs App Store: e.g. Kaleidoscope
    • if you buy Kaleidoscope on Mac App Store then you can also download direct
    • app will notice that it’s already been purchased
    • will check receipt and unlock automatically
    • useful for sending customers beta builds when testing fixes
  • file bugs
    • also for requesting to open APIs that are currently private
  • localisation:
    • Apple sales in China increased 400% last year
    • Germany has a strong software market, even though it’s limited in size
  • accessibility creates loyalty

properly value your work

  • Jury did some research over the past weeks…
  • top paid apps have much lower mean & median prices than top grossing apps
    • mean: paid $12.46 vs grossing $49.13
    • median: paid $6.99 vs grossing $29.99
  • two separate markets going on here
  • top grossing has:
    • 200% more Finance apps in top grossing at the moment
      • because it’s tax season at the moment in the US
    • Utilities drop by 25%
    • 22% more Games
    • 50% more Graphics
    • Social drops in half (and would be nothing without Tweetbot)
    • No Weather apps
    • 3-5 Business apps vs none in Top Paid
  • four free apps in Top Grossing
    • in-app purchases
    • freemium can work
    • talk to Kevin Hoctor who did in-app purchases in Moneywell Express
  • cheap apps get downloads, but higher priced apps pay the bills
    • which would you rather have…?
economics 101:
  • price elasticity of demand
  • how does adjusting the price of a product affect the number that you sell?
  • elastic (e.g. social apps):
    • there’s a common price that people expect
    • if you increase the price beyond that, then demand massively decreases
  • inelastic (e.g. drugs… or photoshop…):
    • people will pay pretty much whatever you ask
    • keep increasing the price and maximise revenue
  • demand curves can move due to marketing campaigns…
  • if you double the price, and you lose less than 50% of your customers, you’ve just made money
    • and fewer users means less support costs
    • also increases perceived value
  • don’t be a commodity — charge what your software is worth

price your app intelligently

  • market segment:
    • lots of basic research
    • category prices
    • start research before starting developing
  • research competitors
    • do you have a big enough differentiator?
  • make a guess
  • then try an experiment
  • example: Kaleidoscope 2
    • developer tool segment: avg price $30.11
    • other apps $70-100
    • app is useful but not crucial
    • lots of alternatives
    • guessed $34.99 intro and $69.99 ongoing
    • got various peak sales that affected average
      • great for recouping costs, but not for calculating ongoing revenue
    • evaluation:
      • elasticity = % change price / % change in quantity
      • with a couple of price changes, you can work out the ratio
      • then apply to price changes to predict quantities and therefore revenue
      • (real world demand curves aren’t linear, so elasticities aren’t actually constant)

Talking to Hardware

Alasdair Allan, Babilim Light Industries @aallan

  • Apple’s External Accessory Framework is missing most of the useful stuff
    • rest is protected by Made for iPhone program
    • which is protected by massive ranks of lawyers
    • because Apple want to protect their platform

crazy stuff

  • jailbreaking
    • average time between a jailbreak release and Apple shutting the hole is about 7 days…
    • can’t release an app to the store
  • MIDI
  • simulate capacitance touch using a piece of foil stuck to the screen
  • PeerTalk: using the USB sync cable
    • uses TCP sockets
    • same protocol as iTunes and Xcode

less crazy stuff

  • wifi is possible, but getting setting up is a pain
    • and there’s lots of support issues for different network situations…
  • acoustic coupling via the headphone jack
    • Square does this for a card reader
    • can even use the audio to provide 7.4mW of power (see Hijack board)
  • Redpark cable
    • dock connector to RS-232
    • comes with an SDK
    • but won’t let you put apps in the store — have to approve the app and the hardware
      • you can approach Redpark and ask them to request approval
      • a lot less expensive than going through MFi program
  • XBee & Zigbee (802.15.4)
    • mesh networking for low data rates
    • dock connector to XBee adapter soon available from redpark
  • bluetooth 4 (low energy)
    • can run for months with bluetooth active powered by a coin cell
    • introduced with the iPhone 4S
    • lots of boards available with Android & iOS SDKs
    • e.g. red bear labs
    • use CoreBluetooth plus board’s SDK
    • easy integration:
      • Alasdair did a live demo in just a few minutes
      • connected to arduino over Bluetooth 4 from iPhone and toggled an LED

TouchDB

Matias Piipari @ms2

https://github.com/couchbase/couchbase-lite-ios

  • CouchDB has been renamed as CouchBase Lite
  • TouchDB is document db with CouchDB-like API
    • but uses SQLite under the hood
  • sync & share with CouchDB (or TouchDB)
  • concurrency controlled like git
    • when you’re saving you have to be up to date first
  • lightweight
    • < 500Kb in app binary
    • 0.1s startup
  • Document <=> Model, with versions
    • can also contain attachments
  • use Views to define queries by property
  • once you’ve configured the replication it will keep going
    • don’t need to worry about network availability
    • do need to think about conflicts
    • do need to think about concurrency with data changes (get notifications on changes)
  • can create push and pull separately and to/from different destinations
    • e.g. combine pull from bundled with pull from remote
  • sync handles https with basic auth or OAuth
  • can combine db from iCloud/Dropbox with TouchDB

Step away from the screen

Nathan Error, Empirical Development @neror

nathan@empiricaldevelopment.com

  • your body is a tool too: improve your coding by improving your body’s effectiveness
    • exercise, diet & sleep…
  • scientometrics
    • measuring rate of change in science
    • rate of output increases by 7% each year
    • output doubles every 10-15 years
    • so whatever we think now will probably change several times over the next 10-15 years
  • maybe start looking at meat more as a side dish rather than a main
  • recent research has linked high intensity aerobic exercise to increased brain performance
  • missing one hour of sleep for a week is equivalent of a blood alcohol level of 0.2%

Subscription pricing

Manton Reece @manton on ADN

manton@manton.org

  • in 1999 working on a Mac app that cost $199
    • actually considered pretty cheap for the time
  • benefits of subscriptions
    • happy customers:
      • unhappy customers can cancel at any time
    • automatic paid upgrades
      • everyone is on the latest version
      • paying for the service
  • to justify subscription, app and service need to be one
  • examples:
    • adobe: switching to creative cloud monthly subscription
    • microsoft: office is now $9.99/month (or $99.99/year)
    • billings pro:
      • free for 1 invoice/month
      • 5 invoices/month = $10
  • focus on the consistent predictable part of the graph rather than the spikes
    • even if you don’t make more sales, the revenue is consistent
  • billing periods
    • payment percentages affect revenues: charging less often means less percentages to payment provider
    • Manton found that 57% of customers preferred yearly billing
  • hosting costs
    • use Amazon reserved instances if you’re committing to a year (saves money)
  • Stripe is leaps and bounds better than paypal…
    • but only available in US and Canada
    • beta coming to the UK this week!
  • Apple in-app purchase types:
    • non-renewing subscriptions: cancel is the default — will probably lose a lot of people
    • auto-renewable subscriptions: better, but more restrictions on review — including privacy policy & description
      • Apple are very cautious about letting non-magazine apps do this

The “Simple And Intuitive” Fallacy

Why we need standards for complex UX, too

Joerg Schweider @cooliopenguin

iPeng

  • iPhones & iPads are not just accessory devices — they are becoming the main device in a lot of cases
  • apps need to be feature complete
  • if you simplify and cut out features then a lot of users will be left out in the cold
  • what makes a more intuitive UI?
    • can’t always find out by getting people to compare UIs
    • they will rate familiar schemes higher

Being Naive

Rob Rhyne @capttaco http://martiancraft.com/

  • “just build something so I can show it to the client”
  • users don’t care about engineering
  • iterate and test
  • at martiancraft, within three weeks of a new project you’re going to see something
    • it won’t be finished, but you can play with it
  • brent simmons: anatomy of a feature
    • the feature is the smallest part
    • it’s all the edge cases and polish that take the time
  • the naive implementation
    • demonstrates the feature
    • most obvious solution
    • takes the least amount of time to develop
  • example: histogram of live video
    • can use Accelerate framework to get histogram data from an image buffer
    • what about drawing the graph?
      • 3rd party charting lib: not obvious; little work; may demo but might not animate
      • OpenGL vertex buffer: not obvious; lots of work; will demo
      • CoreAnimation: obvious (when experienced!); little work; will demo
    • used CAShapeLayer
      • had used previously in Minds of Modern Mathematics
      • 14,000 pixel wide scroll view on an original iPad
      • can set up style once and draw separately
      • path was animatable property
  • http://giveabrief.com
    • codeless prototypes

Working on Sketch

Pieter Omvlee, Bohemian Coding

  • Sketch: vector art app
  • have to persuade users to try us rather than Adobe
  • don’t want a public feature list with voting
    • sets unrealistic expectations
    • there will always be business goals or technical issues that mean that highly requested features remain unfixed at the top
  • listen to your customers, but only to a certain degree
  • started giving away beta versions of app
    • got lots of testers & feedback
    • keep the fans happy
    • they’re very vocal and will do marketing on your behalf
  • don’t leave refactoring until the next big update
    • you’ll want to focus on new visible features to justify the upgrade price
    • customers don’t care about engineering
  • be practical with your time
    • don’t spend time on rewriting git history
    • focus on pricing, attracting the right customers, etc
  • put in crash reporting early
  • videos are excellent promotion & support
    • they take time and lots of takes
  • try and keep in contact with your customers
    • Apple gives you no way of getting in touch with App Store customers
    • but you could ask for details within the app
    • if no newsletter, then Change Logs are your only communication medium
    • “bug fixes” is a waste of an opportunity
  • try and contact bad reviewers

Introducing CoreValues

Scott Morrison (Chief Cook & Bottle Washer), Indev Software @smorr

smorr@indev.ca

  • Indie developer, less Independent, more Individual
  • but not just single person
  • instead individuality & personal
    • personal investment, principles, impact, payoff & risk
  • personal & professional roles are mixed
  • indie company has the heart of the indie developer
  • values are important and define you
    • but sometimes not thought through
    • can lead to inefficient decisions
  • Edward de Bono: if you want an out of the box solution, get out of the box first
    • PO statement — an unconventional (silly) idea used to generate ideas
  • introducing CoreValues: an objective-c framework for describing and defining personal and professional values…
  • interfaces:
    • personal ≠ private
    • professional ≠ public
  • (there was much more in this vein: thought-provoking metaphors, but I didn’t write them down)

Slightly Unsupported — Finder Code Injection

Steve Flack, Bromium UK

  • wanted to add icon badges & contextual menus
    • not based on file type
    • animated
  • used class-dump, x86 disassembler plus lots of trial & error
  • inject code with mach_inject
  • Finder has four methods to swizzle for icon badging
    • one for each view (desktop is fourth)
    • talk gave code specifics for each
  • only two methods to swizzle for contextual menus
    • desktop & grid view share
    • again, talk gave specifics

The Rise and Fall of a Mobile Startup

Emily Toop @fluffyemily

emily@emilytoop.com

  • Tiny Ears 2011-2012
    • app to teach reading to 4-6 year-old children using speech recognition
  • Emily and her partner Ian both got startups accepted to Start-Up Chile
  • had to get speech recognition
    • Google Voice API was best accuracy by far
    • PocketSphinx with OpenEars was only option with no network
    • but all were bad for children
  • can improve recognition with a better model
    • 20 hours to customise a model
    • no existing models for children
    • 20,000 hours to create a new model!
  • Startup Weekend
    • pitch your product
    • then recruit audience to work on it for 48hrs
    • make an MVP
    • really useful
  • talk about your product
    • to everyone
    • until you bore everyone
    • even yourself…
  • used AVAnimator to play movies with alpha channels
  • …but speech recognition model would cost $100,000 and take 18 months
  • then animators didn’t want to continue without speech recognition
  • make your partnerships sound!
  • don’t go alone
    • guides recommend that you have a hacker and a hustler
  • mothballed Tiny Ears
  • joined another startup to learn how startups work
  • getting more involved in education
    • joined Code Club
    • applying to be a reading assistant
  • approached by dreamthinkspeak to help with their “large-scale, site-responsive theatre production inspired by Leonardo Da Vinci, The Book of Revelations and the world of Mechatronics”
    • go see them while they’re still in London (until March 30th at Somerset House)
  • nothing you learn is ever wasted

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