Designed by Veethemes.com | Gooyaabi

Latest Posts

Showing posts with label Featured. Show all posts
Showing posts with label Featured. Show all posts
Posted by Dave Burke, VP of Engineering


Three weeks ago at Google I/O, we href="https://android-developers.googleblog.com/2017/05/whats-new-in-android-o-developer.html">announced
the second developer preview of Android O along with key themes, Fluid
Experiences
and Vitals, and highlighted our work
towards a modular base with href="https://android-developers.googleblog.com/2017/05/here-comes-treble-modular-base-for.html">Project
Treble. It was also an important milestone for us with the release
of the first beta-quality candidate. We talked a lot about what's new in Android
during the keynote and breakout sessions—if you missed the livestream, be sure
to check out the full archive of talks href="https://www.youtube.com/user/androiddevelopers/playlists?sort=dd&view=50&shelf_id=14">here.



Today we're rolling out Developer Preview 3 with the final Android O APIs, the
latest system images, and an update to Android Studio to help you get ready for
the consumer release later in the summer. Watch for one more preview update
coming in July that will bring you the near-final system images.



If you've already enrolled your device in the href="http://android.com/beta">Android Beta Program, you'll receive an
update to Developer Preview 3 shortly.


Make your app compatible with Android O



With the consumer launch approaching href="https://developer.android.com/preview/migration.html">in the coming
months, a critical first step is making your current app compatible with
Android O. This will give your users a seamless transition to the new platform
as it arrives on their devices.



If you haven't tested your app for compatibility yet, getting started is
straightforward -- just enroll a supported device in Android Beta and get the
latest update over-the-air, then install your current app from Google Play and
test. The app should run and look great, and it should handle the Android O href="https://developer.android.com/preview/behavior-changes.html">behavior
changes properly -- in particular pay attention to href="https://developer.android.com/preview/behavior-changes.html#abll">background
limits and changes in href="https://developer.android.com/preview/behavior-changes.html#networking-all">networking,
href="https://developer.android.com/preview/behavior-changes.html#security-all">security,
and href="https://developer.android.com/preview/behavior-changes.html#privacy-all">identifiers.



After you've made any necessary updates, we recommend publishing the compatible
version of your app to Google Play right away -- without changing the app's
platform targeting.


Enhance your app with Android O features and APIs



Extending your apps with Android O features can help you drive more engagement,
offer new interactions, give users more control and security, and even improve
your app's performance.



href="https://developer.android.com/preview/features/notification-channels.html">Notification
channels and href="https://developer.android.com/preview/features/notification-badges.html">dots
give you more ways to surface new content to users and bring them back into your
app. Picture-in-picture keeps your app onscreen while users are multitasking,
and href="https://developer.android.com/preview/features/autofill.html#optimizing_your_app_for_autofill">autofill
makes it simple for them to enter forms data and helps keep their data secure.
Also check out href="https://developer.android.com/preview/features/adaptive-icons.html">adaptive
icons, href="https://developer.android.com/preview/features/fonts-in-xml.html">XML font
resources, href="https://developer.android.com/preview/features/downloadable-fonts.html">downloadable
fonts and href="https://developer.android.com/preview/features/emoji-compat.html">emoji,
href="https://developer.android.com/preview/features/autosizing-textview.html">autosizing
TextView,href="https://developer.android.com/ndk/guides/audio/aaudio/aaudio.html"> AAudio
API, and href="https://developer.android.com/preview/api-overview.html">many others.
You'll also want plan your support for href="https://developer.android.com/preview/features/background.html">background
execution limits and other important href="https://developer.android.com/preview/behavior-changes.html#o-apps">changes
in vital system behavior for O apps.



Visit the O Developer
Preview site
to learn about all of the new features and APIs and how to
build them into your apps.











Picture-in-Picture mode lets you keep users engaged while they are multitasking (left). Notification dots keep users active in your app and let them jump directly the app’s core functions (right).

Get started with Developer Preview 3



Today's preview update includes the latest version of the Android O platform
with the final API level 26 and hundreds of bugfixes and optimizations. You can
download the final API 26 SDK from the SDK Manager in href="https://developer.android.com/studio/index.html?utm_campaign=android_launch_npreview_061516&utm_source=anddev&utm_medium=blog">Android
Studio, and href="https://developer.android.com/topic/libraries/support-library/revisions.html?utm_campaign=android_launch_npreview_061516&utm_source=anddev&utm_medium=blog">Android
Support Library 26.0.0 beta 2 from href="https://developer.android.com/studio/build/dependencies.html#google-maven">Google's
Maven repository.



Together, these give you everything you need to develop and test your apps with
the official Android O APIs. Once you've installed the final SDK, you can update
your project's compileSdkVersion to API 26 to compile against the
official Android O APIs. We also recommend updating your app's
targetSdkVersion to API 26 to opt-in and test your app with Android
O specific href="https://developer.android.com/preview/behavior-changes.html?utm_campaign=android_launch_npreview_061516&utm_source=anddev&utm_medium=blog">behavior
changes. See the href="https://developer.android.com/preview/migration.html#bfa">migration
guide for details on how to set up your environment to build with Android O.



APIs have changed since the second developer preview, so if you have existing
code using Android O preview APIs, take a look at the href="https://developer.android.com/sdk/api_diff/26-incr/changes.html">diff
report to see where your code might be affected.



If you're developing for Android O, we recommend updating to the latest version
of href="https://android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html">Android
Studio 3.0, now available in the canary channel. Aside from great new
features like improved app performance profiling tools, support for the href="http://android-developers.googleblog.com/2017/05/android-announces-support-for-kotlin.html">Kotlin
programming language, and Gradle build optimizations, Android Studio 3.0
includes build support for href="https://android-developers.googleblog.com/2017/05/android-instant-apps-is-open-to-all.html">Instant
Apps, an href="https://developer.android.com/preview/features/adaptive-icons.html">Adaptive
Icon Wizard, and support for href="https://developer.android.com/preview/features/working-with-fonts.html">XML
Fonts, href="https://developer.android.com/preview/features/working-with-fonts.html">anhref="https://developer.android.com/preview/features/working-with-fonts.html">d
href="https://developer.android.com/preview/features/downloadable-fonts.html">Downloadable
Fonts.






Android Studio 3.0 includes tools for developing with Android O features lets you preview XML font resources in your app.


If you don't plan to use those features, you now have the option of developing
for Android O using href="https://developer.android.com/studio/index.html">Android Studio 2.3.3
from the stable channel. Note that the tools for working with adaptive icons and
downloadable fonts, and XML fonts are not available in Android Studio 2.3.3.


Publish your apps to alpha, beta or production channels in Google
Play



Now that the APIs are final, you can publish APK updates compiling with, and
optionally targeting, API 26 to your alpha, beta, or even production channels in
Google Play. Publishing your O-targeted app during the preview lets you test
compatibility on existing devices and push updates to devices running API 26 --
such as users who are enrolled in the Android Beta program.



To make sure that your updated app runs well on Android O as well as older
versions, a common strategy is to use href="https://developer.android.com/distribute/engage/beta.html?utm_campaign=android_launch_npreview_061516&utm_source=anddev&utm_medium=blog">Google
Play's beta testing feature to get early feedback from a small group of
users -- including developer preview users — and then do a staged rollout as you
release the updated app to all users.


How to get the preview update



Through the Android Beta program,
developers and early adopters worldwide will soon be getting Developer Preview 3
on their devices. If you aren't yet enrolled, just visit href="https://android.com/beta">android.com/beta and opt-in your eligible
Android phone or tablet. As always, you can also download and href="https://developer.android.com/preview/download.html?utm_campaign=android_launch_npreview_061516&utm_source=anddev&utm_medium=blog#flash">flash
this update manually. The O Developer Preview is available for Pixel, Pixel
XL, Pixel C, Nexus 5X, Nexus 6P, and Nexus Player.



Thanks so much for all of your feedback so far. Please continue to share href="https://developer.android.com/preview/feedback.html">feedback or
requests as we work towards the consumer release later this summer. We're
looking forward to seeing your apps on Android O!







Posted by Maxim Mai, Apps Partnerships, Google Play


Last Thursday at Google I/O 2017, we announced the href="https://g.co/play/gpa2017">winners of this year's Google Play Awards.
Grab some popcorn and watch the href="https://www.youtube.com/watch?v=ayXMtOmXXhw">award ceremony, we think
it's just as fun as The Oscars. This year, we included a category to celebrate
the achievements of developers who publish outstanding apps that have positive
social impact.



In introducing this awards category, we were inspired by the UN's href="https://sustainabledevelopment.un.org/sdgs">17 Sustainable Development
Goals. With the ability to reach over 1 billion active Android devices
around the world, we think that app developers have a tremendous opportunity to
impact Zero Hunger (SDG
#2
), Good Health and Wellbeing (href="https://sustainabledevelopment.un.org/sdg3">SDG #3) and Quality
Education (SDG #4), and
many others. Read on to find out more about how this year's winner and finalists
and impacting these goals.


Get in touch about your social impact app or game



Our work in supporting developer success in this area on Android and Google Play
is just beginning. We would like to encourage Android developers with a focus on
social impact to href="https://goo.gl/ZXXGx5">get
in touch with us here at Google Play and to tell us about their app or game.
It doesn't matter where you are based, what problems you are solving, or which
countries you are targeting, we would like to hear your story and maybe we can
help you grow faster and improve your app's quality.


Social impact winner & finalists in the 2017 Google Play
Awards






🏆 href="https://play.google.com/store/apps/details?id=org.sharethemeal.app&e=-EnableAppDetailsPageRedesign">ShareTheMeal
by United Nations 🏆


The Google Play Award category winner, ShareTheMeal, generates large scale,
global awareness for "Zero Hunger" and its users' donations pay for school
meals, which are provided by the World Food Programme, in regions around the
world experiencing food insecurity. Over 13 million meals have been donated via
the app since launch!






href="https://play.google.com/store/apps/details?id=com.charitymilescm.android&e=-EnableAppDetailsPageRedesign">Charity
Miles by Charity Miles


This is a running, cycling and walking tracker app with a social impact twist.
Charity Miles earns money for charity on your behalf for every mile you move,
via its brand fitness exercise sponsors! Users have already donated $2 million
to charity by recording over 40 million miles!






href="https://play.google.com/store/apps/details?id=org.peekvision.public.android&e=-EnableAppDetailsPageRedesign">Peek
Acuity by Peak Vision


Peek Acuity allows anyone with an Android phone to easily measure visual acuity,
which is one of the components of vision. It is designed by eye care
professionals to be used to help identify people who need further examination
by, for example, an optometrist or ophthalmologist. In developing countries,
over XM [confirm number with Peek Vision] struggle with vision impairment and
many don't have easy access to an eye care professional.






href="https://play.google.com/store/apps/details?id=com.Proativa.ProDeafMovel">Prodeaf
Translator by ProDeaf Tecnologias Assistivas


This app lets anyone translate phrases and words from Portuguese for Brazilian
Sign Language (Libras) or from English to American Sign Language (ASL). This
significantly reduces barriers to communication between the millions of people
who depend on Libras or ASL as their lingua franca and others who have not had
the opportunity to learn this form of communication.






href="https://play.google.com/store/apps/details?id=com.glitchers.catchhero&e=-EnableAppDetailsPageRedesign">Sea
Hero Quest by GLITCHERS


This is not just a game, it's a quest to help scientists fight dementia! It
sounds too good to be true but this really is a game, where simply by having
loads of fun chasing creatures around magical seas and swamps, you can help to
fight a disease that currently affects 45 million people worldwide. In fact
playing SEA HERO QUEST for just 2 minutes will generate the equivalent of 5
hours of lab-based research data.



If you're working on an app or game with a positive social impact, don't forget
to href="https://goo.gl/ZXXGx5">get
in touch via this form and tick the "Social Impact app" checkbox.



How useful did you find this blogpost?


href="https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?entry.753333049=1%E2%98%85+%E2%80%93+Not+at+all&entry.656324858&entry.1348260426=socialimpact-05/17&entry.1170596605&entry.646747778=socialimpact-05/17" style="color: gold"; >★
href="https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?entry.753333049=2%E2%98%85+%E2%80%93+Not+very&entry.656324858&entry.1348260426=socialimpact-05/17&entry.1170596605&entry.646747778=socialimpact-05/17" style="color: gold";>★
href="https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?entry.753333049=3%E2%98%85+%E2%80%93+Somewhat&entry.656324858&entry.1348260426=socialimpact-05/17&entry.1170596605&entry.646747778=socialimpact-05/17" style="color: gold";>★
href="https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?entry.753333049=4%E2%98%85+%E2%80%93+Very&entry.656324858&entry.1348260426=socialimpact-05/17&entry.1170596605&entry.646747778=socialimpact-05/17" style="color: gold";>★
href="https://docs.google.com/forms/d/e/1FAIpQLScLTlzFd_aV-3rAdBqO1QxwCsuAcDCIM6fJFXyNcyf7zElVXg/viewform?entry.753333049=5%E2%98%85+%E2%80%93+Extremely&entry.656324858&entry.1348260426=socialimpact-05/17&entry.1170596605&entry.646747778=socialimpact-05/17" style="color: gold";>★




Posted by George Audi, Tom Grinsted and Larry Yang, Google Play


The subscription business model is one of the best ways to make more regular, reliable, and recurring revenue on Android and Google Play. In fact, both developers and users love subscription apps so much that we’ve seen a 10X growth in consumer spend over the past three years and double the number of active subscribers in the past year. Thousands of developers are offering subscriptions through Google Play and are already seeing success with our billing platform. That’s why we’ve been working hard to help you take advantage of this opportunity and give you greater insights into your business and Android users.




New features to help your subscriptions business
thrive



You've got a high-performing product with fantastic features and compelling
content, but your business can't succeed without acquiring new users. In
addition to free trials, intro pricing, flexible billing periods, and more, we
recently launched the ability to pay for subscriptions with Google Play
balance
. Although people have already been using gift cards to pay for
Play content in over 20 countries, the use of gift cards to pay for
subscriptions in regions where cash is a popular form of payment, such as Latin
America, has resulted in as high as a 15% increase in subscription spend.



But it's not just about acquiring new customers, it's about retaining the ones
you have. That's why we are introducing account hold, where we
work with you to block access to your content or service if a user's form of
payment fails. This directly links a payment failure to the user losing access
to your content and/or premium features, which is enough to get them to go and
choose a new form of payment. When Keepsafe–the developer of href="https://play.google.com/store/apps/details?id=com.kii.safe&hl=en">Keepsafe
Photo Vault, a photo locker for private pictures and videos with over 50M
downloads–integrated account hold, their renewal rate on Android increased by
25%. We have over a dozen developers in early access today, and we will be
announcing public availability at the end of June.



We know data is vital to running your business, so we're excited to announce a
new subscriptions dashboard in the Play Console, and a new
report on Android app subscribers.





The dashboard brings together subscription data like new subscribers, cancellations, and total subscribers. It also displays daily and 30-day rolling revenue data, and highlights your top-performing products. This will give visibility into your subscription products and users and will help guide your business decisions.



Insights to help you grow your subscriptions
business



In addition to products and features, understanding people's needs is core to
building a successful subscription business. We talked to 2,000 Android app
subscribers in the US and UK and asked them how and why they use the apps they
do. The results shared in 'href="http://services.google.com/fh/files/misc/subscription_apps_on_google_play.pdf">Subscription
apps on Google Play: User insights to help developers win'
report
highlight some of the opportunities for you to grow your subscriptions user
base, set pricing strategies and learn to keep your users engaged, including:


  • Use free trials to acquire users. 78% of users start with a
    free version of an app, and many cite a discount or end of a free trial as a
    reason to pay.
  • Keep your content appealing and updated to get and keep users
    paying
    . It's the most important driver in converting users from free to
    paid users, as well as keeping users engaged and retained.




  • There is a huge opportunity to make money from
    subscriptions.
    While pricing elasticity varies by category, few users
    cite price as a reason to churn from a paid subscription and 64% either budget
    on a per app basis or not at all (as opposed to budgeting across all app
    subscriptions).


To find out more about your growing your subscription business with Google Play,
watch
our I/O session
, download
the research report (PDF)
, and get started with subscriptions
with Google Play In-app Billing
.






How useful did you find this blogpost?

















By Mike Cleron, Director,
Android Platform



Today the Android team is excited to announce that we are officially adding
support for the Kotlin programming
language. Kotlin is a brilliantly designed, mature language that we believe will
make Android development faster and more fun. It has already been adopted by
several major developers — Expedia, Flipboard, Pinterest, Square, and others —
for their production apps. Kotlin also plays well with the Java programming
language; the effortless interoperation between the two languages has been a
large part of Kotlin's appeal.




The Kotlin plug-in is now bundled with Android Studio 3.0 and is available for
immediate download.
Kotlin was developed by JetBrains, the
same people who created IntelliJ,
so it is not surprising that the IDE support for Kotlin is outstanding.


In addition to the IDE support, we're announcing a collaboration with JetBrains
to move Kotlin into a non-profit foundation. (Kotlin is already open sourced
under Apache2.)




Say "Hello" to Kotlin


Kotlin will be very familiar to anyone who has used the Java programming
language.



package helloWorld

fun main(args: Array) {
println("Hello World!")
}

At first glance, you will see comforting elements like curly braces, classes,
packages, functions and methods. But as you go deeper, you will discover that
although Kotlin is based on familiar concepts, it is a uniquely modern, elegant
and pragmatic riff on those models. In particular, Kotlin is highly expressive
with minimal syntactic friction between your thoughts and what you have to type
in order to express those thoughts. If when writing code you have asked yourself
questions that began "why do I have to …?" you will be pleased to learn that in
Kotlin the answer to many of those questions is "you don't!"



For example, perhaps you have asked why you need to type in a bunch of
boilerplate getters and setters as well as overriding equals(),
hashCode() and toString() when implementing a simple
class. Here is a typical example from the Java programming language (in a
microscopic font for brevity).



public class Customer {
private String name;
private String email;
private String company;

public Customer(String name) {
this(name, "", "");
}

public Customer(String name, String email) {
this(name, email, "");

}

public Customer(String name, String email, String company) {
this.name = name;
this.email = email;
this.company = company;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

public String getEmail() {
return email;
}

public void setEmail(String email) {
this.email = email;
}

public String getCompany() {
return company;
}

public void setCompany(String company) {
this.company = company;
}

@Override
public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;

Customer customer = (Customer) o;

if (name != null ? !name.equals(customer.name) : customer.name != null) return false;
if (email != null ? !email.equals(customer.email) : customer.email != null) return false;
return company != null ? company.equals(customer.company) : customer.company == null;
}

@Override
public int hashCode() {
int result = name != null ? name.hashCode() : 0;
result = 31 * result + (email != null ? email.hashCode() : 0);
result = 31 * result + (company != null ? company.hashCode() : 0);
return result;
}

@Override
public String toString() {
return "Customer{" +
"name='" + name + '\'' +
", email='" + email + '\'' +
", company='" + company + '\'' +
'}';
}
}

In Kotlin, you don't have to type any of that. This single line is equivalent to
the entire class above.



data class Customer(var name: String, var email: String = "",
var company: String = "")



History and Reference


Kotlin has been around for quite a while; it was announced back in 2011 and the
first preview was released in 2012. Kotlin 1.0 was released in 2016, at which
point JetBrains committed to maintaining backwards compatibility for stable
features from 1.0 forward.



You can find excellent training material and references at https://kotlinlang.org/. The Android team has
found the Kotlin
Koans
tutorial to be especially helpful as a quick way to get started
writing some Kotlin snippets. These tutorials range from the simple to the
sublime as the material progresses from the basics to more sophisticated Kotlin
idioms.




Why Kotlin?


Why did the Android team decide to support Kotlin? Most importantly, it was
because we think Kotlin is a great language that will make writing Android apps
easier and more enjoyable.



Kotlin is also a great match for the existing Android ecosystem. It is 100%
compatible with the Java programming language. You can add as little or as much
Kotlin into your existing codebase as you want and mix the two languages freely
within the same project. Calling out to Kotlin code from code written in the
Java programming language Just Works™. Going the other direction usually works
without any developer effort too via some automatically applied translation
conventions (for example, things like property getters and setters are created
for you). With the help of a few Kotlin annotations, you can also customize how
the translation is performed.



Finally, many, many developers have told us they love the Kotlin language. (Many
of our own developers on the Android team have also been saying similar things.)
There is already an enthusiastic
community
of Kotlin developers
for Android, and the Android team has been routinely peppered with questions
about Kotlin at public events. The Android community has spoken, and we
listened.




A Quick Tour


To help you get a sense of where all of the excitement around Kotlin is coming
from, here is a quick, very-much-not-comprehensive tour of some of the
particularly appealing aspects of Kotlin:



Nullable


The Kotlin compiler enforces that variables that can hold null values are
explicitly declared – thus no more NullPointerExceptions at runtime!



var neverNull: String = "something"
var mightBeNull: String? = null // "?" indicates this can be null

if (neverNull.length > 0) { // This is OK

}

if (mightBeNull.length > 0) { // Compiler catches this error for you

}

Named parameters and default arguments


We've all seen methods that have too many parameters to keep track of. For
example:



fun orderPizza(size: Size, pepperoni: Boolean, mushrooms: Boolean,
ham: Boolean, pineapple: Boolean, pickles: Boolean,
sausage: Boolean, peppers: Boolean, onion: Boolean)
{
...
}

// Wait… did I just order pickles on my pizza?
// Why do we even have that option?
orderPizza(Size.LARGE, true, false, false, false, true,
false, true, false)

Compare that to a similar scenario using named parameters and default arguments:



fun orderPizza(size: Size,
pepperoni: Boolean = false,
mushrooms: Boolean = false,
ham: Boolean = false,
pineapple: Boolean = false,
pickles: Boolean = false,
sausage: Boolean = false,
peppers: Boolean = false,
onion: Boolean = false)
{
...
}

orderPizza(Size.LARGE, ham = true, mushrooms = true)

In addition to helping to avoid tragic pizza outcomes, this is much easier to
read. It also reduces the number of variants of overloaded functions you need to
write.



When statement


Kotlin has a variation of a switch statement that allows matching on arbitrary
expressions.



// Please don't put this in your app!
when {
password.equals("password") -> println("Insecure password!")
password.length < 4 -> println("Too short!")
else -> {
println("Secure password!")
}
}

Smart Casts


Why should you have to cast something to a class right after you just tested
that it is an instance of that class? In Kotlin, you don't have to do that
anymore.



if (obj is String) {
// Compiler casts obj to a String for you.
// (Would work with && instead of nested ifs too.)
if (obj.length > 0) {

}
}

This generalizes to the when statement as well:



// Assume reasonable implementations of Cat and Dog
when (obj) {
is Cat -> obj.meow(...)
is Dog -> obj.woof(...)
else -> {

}
}

Extension functions


Kotlin lets you essentially retcon
new methods onto an existing type. If you, like many people, wish that the
String class had a toPigLatin method, you can now add it yourself
without having to create a new helper class to wrap String or going through the
trouble of serving on a language committee:



// The "String." prefix indicates that this method should
// extend the existing String class
fun String.toPigLatin() : String {
...
}

val plainOldString : String = "some text"

// Can now call toPigLatin as if were a method on String
println(plainOldString.toPigLatin())

// Or:
println("some text".toPigLatin())

Destructuring Declarations


We have already seen how easy it is to define a simple data class:



data class Order(val itemCode: String, val quantity: Int,
val price: Float)

A function that uses one of these classes as the return type is very close to
supporting multiple return values:



fun getOrder(...): Order {
...
return Order(itemCode, quantity, price);
}

To get all the way there, you can use the destructuring declaration syntax. The
following statement takes the Order object, extracts its three
properties, and then assigns them to the three variables what,
howMany and howMuch — all courtesy of the Kotlin
compiler, which also infers the correct types for you.



val (what, howMany, howMuch) = getOrder(...)

Lambdas


Kotin has an extremely concise syntax for lambdas that makes is easy to express
powerful functional programming paradigms. Here's a simple example that uses a
lambda to test that everything in a collection is a String:



fun allStrings(collection: Collection)=
collection.all { it is String }

That lambda syntax is building block of one of Kotlin's coolest features: the
ability to create builders that use JSON-like syntax that also happens to be
syntactically valid Kotlin. This example is adapted from an extended discussion
here,
but you can get the flavor of what it possible with this snippet:



fun generatePage(withEmphasis : Boolean) {
val result =
html {
head {
title { +"Kotlin Builders" }
}
body {
h1 { +"Kotlin Builders" }
p {
+"This is "
if (withEmphasis) b { +"really " }
+"interesting"
a(href = "https://goo.gl/rHwJio") { +"More here" }
}
}
}
println(result)
}

There are a couple of interesting things going on here. First, this shows how
expressive Kotlin's functional syntax can be: in this example,
"html", "head", "body, etc. are all just
functions written in Kotlin and the stuff in curly braces that follows are
functional parameters. (This snippet uses functions with names that match HTML
tags to build a representation of a web page, but of course you can use this
pattern to build any complex data structure with whatever names you want.) The
second interesting thing is the "withEmphasis" conditional. This
may look like we are mixing code (if (withEmphasis) …) with data
(all the HTML-esque tags), but the "data" here is actually just more code. Since
it is all really just code, this lets you build complex data structures using a
declarative syntax while also having inline access to the full capabilities of
the Kotlin language.




Getting Started


If you want to get started with Kotlin, you can start playing with code online
immediately here. Just hit the green
triangle to compile and run.



To try Kotlin in your app, follow these steps:



  1. Download
    Android Studio 3.0


  2. Open one of your existing ".java" files

  3. Invoke "Code > Convert Java File to Kotlin File"


The IDE will then walk you through adding Kotlin dependencies into your project,
and then convert the code to functionally equivalent Kotlin code. (The IDE will
also offer to touch up all of the call sites to the converted class when
suitable to be more idiomatic Kotlin such as when static methods are moved to
companion objects.)



You can also find a lot more information on how to start using
Kotlin
on developer.android.com.















By Jamal Eason, Product
Manager, Android


Just in time for Google I/O 2017, we're providing a sneak peak of Android Studio
3.0 - available to download today on our
canary release channel. Android Studio's our official IDE, purpose-built for
Android, and we keep increasing our investment. The feature set in Android
Studio is focused on accelerating your app development flow and providing the
latest tools built for the Android platform.



To accelerate your development flow, Android Studio 3.0 includes three major
features: a new suite of app performance profiling tools to quickly diagnose
performance issues, support for the Kotlin programming language, and increased
Gradle build speeds for large sized app projects. Android Studio 3.0 also
tightly integrates with Android platform development with these additional key
features: support for Instant App development, inclusion of the Google Play
Store in the Android O emulator system images, and new wizards for Android O
development. Overall, this first canary release of Android Studio 3.0 has 20+
new features.




We have been quietly iterating on many of these features as part of the Android Studio 2.4
Canaries. Today we are renumbering the release to Android Studio 3.0 after
recognizing that we added many significant features, and that we had to
introduce a rare breaking change in the Android Gradle Plugin to improve
scalability and build times. If you want to target Android O, create an Instant App, start developing with the Kotlin language or use the latest in Android app
performance tools to improve your app quality then you should download Android
Studio 3.0 Canary 1 today.





What's New in Android Development Tools - Google I/O '17






Check out the the list below organized into key developer flow for the details of the new features in this first canary release of Android Studio 3.0.




Develop





  • Kotlin Programming Language - By popular
    request, Android Studio 3.0 now includes support for Kotlin. With this new language support, you
    can seamlessly add Kotlin code next to your existing Android app code and have
    access to all the great development tools found in Android Studio. You can
    choose to add Kotlin to your project using the built-in conversion tool found
    under CodeConvert Java File to Kotlin File,
    or you choose to create a Kotlin enabled project with the New Project Wizard.
    Lean more about Kotlin language support in Android and Android Studio.





Kotlin Language Conversion in Android Studio







  • Java 8 Language features - We are
    continuing to evolve the support for Java 8 language features and APIs. With the
    recent deprecation
    of the Jack toolchain
    and migration to the javac based toolchain, you have
    access to features such as Instant Run for projects using the Java 8 language
    features in Android Studio. To update your project to support the new Java 8
    Language toolchain, simply update your Source and Target
    compatibility levels to 1.8 in the Project Structure dialog. Learn
    more
    .



Update Project Structure Dialogue for Java 8 Language












  • Layout Editor - With this Android Studio
    release, you will find additional enhancements to the Layout Editor. We have
    updated the component tree with better drag-and-drop view insertions, and a new
    error panel. In coordination with an update to ConstraintLayout,
    the Layout Editor also supports creating view Barriers, creating Groups, and
    enhances Chain Creation. Learn
    more
    .



Layout Editor Component Tree & Warning Panel









  • Adaptive Icon Wizard - Android O
    introduces adaptive launcher icons, which can display in different shapes across
    different Android devices. The new Adaptive Launcher Icon wizard creates the new
    and legacy launcher icon assets and provides previews of how your adaptive icon
    will look on different launcher screen icon masks. Create a new asset by
    right-clicking on the /res folder in your project then navigate
    to → NewImage AssetLauncher
    Icons (Adaptive and Legacy)
    Learn
    more
    .



Adaptive Icon Wizard










  • XML Fonts & Downloadable Fonts - Adding
    custom fonts to your app (available when targeting Android O) is now even easier
    with the XML fonts preview and font selection tools in Android Studio. You can
    can also create a downloadable font resource for your app. Using downloadable
    fonts allows you to use a custom font in your app while avoiding the need to
    bundle in a font resource into your APK. To use downloadable fonts, ensure that
    you device or emulator is running Google Play Services v11.2.63 or higher. Learn
    more
    .



Downloadable Fonts Resource Picker





XML Fonts Preview
















  • Android Things Support - With Android
    Studio 3.0, you can start developing on Android Things with a new set of
    templates in the New Project wizard and the New Module wizard. Android Things
    allows you to extend your Android development knowledge into the Internet of
    Things (IoT) device category. Learn more.








Android Things New Module Wizard 














  • IntelliJ Platform Update: Android Studio 3.0 Canary 1
    includes the IntelliJ 2017.1 release, which has features such as Java 8 language
    refactoring, parameter hints, semantic highlighting, draggable breakpoints,
    enhanced version control search, and more. Learn
    more
    .






Build





  • Instant App Support - With Android Studio
    3.0, you can create Instant
    Apps
    in your project. Instant Apps are lightweight Android apps that your
    users can immediately run without installation. To support this, Android Studio
    introduces two new module types: instant app and feature. Combined with a new
    "Modularize" refactoring action and the App
    Links Assistant
    , Android Studio can help you extend your app into an Instant
    App. To use you can use the New Module Wizard or right-click on a class and
    navigate to: RefactorModularize Learn more.








Instant App Module Wizard










  • Build Speed Improvements - We are
    continuing to invest in making build speeds faster. For this release, we focused
    on improving speed for projects that have many modules. To achieve these speed
    improvements and to support future enhancements, we have made breaking API
    changes
    to the Android Gradle plugin used by Android Studio. If you
    depended on APIs provided by the previous plugin you should validate
    compatibility with the new plugin and migrate applicable APIs. To test, update
    the plugin version in your
    build.gradle
    file. Learn more.











build.gradle





dependencies {
classpath 'com.android.tools.build:gradle:3.0.0-alpha1'
}



  • Google's Maven Repository - Also, by
    popular request, we are now distributing the Android Support Library maven
    dependencies outside of the Android SDK Manager in a brand new Maven repository.
    For those developing with a Continuous Integration (CI) system, this should make
    Maven dependency management easier. Used in combination with the latest command
    line SDK
    Manager tool
    and Gradle,
    CI builds should be easier to manage with Google's Maven Repository. To use the
    the new Maven location, add the following url to your app module's
    build.gradle file. Learn more.




build.gradle


repositories {
maven {
url "https://maven.google.com"
}
}













    Test & Debug



    • Google Play System Images - Along with the
      update to the Android O Beta release, we updated the Android Emulator O system
      images to include the Google Play Store. Bundling in the Google Play store
      allows you to do end-to-end testing of apps with Google Play, and provides a
      convenient way to keep Google Play services up-to-date in your Android Virtual
      Device (AVD). Just as Google Play services updates on physical devices, you can
      trigger the same updates on your AVDs.





    Google Play Store in Android Emulator











    Update Google Play Services in Android Emulator














    To ensure app security and a consistent experience with physical devices, the
    emulator system images with the Google Play store included are signed with a
    release key. This means you will not be able to get elevated privileges. If you
    require elevated privileges (root) to aid with your app troubleshooting, you can
    use the Android Open Source Project (AOSP) emulator system images that do not
    include Google apps or services. To get started, make sure you are using Android
    Emulator v26.1+, the latest system images API 24+ and then create a new AVD with
    a Google Play icon next to the device definition. Learn more.









    Android Virtual Device Manager with Google Play Store Support 















    • OpenGL ES 3.0 Support in Android Emulator - As a part of our ongoing investment in making your development experience fast, the latest version of the Android Emulator has OpenGL ES 3.0 support for Android O system images along with significant improvements in OpenGL ES 2.0 graphics performance for older emulator system images. Most modern graphics cards on all operating systems support OpenGL ES 2.0 acceleration. To use OpenGL ES 3.0 with the Android Emulator, your development machine needs a host GPU graphics card that supports OpenGL 3.2 or higher on Microsoft® Windows® or Linux (with Apple MacOS® support coming in the future). Learn more.










    OpenGL ES 3.0 in Android Emulator











    • App Bug Reporter in Android Emulator - To
      help in documenting bugs in your app, we have added an easier way to generate a
      bug report with all the necessary configuration settings and space to capture
      your repro steps. Additionally, if you want to share a specific emulator bug
      with the Android team, we have also added a link to quickly generate a bug on
      the Android Issue Tracker. To use this feature, navigate to the Emulator
      Tool Bar
      Extended ControlsHelp
      Emulator HelpFile a Bug. Learn
      more
      .









    App Bug Reporting in Android Emulator










    • Proxy Support in Android - For those who
      need to use a HTTP proxy to access the Internet, we have added a user interface
      to manage the proxy settings used by the emulator. By default, the Android
      Emulator will now use the settings from Android Studio, but you can override
      these settings for your network setup. To configure navigation to the
      Extended ControlsSettings
      Proxy.






    Android Emulator Proxy Settings








    • Android Wear Rotary Controls in Android Emulator -
      The Android Emulator now supports rotary controls for the Android Wear
      2.0 emulator system image. It is now easier to test your apps that target
      Android Wear devices that include rotary input scrolling. To enable, create an
      Emulator AVD that targets Android Wear, and the Rotary Input panel should appear
      under Extended controls. Learn
      more
      .








    Rotary input in Android Emulator









    • APK Debugging - For those of you who just
      want to debug an APK without building your project in Android Studio, the
      Android Studio 3.0 release now has the ability to debug an arbitrary APK. This
      functionally is especially helpful for those who develop your Android C++ code
      in another development environment, but want to debug and analyze the APK in the
      context of Android Studio. As long as you have a debuggable version of your APK,
      you can use the new APK Debugging features to analyze, profile & debug the APK.
      Moreover, if you have access to the sources of your APK, you can link the source
      to the APK debugging flow for a higher fidelity debugging process. Get started
      by simply selecting Profile or debug APK from the Android
      Studio Welcome Screen or File → Profile or debug APKLearn More.








    Profile or Debug an APK









    APK Debugging









    • Layout Inspector - You will find that the
      Layout Inspector has a few additional enhancements in Android Studio 3.0 that
      make it easier to debug issues in your app layouts. A couple of the enhancements
      include better grouping of properties into common categories, as well as search
      functionality in both the View Tree and Properties Panels. While an application
      is running, access the Layout Inspector via Tools
      AndroidLayout Inspector. Learn more.





    Layout Inspector









    • Device File Explorer - Ported from DDMS
      into Android Studio by popular demand, the new Device File Explorer allows you
      to view the file and directory structure of your Android device or emulator. As
      you are testing your app, you can now quickly preview and modify app data files
      directly in Android Studio. Learn more.








    Device File Explorer











    Optimize




    • Android Profiler - Android Studio 3.0 includes a brand new suite of tools to help debug performance problems in your app. We completely rewrote the previous set of Android Monitor tools, and replaced them with the Android Profiler. Once you deploy your app to a running device or emulator, click on the Android Profiler tab and you will now have access to a real-time & unified view of the CPU, Memory, & Network activity for your app. Each of the performance events are mapped to the UI event timeline which highlights touch events, key presses, and activity changes so that you have more context on when and why a certain event happened.  Click on each timeline to dig into each performance aspect of your app. Learn more








    Android Profiler - Combined timeline view.






    • CPU Profiler - Unnecessary CPU processing
      and load spikes are symptoms of poor app performance. With the CPU Profiler,
      you can analyze the CPU thread usage of your app by triggering a sample or
      instrumented CPU trace. At this point, you can troubleshoot CPU performance
      issues using a variety of data views and filters built into the CPU Profiler. Learn more.







    CPU Profiler






    • Memory Profiler - Using memory
      inefficiently can lead to many device problems ranging from a janky UI to low
      memory events. The Memory Profiler combines the functionality of the previous
      Heap Viewer and Allocation Tracker in one rich interface to help debug memory
      usage problems in your app. You can diagnose a range of memory issues by
      analyzing memory allocations, heap dumps and more. Learn more.











    Memory Profiler












    • Network Profiler - Optimizing foreground
      and background network usage in your app can lead to a more performant app and
      lower app data usage. The network profiler allows you to monitor the network
      activity of your app, inspect the payload of each of your network requests, and
      link back to the line of source code that generated the network request.
      Currently, the network profiler works with HttpURLConnection,
      OkHttp, and Volley
      network libraries. The network profiler is an advanced analysis feature that can
      be enabled on Pre-Android O devices & emulators by selecting Enable Advanced
      Profiling
      in the Profiling Tab in the Run Configuration box. In addition to
      enabling network request and payload analysis, this checkbox enables event
      collection at the top level, memory object count, and memory garbage collection.
      For Android O-based devices and emulator, just deploy your app. Learn more.






    Network Profiler

















    Network Profiler Setup for Pre- Android O Devices









    • APK Analyzer Improvements - In Android
      Studio 3.0, we have added some additional enhancements to the APK Analyzer to
      help you further optimize the size of your APK. With this feature update, you
      can now analyze Instant App zip files & AARs, and view dex bytecode of classes &
      methods. You can also generate Proguard configuration rules and load Proguard
      mapping files in the dex viewer. Learn
      more
      .









    APK Analyzer



    Check out the release notes for more details.




    Android DevByte - What’s New in Android Studio 3.0 Canary 1


    Getting Started



    Download




    If you are using a previous version of Android Studio, you can install Android
    Studio 3.0 Canary 1 alongside
    your stable version
    . You can download this update from the official Android
    Studio Preview download
    page
    . As mention in this blog, there are some breaking Gradle Plugin API
    changes to support new features in the IDE. Therefore, you should also update
    your Android Gradle plugin version to 3.0.0-alpha1 in your current project to
    test and validate your app project setup.



    We appreciate any feedback on things you like, issues or features you would like
    to see. If you find a bug or issue, feel free to file an
    issue
    . Connect with us -- the Android Studio development team ‐ on our Google+ page or on Twitter.