Positronic Net

Better brains for your droids!

--- Robert Thau

Goals

What's that got to do with Scala?

Outline

A few words on Android

It's Java-ish. Mostly J2SE, but...

Android UI

UI Goals

Cut down on boilerplate: not this...

... but this:

A whole screen:

Another example:

Mapping data structures to the UI

Want to make things simple...

Setting firstName from firstName, etc., should not require much fuss:

But that requires:
  • Being able to say what "property" a widget relates to
  • Being able to get or set "properties" on the record

Where do those widgets come from?

Widget properties...

Properties/lenses

Lens factories

"Reflective properties": explicit getter/setter

"Reflective properties": implicit setter

UI binders

Binds properties of appropriate types to widgets with "matching" IDs.

Dealing with Data

Android UI --- DB constraints

Implications

UI will stutter or freeze if "UI thread" blocks for... So, don't do that!

How to do blocking work in the background?

So, borrow some better alternatives

Data repositories on Android

Basic concepts

Example: some simple data

Records ...

Records ... and RecordManagers

Futures

Scopes and Futures

Updates

(Partial) Message typing

Simple relationships --- schema

Simple relationships --- code

Mapping a simple content provider (1)

Mapping a simple content provider (2)

A messy provider: ContactsContract.Data

Data base class (simplified)...

Data subclass: StructuredName

Data subclass: Photo

Variant record managers

Other stuff

To find more...

https://github.com/rst/positronic_net
https://rst.github.com/positronic_docs.html