DroidCon UK 2015 day 1

9.00 Keynote: The long road
Speaker: Sandro Mancuso

Inspirational talk about how to find the job that will be the next step in your career.
Your personal career goals can be very different from a career within a company.

10.30 RxJava – Get Reactive
Speakers: Pascal Welsch and Wolfram Rittmeyer

RxJava
Beware of backpressure (items emitted too fast) discussed on Wiki as well. Possible solutions:

  • Throttle
  • Buffer
  • Request(n) upstream items

Testing: Use TestSubscriber.

RxAndroid
RxJava bindings for Android.

RxBinding
RxJava binding APIs for Android’s UI widgets.

Type and make network request handling, i.e. type and search. Add the following:

  • .throttleLast(100, MS) – Emit the most recent items emitted by an Observable within periodic time intervals.
  • .debounce(200, MS) – Only emit an item from the source Observable after a particular timespan has passed without the Observable emitting any other items.
  • .onBackPressureLatest() – Is there are still too many, take latest input.

RxLifecycle
Lifecycle handling APIs for Android apps using RxJava.

Other recommendations

  • Mosby – A Model-View-Presenter library for modern Android apps.
  • Nucleus – Nucleus is a simple Android library, which utilizes the Model-View-Presenter pattern to properly connect background tasks with visual parts of an application.

11.30 Gradle (performance)
Speaker: Etienne Studer

Gradle is more than just building. It can also be used for releasing, documentation, etc.

  1. gradle build --rerun-tasks

Rerun tasks even if they are up to date.

Performance improvements:

  • Incremental build feature. Define inputs and outputs for custom tasks.
  • Continuous build feature, faster compilation.
  1. gradle test -t

(Relies on inputs and outputs being defined.)

MOOC: Gradle for Android and Java.

12.30 Land’s End: Creating the flagship mobile VR adventure
Speaker: Peter Pashley

Getting started: Install Unity! and the Oculus SDK.

Nausea

  • Frame rate
  • Texture
  • Don’t highlight lack of positional tracking (Don’t put objects close to user so they won’t try to step / look around it.)
  • Acceleration is bad!

Input

  • Gamepad (Reminds user of the world they are not in.)
  • Gear VR
  • “Gaze” (Look points)

Things that didn’t work

  • Moving things on rails or predefined paths. Limits the user’s freedom.
  • Buttons. Too easy, too little player reward.
  • Unconstrained exploration. Take a wrong route, takes a long time to get back.
  • Path hinting. Focus becomes on following the path and not exploring.
  • Levitating huge objects. Obstructs points of reference and makes players motion sick.

Lookpoints

  • Focussing, aim and hold.
  • Motion, knowing where you’re going to stop moving.
  • Placement, not too many near each other.

14.15 ClassyShark Attack
Speaker: Boris Farber

Fast decompiling/debugging for Android APKs.

Ctrl + s – Save Java file.

Supports 5 binary formats

  • Jar
  • Dex
  • APK
  • Manifest
  • Java class

Project site: https://github.com/googlesamples/android-classyshark

15.15 $N tips for building better apps.
Speaker: Wojtek Kalicinski

Stop running your code
Don’t cram too much into Application.onCreate(). ContentProviders and BroadcastReceivers can cause the method to be invoked.
Solutions:

  • Defer work, lazy load.
  • Stop Services.
  • Disable BroadcastReceivers.

Permissions

  • Use ContentProviders to share files and/or get rid of permissions.
  • Use Intents to get rid of even more.
  • Runtime permissions. <uses-permission-sdk23>
  • AccountPicker.newChooseAccountIntent()

Low memory devices
ActivityManager.isLowRamDevice(), available in M, use

  1. android:extractNativeLibs="false"

Native library cannot be compressed and need to be zipaligned (zipalign -p). Write a small bash script to repackage .so when APK is built.

Accessibility
Accessibility is important, you get a bonus for it.

  • Settings > Accessibility -> Talkback
  • Add android:contentDescription tags. Set it to something meaningful. (For decorative elements, set to @null.)
  • onTouchListener, don’t insert click logic, use View.performClick()

Bonus: No extra work when integrating with the accessibility assistent.

16.15 Democamp Community Demos

  • Lumi Social News – Tinder for news.
  • SendTo – Send messages, text, links, etc to your own devices.
  • Myntra – Fashion / Shopping app. Preloading content for fast user experience.
  • Infinity Loop – Game
  • Sharp SVG lib
  • Lunchbreak (Belgium only) – Order lunch online
  • UI testing in your browser – ??
  • Frisbee GDG – All GDG content in one place.

17.15 Keynote: Managing Expectations: A Manager’s Guide for Managing to Manage Unmanageable Teams Manageably
Speaker: Chet Haase

Hilarious talk about management.

Other

  • Lands of Ruin – Lands of Ruin is a tabletop game where tablets replace classic rulebooks, character cards, stat sheets, and pen-and-paper calculations.
  • Land’s End – Mobile VR game.
  • Vysor – Lets you view and control your Android on your computer. Easy peasy.

More messing around with Unity3D

Last week I spent some more time experimenting with Unity3D. My friend Erik is a 3D artist and give me this German tank to use for my experimenting. I couldn’t resist and build a completely politically incorrect scene with this, so – as I live in London – I decided to recreate the Big Ben, Parliament and Westminster Abbey.

Tank

[Click the image to play]
Controls:
Move: w,a,s,d
Toggle camera: c

Drive around, enjoy the view and then destroy it! 😀

I must say Unity3D is absolutely amazing! This whole thing took me about 16 hours to build and most of that time was spent in getting to know the GUI. This demo includes some physics, particles and a whooping total of two scripts. It only took two very small scripts to get that whole thing to work, how awesome is that?!

Links:
Tank demo: http://ansuz.nl/toys/unity3d/tank/
Move script: http://ansuz.nl/toys/unity3d/tank/Move.js
Toggle Cam Script: http://ansuz.nl/toys/unity3d/tank/SwitchCamera.js
Erik’s portfolio: http://pilsje.net/erik/

First Unity3D experiment

I started doing some experimenting with Unity3D and I must say I love it so far! 😀
As a first test I wanted to be able ‘drive’ a simple car and have some collision detection.
One problem I ran into was being able to switch cameras. There is no method available at the moment to retrieve all cameras in a scene, what you can do is retrieve all enabled cameras. What most people, including myself, end up doing is creating a script that allows you to set an X number of cameras and you toggle between those.

My first Unity3D test

Click the image to see my first test running.

Controls:
Move: w,a,s,d
Toggle camera: c