5 things that will change, break and help your app
Marvin Ramin
buildscript {
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0-<some alpha/beta version here>'
}
}
android {
compileSdkVersion 'android-N'
buildToolsVersion "24.0.0 rc1"
defaultConfig {
minSdkVersion 'N'
targetSdkVersion 'N'
}
}
Works with all Nexus deivces > Nexus 6
RIP Nexus 5
RemoteInput remoteInput = new RemoteInput.Builder(RESULT_KEY_TEXT_REPLY)
.setLabel("Reply")
.build();
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.mipmap.ic_launcher, "Reply", pendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = baseNotification(context, "Quick reply", "You can reply to this...")
.addAction(action);
RemoteInput remoteInput = new RemoteInput.Builder(RESULT_KEY_TEXT_REPLY)
.setLabel("Reply")
.build();
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.mipmap.ic_launcher, "Reply", pendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = baseNotification(context, "Quick reply", "Title")
.addAction(action);
RemoteInput remoteInput = new RemoteInput.Builder(RESULT_KEY_TEXT_REPLY)
.setLabel("Reply")
.build();
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.mipmap.ic_launcher, "Reply", pendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = baseNotification(context, "Quick reply", "Title")
.addAction(action);
RemoteInput remoteInput = new RemoteInput.Builder(RESULT_KEY_TEXT_REPLY)
.setLabel("Reply")
.build();
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.mipmap.ic_launcher, "Reply", pendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = baseNotification(context, "Quick reply", "Title")
.addAction(action);
RemoteInput remoteInput = new RemoteInput.Builder(RESULT_KEY_TEXT_REPLY)
.setLabel("Reply")
.build();
PendingIntent pendingIntent =
PendingIntent.getActivity(context, 0, new Intent(context, MainActivity.class), 0);
NotificationCompat.Action action =
new NotificationCompat.Action.Builder(R.mipmap.ic_launcher, "Reply", pendingIntent)
.addRemoteInput(remoteInput)
.build();
NotificationCompat.Builder builder = baseNotification(context, "Quick reply", "Title")
.addAction(action);
Bundle bundle = RemoteInput.getResultsFromIntent(getIntent());
if (bundle == null) {
return;
}
String replyText = bundle.getString(RESULT_KEY_TEXT_REPLY);
// Do something with the reply text
// You have to remove the notification once you're finished processing it
NotificationManager.removeReplyNotification(this);
Bundle bundle = RemoteInput.getResultsFromIntent(getIntent());
if (bundle == null) {
return;
}
String replyText = bundle.getString(RESULT_KEY_TEXT_REPLY);
// Do something with the reply text
// You have to remove the notification once you're finished processing it
NotificationManager.removeReplyNotification(this);
Bundle bundle = RemoteInput.getResultsFromIntent(getIntent());
if (bundle == null) {
return;
}
String replyText = bundle.getString(RESULT_KEY_TEXT_REPLY);
// Do something with the reply text
// You have to remove the notification once you're finished processing it
NotificationManager.removeReplyNotification(this);
.setGroup(ID)
Create summary notification
.setGroupSummary(true)
onTileAdded()
onTileRemoved()
onStartListening()
onStopListening()
onClick()
AndroidManifest.xml
<service
android:name=".QuickSettingsTileService"
android:label="N Playground"
android:icon="@drawable/wave"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
AndroidManifest.xml
<service
android:name=".QuickSettingsTileService"
android:label="N Playground"
android:icon="@drawable/wave"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
AndroidManifest.xml
<service
android:name=".QuickSettingsTileService"
android:label="N Playground"
android:icon="@drawable/wave"
android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
<intent-filter>
<action android:name="android.service.quicksettings.action.QS_TILE" />
</intent-filter>
</service>
Quick actions on Launcher icons
Can be added/removed dynamically
Accessed with "a gesture"
Possibly Force Touch?
Split-Screen mode
Picture in Picture
Freeform mode
Be careful with orientation
Be careful with the lifecycle
Activity can still be visible in onPause()
Fixed orientation disables multi-window
android:resizeableActivity=["true" | "false"]
android:supportsPictureInPicture=["true" | "false"]
<activity android:name=".MyActivity">
<layout
android:defaultHeight="500dp"
android:defaultWidth="600dp"
android:gravity="top|end"
android:minimalHeight="450dp"
android:minimalWidth="300dp" />
</activity>
Intent.FLAG_ACTIVITY_LAUNCH_TO_ADJACENT
Drag and Drop
Helper methods and callbacks for mode changes
Lambdas
Default interface methods
Reflection APIs
java.util.function
java.util.stream
Lambdas
Default interface methods
Reflection APIs
java.util.function
java.util.stream
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
android {
...
defaultConfig {
...
jackOptions {
enabled true
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
Slightly slower than javac (currently)
Breaks Annotation Processing (currently)
No Instant Run (currently)
Breaks Kotlin (currently)
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config>
<domain includeSubdomains="true">example.com</domain>
<trust-anchors>
<certificates src="@raw/my_ca"/>
</trust-anchors>
</domain-config>
</network-security-config>
ConnectivityManager.isActiveNetworkMetered()
ConnectivityManager.getRestrictBackgroundStatus()
file://
Doze
Multi-language support
android.test deprecation
android.permission.GET_ACCOUNTS deprecated
AutomaticZenRule
android.os.Health
Vulkan
NDK API