11. By the Numbers
Google Play
1 million apps available (July 2013)
50 billion apps downloaded (May 2013)
Devices
1.5 million activations daily (March 2013)
1 billion users (June 2014)
37. Document- Centric Apps
To create a new document:
Intent.FLAG_ACTIVITY_NEW_DOCUMENT
<activity documentLaunchMode=”always”>
Manage tasks via
ActivityManager.getAppTasks()
38. Material theme
background: card-shaped, shadow-casting
foreground: dark text and actions
all icons now treated as silhouettes
Accent color
Notification.Builder.setColor()
Everything else you know and love
Expanded views, action buttons,
custom views
Small icon badging
2014: Notifications in L
40. Heads-up notifications
Reserved for things the user needs to deal with
High priority
Involving people
Makes noise
fullScreenIntent
Designed to be easy to act on
and easy to ignore!
42. PUBLIC
(anyone can read)
AUTHENTICATION
(the lockscreen)
SECRET
(only you know it’s there)
PRIVATE
(only you can read)
VISIBILITY_PUBLIC
• notifications that are safe
to show outside the
lockscreen, out in public, to
anyone
VISIBILITY_PRIVATE
(classic Android
notifications)
• only icons visible without
authentication
VISIBILITY_SECRET
• invisible until you unlock
SPHERES OF VISIBILITY
publicVersion
44. OpenGL
OpenGL ES 3.1
NDK and SDK bindings
Backward-compatible with OpenGL ES 2.0 and 3.0
Compute shaders & separate shaders
Shading language improvements
Manifest
<uses-feature android:glEsVersion=“0x00030001”/>
Android Extension Pack
Superset of OpenGL ES 3.1
Tessellation, geometry shaders, shader storage buffers, images, and
atomics, etc.
45. Camera and Audio
New android.hardware.camera2 APIs
Fine-grained capture and image processing
RAW capture (DNG)
Programmatically access available devices
New audio buffering and encoding capabilities
Lower-latency audio input
46. Other Media Enhancements
MediaSession
Respond to transport controls
MediaBrowser
Browse media content exposed by apps
MediaProjection
Screen and audio capture
PdfRenderer
Render PDF as a bitmap
48. ART
Replaces Dalvik
Available in KitKat
Now enabled by default
Faster! Better! Newer! Cooler!
Ahead-of-Time Compilation
Smaller GC pauses
Dedicated space for large objects (bitmaps)
Moving collector (background apps)
Android Runtime
49. Power: Project Volta
Battery stats
$ adb shell dumpsys batterystats
Global and per-UID statistics
options: --help
Battery Historian (github.com/google/battery-historian)
like systrace for power events
Measuring your app’s battery efficiency
50. Power: Battery Historian
# turn on full wakelock reporting
$ adb shell dumpsys batterystats --enable full-history
# clear out old stats
$ adb shell dumpsys batterystats --reset
# now run your app, collect data
$ adb bugreport > bugreport.txt
# visualize!
$ historian.py bugreport.txt > out.html
Example
51. Power: JobScheduler
You want to do some work when:
data is cheap/fast
device is plugged in or idle
Possible to do this manually
… but now there’s JobScheduler!
intelligent background processing
52. Power: JobScheduler
JobInfo uploadTask = new JobInfo.Builder(jobId, componentName)
.setRequiredNetworkType(JobInfo.NETWORK_TYPE_UNMETERED)
.setRequiresCharging(true)
.setRequiresDeviceIdle(true)
.build();
JobScheduler jobScheduler = (JobScheduler)
context.getSystemService(Context.JOB_SCHEDULER_SERVICE);
jobScheduler.schedule(uploadTask);
example
53. Storage: DocumentTrees
If you’re using the new Storage Access Framework (API 19)
You can now ask for a whole directory!
@see Intent.ACTION_OPEN_DOCUMENT_TREE
Then explore the directory and its contents
@see DocumentsContract.buildChildDocumentsUriUsingTree(),
.buildDocumentUriUsingTree()
New tools for working with directories
55. Multi-Networking
When you need a particular kind of network connection
SMS
unmetered
specific carrier feature
ConnectivityManager.requestNetwork(NetworkRequest, NetworkCallback)
56. Bluetooth LE
Android 4.3: Bluetooth Low Energy (BLE)
New in Lollipop: BLE peripheral device support
Your app can can provide services and scan for services
android.bluetooth.le
" BluetoothLeScanner
" BluetoothLeAdvertiser