Showing posts with label webkit. Show all posts
Showing posts with label webkit. Show all posts

Monday, 4 March 2013

NSConference 5: Day One

This was my first NSConference and I was impressed. Three days of full-on sessions covering everything from deep technical gotchas, through brutally honest experience reports and even across to basic economics lessons. And the people… I’ve never met so many iOS and Mac developers in one room. Everywhere I turned, there was a developer of an app that I’ve used or know about and admire.

Thank you so much to Scotty and the team. Everything (apart from the wi-fi!) went swimmingly!

iOS performance testing

Bill Dudney @bdudney bdudney@me.com

  • Double check performance even when you think you’re doing it right
  • Watchdog gives you lots of time but user expectation is instantaneous
  • You can use more time on suspend… but don’t go outside watchdog times otherwise app will have to start from scratch
  • Use Time Profiler to check CPU usage on startup
  • VM tracker tells you how much memory is dirty - most crashes come from here
    • Allocations can be low but dirty memory still high
    • e.g. Image allocations
    • Memory gets dirty as soon as you write to it
  • ARC deals with most of issues for you but won’t deal with cycles
    • Can see in leaks
    • Deal with by using weak references
  • Graphics
    • Quartz all happens on CPU
    • OpenGL happens on GPU
    • Separate processor - more power
    • CoreAnimation gives you access without writing raw OpenGL
    • It’s a compositing engine
  • Offscreen rendering can take up lots of time
    • Check offscreen rendering highlight in instruments

searching for speedy searching

Simon Wolf @sgaw or @sw on ADN

  • WWDC 2010 mastering CoreData suggests title contains[dc] $content
  • Can use beginswith to improve speed
  • Even faster use >= 'frog' and < 'froh'
  • But doesn’t work for in-word searching
  • SQLite with full text search FTS (or FTS3, older)
  • Have to build own version of SQLite and include in your app
  • And then can’t use with CoreData
  • Use FMDatabase & FMDatabaseQueue to behave better with threads
  • Use SQLite with FTS to create an index that refers to the Managed Object ID
  • otsNormalizeString string category to remove diacritics (in blog post)
  • FTS search is word based, * is wildcard
  • Can also define “nearness” of terms
  • Need to keep index in sync with CoreData

The ultimate developer toolchain

Richard Morton @richardmorton

  • “if you have a machine and don’t buy it, you will ultimately find you have paid for a machine and don’t have it” — Henry Ford
    • buy a decent developer machine!
  • iOS Support Matrix gives you a good way to find which test devices you need
  • Injection for Xcode: restores “Fix & Continue”
    • uses bundles & method swizzling
  • Xcoverage
    • LLVM provides build coverage
    • instrument program flow & generate test coverage files
  • Mogenerator
  • AppCode by JetBrains
    • would still do bulk of dev in Xcode but boot up AppCode to use refactoring & other unique features
  • Jenkins
  • PaintCode
  • xScope
  • ResourceHelper
    • extra QA for assets

Why making 12 Games in 12 months is a good idea

Matthijs Hollemans @mhollemans

  • lots of game jams around
  • why?
  • experimentation & innovation
  • learning how to finish
    • often there’s a long hard grind to finish
  • learn to limit your scope
    • one single thing
    • take idea and strip it to the core
  • putting constraints on what you’re doing enhances your creativity
  • also get experience in failing to finish games
    • good to find a way to fail faster!

UISS - UIAppearance on Steroids

Robert Wijas @robertwijas

  • UISS available on github & CocoaPods
  • UIAppearance & UIAppearanceContainer lets you set appearance defaults application-wide
  • but need lots of code to do anything…
  • UISS uses JSON syntax, similar to CSS
  • lets you set styles for inner elements
  • and also styles per device type (iPhone/iPad)
  • lets you define variables
  • easily disable bits by prefixing selector with “-“
  • setup:
    • [UISSS configureWithDefaultJSONFile];
    • add uiss.json file
  • debug: UISS status bar
    • tapping status bar shows errors in uiss.json
  • works with live updates in uiss :-)
    • just make uiss.json available via HTTP
    • [UISS configureWithURL:url]
    • let’s you build the app and give it to your designer to adjust, even without Xcode
    • debug option lets you adjust URL
  • generates UIAppearance code for you
    • you’ll want to do that before you create production code
  • can use UIProxy to control your own custom views with UIAppearance
    • also allows you to adjust them with UISS
  • other systems doing same thing:
    • NUI
    • pixate
    • both use traditional CSS - so heavier dependencies

Becoming a product company

Daniel Pasco @dlpasco daniel@blackpixel.com

  • started in 2007 as contracting but aimed from the beginning to be a product company
  • 6 people for 3 years, then doubled in size for 3 years
  • operate as a remote company, HQ in Seattle, but spread over US, with a couple in France
  • have shipped hundreds of apps, but all for other people
    • have a reputation for confidentiality
    • so can’t tell anyone about them…
  • there’s an opportunity cost to do product development
    • in the presence of lucrative contracts, you take a risk and turn away money
  • however, you get stability
    • find that contract work is busy Feb to July
    • occasional spike in November preparing apps for Xmas
  • did client work until they had enough money
    • then did some product work until money ran out
    • then swapped back to contract
    • big gaps between product dev
    • when went back to code, there were lots of changes to make with all the new knowledge…
  • initial product was Bistromath
    • massively over-engineered…
    • developed in a vacuum
  • need to share app with people who know nothing about how the app works
    • tester should not share any of your assumptions
  • life after being featured…
    • intense — but treat it as a bonus
    • people need to be aware of the app outside of the app store
  • painful first product experience made them very gunshy
  • learnings:
    • vet your ideas early on
    • get feedback on betas
    • no excitement? that’s an issue
    • if someone wants to extrapolate — that’s great! but leave those additional features for later
    • have a sustainable dev plan — through to the product release
    • check out marketing
  • changed business model:
    • grew contracting team so could subsidise continuous product team
    • could keep momentum going
  • got the chance to acquire three products from other developers (NetNewsWire, Kaleidoscope, Versions)
    • existing userbase
    • well-known brands
  • products acquired through revenue-share
    • no money up front
    • revenue share decreases as time goes on
  • wanted to share info & blog monthly, but…
    • have competitors: don’t want to reveal feature roadmap
    • no one knows if you miss a deadline: would have announced and missed three times!
    • no one knows if you drop a feature you promised
  • Apple will not let you transfer an app between accounts
    • unless you get the keys to the old account, customers will have to buy the app over again…
    • trying out introductory pricing on upgrades to help people recover their losses
  • iCloud sync issues with NetNewsWire
    • iCloud/Core Data: still unusable…
      • opening the iCloud container can take up to 25 minutes
    • iCloud/Key Value Store: works fine
    • iCloud/Ubiquitous Documents: has issues
  • got creative tensions from people caring so much about their own products
  • changed aim to be frequent, shorter, release cycles
  • got lost with features — endless ticket list
    • @jury drew a line in the sand: ship by this date
    • focus accordingly
    • the plan:
      • 4 weeks for feature complete
      • then 4 weeks for no P3 bugs (fix or defer)
      • then 2 weeks for no P2s
      • then 1 week for no P1 bugs
    • there will always be another release
      • if that isn’t built into your plan — change your plan!
    • it’s ok to ship with bugs, as long as they’re not blockers

Software Architecture: what questions to ask?

Jacob Gorban @apparentsoft

A short list of questions to ask when adding a new feature to your project:

  • good ideas are insidious: they increase scope
    • must definitely be worth adding…
    • here are some questions to think about before adding a new one to your project
  • is it really a good idea?
    • is it good for your business?
    • it it good for your app in the long run
  • is it DRY?
  • is it orthogonal?
    • good to have smaller pieces joined than one big piece
  • is it testable?
  • is there another way?
    • when you see a good move, look for a better one — Emanuel Lasker
  • what is the cost of changing this later?
  • what would the architecture look like if I didn’t have this problem?
    • is this problem framed properly for my app?
    • perhaps we can change the problem…
  • document the rationale
    • not just for later — helps you understand the problem
    • could also discuss with others
  • what are the facts and assumptions?

Download from http://bit.ly/software_architecture_tips_pdf

WebKit UI Inspector Tips and Tricks

Daniel Jalkut, Red Sweater Software @danielpunkass

  • use webkit inspector to fix a page for printing
  • prototype app store previews
  • can set inspector on in your own (Mac) app:
    • just add -WebkitDeveloperExtras YES argument
    • can add same preference on other apps
    • defaults write <bundle-id> WebkitDeveloperExtras -bool YES
    • or globally: defaults write -g WebkitDeveloperExtras -bool YES
  • Dictionary app uses a WebView… so you can inspect it!
  • preference key doesn’t guarantee that the “Inspect Element” menu item will be available
  • Mail.app is a very good robust HTML editor using a WebView but it overrides the contextual menu
  • for any process (even one that has custom contextual menu):
    • attach to target
    • break on [NSView menuForEvent:]
      • lldb: break set -r menuForEvent
    • ctrl-click in the suspected WebView
    • run code: [[[$rdi _webView] inspector] show:0];
      • event target is in $rdi
  • iOS webkit inspector can inspect Safari or any UIWebView in an app that you own

The Invisible Interface — Adding offline speech UI to your app

Halle Winkler @politepix http://politepix.com

  • large vocabulary tasks
    • use server-based speech recognition
    • UITextView, Nuance, AT&T, iSpeech
  • command and control
    • can use offline speech recognition
    • e.g. OpenEars
  • speech API dimension is time
    • make time, rather than just take time
  • small steps through decision tree, means small steps backwards
    • trust & quickly verify
    • switch between small vocabularies
  • watch out for “out of vocabulary”
    • what happens when people walk past talking loudly…?
    • it’s a solved problem in speech recognition, but deciding what to do is a design issue

Tuesday, 4 October 2011

Over The Air 2011: The FT Web app - We've Got a Website for That

Andrew Betts, Assanka @triblondon

  • An app is:
    • responsive design
    • responsive to human interface (mouse, keyboard, touchscreen, TV remote, …)
  • The Daily app is now generating less than 50 tweets a day (and still going down)
    • Down from over 200
  • iPad web app also works on other devices
    • not just tablets – phones too
    • currently only accessibly on iPad
    • works on Android & QNX but not released yet
    • Android imminent, QNX a few months
  • server serves the same code to all devices
    • client does customisation and caches as much as it can
    • so can go offline and still access pages
  • FT web app
    • 8 months with 3 people
    • then additional 4 months with same people to get Android & Playbook

issues

  • flowed columns and flowing text around fixed elements
    • adobe webkit fork has great flow additions - but not available on devices
    • css3 template layouts – but again not supported
    • so have to measure content and cut it into positioned containers using Javascript
  • content balancing
    • always show a whole number of items across the width
    • done by classifying devices into four groups according to screen size
      • small, medium, large, large wide
  • podcast pages
    • want to keep playing audio even when move to another page
    • put audio player at the top of the DOM, so not altered
    • entire app is in a single page – just swap content in and out
  • swiping between sections
    • continuous carousel made out of three divs
    • middle one is always the current
    • outer ones are preloaded as required
    • implemented swipes using touch gestures
    • have to do your own gesture interpretation
      • distinguish between slow drags and flings

tools

  • playbook has remote web debugging
  • WeinRE can do similar, but can’t debug Javascript
  • TouchScroll allows you to keep headers fixed and snap to columns when swiping across
  • web debugging proxies (e.g. Charles)
  • use desktop for layout, but real device for interaction (swiping)

discoveries

  • people use native apps differently
    • they tap lightly and fast
    • the web browser waits for fast taps in case there’s a double tap to zoom
    • if you don’t want double tap to zoom
    • Assanka made fastclick

offline access

  • launching app offline
    • need to specify URLs in app manifest
    • if you change a single file, all of the manifest needs to be re-downloaded
    • store as little as possible
    • the more you store, the longer your app will take to launch
    • iOS manifest is buggy – you can get name conflicts with other webapps
      • so make sure you give your manifest a custom name
    • development is hell – things get cached the whole time
      • instead, add a comment that changes every minute (for dev)
      • still leaves you time to refresh a few times to check the cacheing
  • manifest is no good for editorial content
    • local storage is much faster than SQLite
    • so if you only access by key then use it
    • you need permission to store > 5Mb
    • strategy:
      • launch app from web, just store <= 5Mb and prompt to save to home screen
      • saved from home screen, immediately ask for 50Mb and never ask again
    • images downloaded from server as base64 encoded strings
      • can combine images into single requests
      • and can then gzip the whole thing
      • stored in local SQLite
      • rendered into DOM as a data: URI
      • base64 transfer also avoids operator image recompression!
  • analytics
    • can’t use Google analytics
    • log user actions into local DB
    • POST the log when requesting updated content
    • on the server, rewrite the log into an Apache format access log

unresolved issues

  • SSL security: no browser chrome, so no browser padlock
    • trusted, because we tell you…
  • Social media integration – OAuth in separate window doesn’t work
    • have to reload completely when return to app
  • offline adverts:
    • not technically hard, but ad server companies don’t know how to deal with them
    • can’t retract the ad
    • can’t measure clicks
    • can’t click through at all…
  • automated QA – selenium doesn’t really work
    • ended up using lots of people and lots of devices

platforms

  • Android is by far the poorest web environment when compared with iOS and QNX
    • mainly due to lack of hardware-accelerated CSS transitions
    • so FT have a native Android app which has a single native component – the gallery to enable swiping
    • the rest of the app is HTML/CSS/JS
  • QNX has a native app too, but only to have a home screen icon and to provide distribution

Q&A

  • upset Apple?
    • probably not – FT are specific market
  • differences between web app and native
    • web has more sections than native ever had
    • web app preloads content, so people swipe more often
    • as a result web app gets much more interaction
  • is not appearing in the app store an issue?
    • yes, but instead making tactical native apps
    • e.g. FT Top 100 Companies – tells users if you want the full edition, go to the web app

Wednesday, 10 February 2010

O2 Litmus: Palm Pre Developer Event Part Two

This was the second O2 Litmus and Palm developer event in London. It was kind of hard to follow up on the first event at which all attendees got free Palm Pre’s, but they certainly did a good job. The food and beer was just as good as before and Dion and Ben know how to get developers on side.

First up was O2 with some updates on Litmus:

O2 Telefonica & Litmus

  • 7,000 customers now signed up for O2 Litmus
    • tech-savvy users willing to test new apps and provide ideas
    • To me this is the real strength of Litmus — it’s not just a developer program encouraging new apps. O2 are making use of the biggest advantage they have over a “dumb pipe” — their relationship with their customers
  • one shared mobile advertising org through whole of telefonica — starting to propose new advertising models:
    • click to call
    • click to receive an SMS
    • click to locate
    • receive an MMS with a map showing direction from where you are to the advertised location
  • developing O2 Priority Ticketing app
    • already available for iPhone
    • available on Palm in next 4-6 weeks through Litmus first
  • may open out ideas for developer community to build
    • especially around existing brands that don’t have a mobile presence
    • some private APIs may be available…

Palm Developer Evangelists

Ben Galbraith & Dion Almaer

  • app store growing fast (but linearly) since October, with slight acceleration
  • now up to 1,500 apps

Plug-in Developer Kit (PDK)

  • mechanism you can use to extend existing web environment — provides a plugin mechanism to the browser
  • will have a Flash plugin available to ship in Feb.
  • write code in C++ and have it available to the WebOS environment

Distribution

  • app data streams are available
  • visualisations appearing already:
    • Nicholas Felton — visualization guru
    • Project Appetite
      • allows you to send apps to the phone…
    • WebOS Schools
  • can get through app review in a couple of hours
    • that’s quick! where’s their team?
  • app catalog can act as intermediary, so can turn off a bad app
    • provides a quality source of apps
    • though you don’t have to go through the app store to make your app available

Editing — Project Ares

  • uses Mozilla Bespin (accent on the “e”), which Dion and Ben were involved with when they were working for Mozilla
  • enables you to drag and drop interfaces and build apps just using a browser

Incentives: Hot Apps Promotion

  • Most downloaded applications from Feb 1 to May 31
  • Separate pots for Free and Paid apps
    • Top 1: $100K
    • Top 20: $10K
    • Top 200: $1K
  • Will create a leaderboard in March
  • Can probably launch an app as late as April and still get a prize

European payment for app store

  • not here yet…
  • credit card to begin with
  • will follow up with operator billing, but can’t give any timings…
  • want to give as many options as possible to consumers
  • in-app purchases on roadmap too
  • app catalog releases may be restricted from their own purchase mechanisms to avoid confusion

Coding example

  • works a bit like rails
  • palm-generate -t hello.app <dir>
  • using palm-run wrapper script
  • can have multiple stages with multiple scenes
    • another stage might be notification stage
  • sources.json is where the first-assistant.js is loaded
  • prototype.js comes built-in
    • prototype can observe events and Mojo provides the touch events
  • can use standard media selectors to have different layouts per device
  • emulator is unable to play video
  • emulator always in charging battery mode
  • can see the source of all the Palm widgets
  • can turn on webkit inspector (palm-run -i) to dig in to any of the apps on the phone
  • although Mojo is the first attempt, you don’t have to use it — there are others… (pastrykit… :-) )

Q&A

  • push notifications?
    • Mojo messaging coming
    • provides unified mechanism for apps to work together to go to the network
    • saves battery life…
    • full multitasking with UI notifications
  • accelerated CSS transforms?
    • still coming soon…

Wednesday, 4 November 2009

O2 Litmus: Palm Pre Mobile Web Developer Event

Tonight was a really impressive event organised by O2 Litmus. The two guys from Palm did a very good job presenting WebOS and Palm’s plans for the future. The food and drink was excellent. And they even gave us a Palm Pre each to take home! Certainly makes me want to at least try out making an app.

As usual, here’s my notes for the evening in a vaguely coherent manner…

  • webkit appearing all over the place on mobile
  • as well as opera (there were a couple of people from Opera at the event)
  • HTML 5 is providing standardisation for web applications in the same way that HTML provided standardisation for web documents
  • web applications are escaping the browser:
  • why not flash, javafx or silverlight?
  • because:
  • “When you improve things by an order of magnitude, you haven't made something better — you've made something new” — Stephen Levy
  • Palm Pre uses V8 javascript engine, just like Chrome
  • WebWorkers provide background threads
    • came from Gears worker pool
    • invented to stop database access causing hangs
  • Chrome uses WebWorkers for extensions
  • Firefox hasn’t implemented SQLite, but may go for a JSON-based database, like CouchDB
  • CSS Transforms
  • “it’s not javascript people don’t like, it’s dealing with cross-browser issues”
    • anyone mention IE…?
  • “it’s not just going to be developing apps for Palm — it’s making things for the web”

some detail

  • Mojo Framework is open-source
  • Mojo uses prototype.js at the moment, but will be made nicer to use other alternatives later
  • dashboard items and popups are just DOM items
  • want to integrate apps into system — background apps

security

  • web browser provides normal web sandbox
  • applications get access to native services
  • certain APIs still need permissions granted
    • e.g. location
    • can get app to ask when API is used
  • would like to push local APIs to browser windows
  • apps are packaged and signed
    • working with developers to encrypt apps in different ways
    • would anticipate that developers would be able to opt-in to encrypt their app
    • protect against people uploading a copy of an app as their own
    • balanced against the benefit of view source on the web

app store

  • Palm would like a “web app store” to emerge
  • Palm doesn’t feel that it’s the right company to make this move
  • creating a Palm catalogue & developer program for mid-December
    • charging $50 for each app to be in the catalogue — as a spam filter
    • money goes to funding developing programme & catalogue service
    • interested in finding other “friction points”
  • can get an immediate acceptance into the web distribution of the Palm app catalogue
    • submit and get a URL straight away
    • can email/tweet other people
    • no review process
  • opening up the backend too — feeds of all the apps and charts
  • would like digg-style rating
  • a developer can choose to make an app available for specific markets
  • also aiming to provide metrics for developers, so they can see how users are choosing or not choosing their apps
  • payment:
    • right now they have PayPal
    • would like to support several options
    • want to decrease the friction

BONDI & others

  • palm works with them
  • including W3C widgets & geo
  • Palm way will be there originally, but will be switched out when
  • order depending on developer requests
  • native-accelerated CSS transforms are higher at the moment
  • “Palm pays us, but they didn’t pay us enough to sell out”

supporting open source

  • waiving cost for anyone working open source
  • $99 for developer

testing

  • O2 Litmus will be recruiting Palm Pre users for testing availability
  • DeviceAnywhere will feature Palm Pre in O2 VDL

feedback

  • devrel@palm.com
  • they already use Jira and want to open it something to the public soon
  • homebrew community will patch things before Palm do it themselves
  • there are differing viewpoints internally…

personal usage

  • like multi-tasking
  • don’t like UI latency
    • hardware is roughly equivalent to the iPhone 3GS
    • don’t have access to hardware GPU — so CSS Transforms is really important
    • will happen with a over-the-air software upgrade

multiple devices

  • Palm Pixi seems a lot nicer
  • different screen size (80 pixels shorter)
  • should design liquid layouts…
  • the future is devices in all kinds of form factors

tooling

  • there are tools for Flash — what about tools for WebGL, etc?
  • mozilla is making tools
  • e.g. Atlas from 280North
  • this week there may be something new released…
  • should flash be a native platform for apps on Palm Pre?
    • nearly supported for web pages — Adobe has shown something working already