Showing posts with label Android Studio. Show all posts
Showing posts with label Android Studio. Show all posts

Wednesday, May 17, 2017

Android Instant Apps is open to all developers. Start building today!



Posted by: Jonathan Karmel, Product Manager


href="https://android-developers.googleblog.com/2017/01/android-instant-apps-starts-initial.html">Earlier
this year, we began testing href="https://developer.android.com/topic/instant-apps/index.html">Android
Instant Apps, a new way to run Android apps without requiring installation.
Thanks to our incredible developer community, we received a ton of feedback that
has helped us refine the end-to-end product experience.



Today, we're opening Android Instant Apps to all developers, so anyone can build
and publish an instant app. There are also more than 50 new experiences
available for users to try from a variety of developers, such as HotPads, Jet,
the New York Times, Vimeo, and One Football. While these experiences have only
been live for a short amount of time, the early data shows positive results. For
example, Jet and HotPads are seeing double digit increases in purchases and
leads generated.




(left to right: One Football, Dotloop, Jet, Vimeo, HotPads and The New York Times)


Feedback from our early partners has directly shaped the development tools we're
making available to all of you today.



To get started building an instant app, head over to href="https://developer.android.com/index.html">developer.android.com and
download the latest preview of href="http://android-developers.googleblog.com/2017/05/android-studio-3-0-canary1.html">Android
Studio 3.0 and the Android Instant Apps SDK. You'll continue to use a single
codebase. Android Studio provides the tools you need to modularize your app so
that features can be downloaded as needed. Every app is different, but we've
seen with our early partners that with the latest tools, instant app development
typically takes about 4-6 weeks.



Once you've built your app, the Play Console provides support for distributing
your instant app. You just upload your instant app APKs together with your
installable APK.



Instant Apps continues to ramp up on the latest Android devices in more than 40
countries. And with Android O, we've gone further, building a new, more
efficient runtime sandbox for instant apps, sharable support libraries to reduce
app size, and launcher integration support.



To learn more, visit g.co/InstantApps. We're also hosting a session "href="https://events.google.com/io/schedule/?section=may-18&sid=bb2dcc45-c5c7-4aa5-8046-754e1b703432">Introduction
to Android Instant Apps" on Thursday, May 18 from 1:30-2:30 PM PT at the
conference to dig deeper into the topic. You'll also be able to watch the live
stream on Google I/O YouTube
channel
.



We are excited to see what experiences you create with Instant Apps!


Friday, April 14, 2017

Java 8 Language Features Support Update


Posted by James Lau, Product Manager



Yesterday, we released Android Studio
2.4 Preview 6
. Java 8 language features are now supported by the Android
build system in the javac/dx compilation path. Android Studio's Gradle plugin
now desugars Java 8 class files to Java 7-compatible class files, so you can use
lambdas,
method references and other features
of Java 8.




For those of you who tried the Jack compiler, we now support the same set of
Java 8 language features but with faster build speed. You can use Java 8
language features together with tools that rely on bytecode, including Instant
Run. Using libraries written with Java 8 is also supported.




We first added Java 8 desugaring in Android Studio 2.4 Preview 4. Preview 6
includes important bug fixes related to Java 8 language features support. Many
of these fixes were made in response to bug reports you filed. We really
appreciate your help in improving Android development tools for the community!




It's easy to try using Java 8 language features in your Android project. Just
download Android Studio
2.4 Preview 6
, and update your project's target and source compatibility to
Java version 1.8. You can find more information in our preview
documentation
.




Happy lambda'ing!

Wednesday, April 5, 2017

Android Developer Story: Robinhood uses Android Studio to quickly build and test new features




Posted by Christopher Katsaros, Developer Marketing, Android



Robinhood allows users to buy and sell stocks commission-free* in the US. It is designed to make financial investment easy for all users, even if you�ve never traded before.



With a team of two Android developers, the company has relied on fast tools like
Android Studio to
build rich new features, which have helped make Robinhood the highest-rated
stock brokerage app on Google Play.




Watch Robinhood's Joe Binney, VP of Product Engineering, and Dan Hill, Android
Developer, talk about how Android Studio is helping them achieve strong growth
on Android.









The top Android developers use Android Studio to build powerful and successful
apps on Google Play; learn more about the official IDE for Android app
development and get
started for yourself
.




Get more tips and watch other success stories in the Playbook for
Developers app
.




*Free trading refers to $0 commissions for Robinhood Financial self-directed individual cash or margin brokerage accounts that trade U.S. listed securities via mobile devices. SEC & FINRA regulatory fees may apply.




 How useful did you find this blogpost?


? ? ? ? ?








Tuesday, March 28, 2017

Calling all early adopters for Android Studio previews

Posted by Scott Main, Technical Writer



If you love trying out all of the newest features in Android Studio and helping us make it a better IDE, we're making it even easier to download early preview builds with a new website. Here, you can download and stay up to date on all the latest Android Studio previews and other tools announcements.







Android Studio previews give you early access to new features in all aspects of the IDE, plus early versions of other tools such as the Android Emulator and platform SDK previews. You can install multiple versions of Android Studio side-by-side, so if a bug in the preview build blocks your app development, you can keep working on the same project from the stable version.



The latest preview for Android Studio 2.4 just came out last week, and it includes new features to support development with the Android O Developer Preview. You can download and set up the O preview SDK from inside Android Studio, and then use Android O�s XML font resources and autosizing TextView in the Layout Editor.



By building your apps with the Android Studio preview, you're also helping us create a better version of Android Studio. We want to hear from you if you encounter any bugs.

Thursday, March 16, 2017

Android Developer Story: LinkedIn uses Android Studio to build a performant app







Posted by Christopher Katsaros, Developer Marketing, Android






LinkedIn is the world's largest social network
for professionals. LinkedIn has 10
apps on Google Play
, including the flagship LinkedIn
app
, which provides all of the same features users find on the web, so users
can do things like browse and send messages to their professional network with
an improved user experience.




For LinkedIn, and other teams with a large number of developers adding code to a
project, making sure that everyone pays attention to areas that affect
performance is vital for the quality of their app. That's why the the LinkedIn
mobile team uses Android Studio to
build high quality Android apps.




Watch Pradeepta Dash, Engineering Manager for Infrastructure at LinkedIn, as
well as Drew Hannay, Tech Lead for the Android Infrastructure team, talk about
how Android Studio helps everyone on their team stay focused on these topics
while getting new engineers quickly up and running:









The top Android developers use Android Studio to build powerful, successful apps
for Google Play; you can learn more about the official IDE for Android app
development, and get
started for yourself
.




Get more tips and watch more success stories in the Playbook for
Developers app
.






How useful did you find this blogpost?


? ? ? ? ?



        











Tuesday, March 14, 2017

Future of Java 8 Language Feature Support on Android


Posted by James Lau, Product Manager 




At Google, we always try to do the right thing. Sometimes this means adjusting
our plans. We know how much our Android developer community cares about good
support for Java 8 language features, and we're changing the way we support
them.





We've decided to add support for Java 8 language features directly into the
current javac and dx set of tools, and deprecate the Jack toolchain. With this
new direction, existing tools and plugins dependent on the Java class file
format should continue to work. Moving forward, Java 8 language features will be
natively supported by the Android build system. We're aiming to launch this as
part of Android Studio in the coming weeks, and we wanted to share this decision
early with you.




We initially tested adding Java 8 support via the Jack toolchain. Over time, we
realized the cost of switching to Jack was too high for our community when we
considered the annotation processors, bytecode analyzers and rewriters impacted.
Thank you for trying the Jack toolchain and giving us great feedback. You can
continue using Jack to build your Java 8 code until we release the new support.
Migrating from Jack should require little or no work.




We hope the new plan will pave a smooth path for everybody to take advantage of
Java 8 language features on Android. We'll share more details when we release
the new support in Android Studio.


Thursday, March 2, 2017

Android Studio 2.3

By Jamal Eason, Product Manager, Android



Android Studio 2.3 is available to download today. The focus for this release is quality improvements across the IDE. We are grateful for all your feedback so far. We are committed to continuing to invest in making Android Studio fast & seamless for the millions of Android app developers across the world.



We are most excited about the quality improvements in Android Studio 2.3 but you will find a small set of new features in this release that integrate into each phase of your development flow. When designing your app, take advantage of the updated WebP support for your app images plus check out the updated ConstraintLayout library support and widget palette in the Layout Editor. As you are developing, Android Studio has a new App Link Assistant which helps you build and have a consolidated view of your URIs in your app. While building and deploying your app, use the updated run buttons for a more intuitive and reliable Instant Run experience. Lastly, while testing your app with the Android Emulator, you now have proper copy & paste text support.



What's new in Android Studio 2.3


For more detail about the features we added on top of the quality improvements Android Studio 2.3, check out the list of the new features below:

Build

  • Instant Run Improvements and UI Changes: As a part of our focus on quality, we have made some significant changes to Instant Run in Android Studio 2.3 to make the feature more reliable. The Run action will now always cause an application restart to reflect changes in your code that may require a restart, and the new Apply Changes action will attempt to swap the code while your app keeps running. The underlying implementation has changed significantly to improve on reliability, and we have also eliminated the startup lag for Instant Run enabled apps. Learn more.




New Instant Run Button Actions
  • Build Cache: Introduced but disabled by default in Android Studio 2.2, Build Cache is an underlying build optimization for faster builds in Android Studio. By caching exploded AARs and pre-dexed external libraries, the new build cached leads to faster clean builds. This is a user-wide build cache that is now turned on by default with Android Studio 2.3. Learn more.

Design

  • Chains and Ratios support in Constraint Layout: Android Studio 2.3 includes the stable release of ConstraintLayout With this release of ConstraintLayout, you can now chain two or more Android views bi-directionally together to form a group on one dimension. This is helpful when you want when you want to place two views close together but want to spread them across empty space. Learn more.




Constraint Layout Chains

ConstraintLayout also supports ratios, which is helpful when you want to maintain the aspect ratio of widget as the containing layout expands and contracts. Learn more about ratios. Additionally, both Chains and Ratios in ConstraintLayout can support programmatic creating with ConstraintSet APIs.




Constraint Layout Ratios



  • Layout Editor Palette: The updated widget palette in the Layout Editor allows you to search, sort and filter to find widgets for your layouts, plus gives you a preview of the widget before dragging on to the design surface. Learn more.






Layout Editor Widget Palette


  • Layout Favorites: You can now save your favorite attributes per widget in the updated Layout Editor properties panel. Simply star an attribute in the advanced panel and it will appear under the Favorites section. Learn more.






Favorites Attributes on Layout Editor Properties Panel
  • WebP Support: To help you save space in your APK, Android Studio can now generate WebP images from PNG assets in your project. The WebP lossless format is up to 25% smaller than a PNG. With Android Studio 2.3, you have a new wizard that converts PNG to lossless WebP and also allows you to inspect lossy WebP encoding as well. Right-click on any non-launcher PNG file to convert to WebP. And if you need to edit the image, you can also right-click on any WebP file in your project to convert back to PNG. Learn more.




WebP Image Conversion Wizard



  • Material Icon Wizard Update: The updated vector asset wizard supports search and filtering, plus it includes labels for each icon asset. Learn more.




Vector Asset Wizard


Develop

  • Lint Baseline: With Android Studio 2.3, you can set unresolved lint warnings as a baseline in your project. From that point forward, Lint will report only new issues. This is helpful if you have many legacy lint issues in your app, but just want to focus on fixing new issues. Learn more about Lint baseline and the new Lint checks & annotations added in this release.




Lint Baseline Support
  • App Links Assistant: Supporting Android App Links in your app is now easier with Android Studio. The new App Links Assistant allows you to easily create new intent filters for your URLs, declare your app's website association through a Digital Asset Links file, and test your Android App Links support. To access the App Link Assistant go to the following menu location: Tools ? App Link Assistant. Learn more.




App Links Assistant
  • Template Updates: By default, all templates in Android Studio 2.3 which use to contain RelativeLayout, now use ConstraintLayout. Learn more about templates and Constraint Layout. We have also added a new Bottom Navigation Activity template, which implements the Bottom Navigation Material Design guideline.






New Project Wizard Templates
  • IntelliJ Platform Update: Android Studio 2.3 includes the IntelliJ 2016.2 release, which has enhancements such as an updated inspection window and a notifications system. Learn more.

Test

  • Android Emulator Copy & Paste: Back by popular demand, we added back the Copy & Paste feature to the latest Emulator (v25.3.1). We have a shared clipboard between the Android Emulator and host operating system, which will allow you to copy text between both environments. Copy & Paste works with x86 Google API Emulator system images API Level 19 (Android 4.4 - Kitkat) and higher.






Copy & Paste support in Android Emulator


  • Android Emulator Command Line Tools: Starting with Android SDK Tools 25.3, we have moved the emulator from the SDK Tools folder into a separate emulator directory, and also deprecated and replaced the "android avd" command with a standalone avdmanager command. The previous command line parameters for emulator and "android avd" will work with the updated tools. We have also added location redirects for the emulator command. However, if you create Android Virtual Devices (AVDs) directly through the command line you should update any corresponding scripts. If you are using the Android Emulator through Android Studio 2.3, these change will not impact your workflow. Learn more.



To recap, Android Studio 2.3 includes these new features and more:





Develop

Build

Design

Test



Learn more about Android Studio 2.3 by reviewing the release notes.



Getting Started




Download

If you are using a previous version of Android Studio, you can check for updates on the Stable channel from the navigation menu (Help ? Check for Update [Windows/Linux] , Android Studio ? Check for Updates [OS X]). You can also download Android Studio 2.3 from the official download page. To take advantage of all the new features and improvements in Android Studio, you should also update to the Android Gradle plugin version to 2.3.0 in your current app project.
We appreciate any feedback on things you like, issues or features you would like to see. Connect with us -- the Android Studio development team -- on our Google+ page or on Twitter.

Thursday, November 10, 2016

Understanding APK packaging in Android Studio 2.2

Posted by Wojtek Kalicinski, Android Developer Advocate


Android Studio 2.2 launched recently with href="http://android-developers.blogspot.com/2016/09/android-studio-2-2.html">many
new and improved features. Some of the changes are easy to miss because they
happened under the hood in the Android Gradle plugin, such as the newly
rewritten integrated APK packaging and signing step.






APK Signature Scheme v2



With the introduction of the new href="https://source.android.com/security/apksigning/v2.html">APK Signature
Scheme v2 in Android 7.0 Nougat, we decided to rewrite how assembling APKs
works in the Android Gradle plugin. You can read all about the low-level
technical details of v2 signatures in the href="https://source.android.com/security/apksigning/v2.html">documentation,
but here's a quick tl;dr summary of the info you need as an Android app
developer:


  • The cryptographic signature of the APK that is used to verify its integrity
    is now located immediately before the ZIP Central Directory.
  • The signature is computed and verified over the binary contents of the whole
    APK file, as opposed to decompressed file contents of each file in the archive
    in v1.
  • An APK can be signed by both v1 and v2 signatures at the same time, so it
    remains backwards compatible with previous Android releases.


Why introduce this change to how Android verifies APKs? Firstly, for enhanced
security and extensibility of this new signing format, and secondly for
performance - the new signatures take significantly less time to verify on the
device (no need for costly decompression), resulting in faster app installation
times.



The consequence of this new signing scheme, however, is that there are new
constraints on the APK creation process. Since only uncompressed file contents
were verified in v1, that allowed for quite a lot of modifications to be made
after APK signing - files could be moved around or even recompressed. In fact,
the zipalign tool which was part of the build process did exactly
that - it was used to align ZIP entries on correct byte boundaries for improved
runtime performance.



Because v2 signatures verify all bytes in the archive and not individual ZIP
entries, running zipalign is no longer possible after
signing
. That's why compression, aligning and signing now happens in a
single, integrated step of the build process.



If you have any custom tasks in your build process that involve tampering with
or post-processing the APK file in any way, please make sure you disable them or
you risk invalidating the v2 signature and thus making your APKs incompatible
with Android 7.0 and above.



Should you choose to do signing and aligning manually (such as from the command
line), we offer a new tool in the Android SDK, called href="https://developer.android.com/studio/command-line/apksigner.html?utm_campaign=android_discussion_api_111016&utm_source=anddev&utm_medium=blog">apksigner,
that provides both v1 and v2 APK signing and verification. Note that you need to
run zipalign before running apksigner
if you are using v2 signatures. Also remember the jarsigner tool
from the JDK is not compatible with Android v2 signatures, so you can't use it
to re-sign your APKs if you want to retain the v2 signature.


In case you want to disable adding v1 or v2 signatures when building with the
Android Gradle plugin, you can add these lines to your href="https://google.github.io/android-gradle-dsl/current/com.android.build.gradle.internal.dsl.SigningConfig.html">signingConfig
section in build.gradle:

class="prettyprint">v1SigningEnabled false
v2SigningEnabled false


Note: both signing schemes are enabled by default in Android Gradle plugin 2.2.


Release builds for smaller APKs



We took this opportunity when rewriting the packager to make some optimizations
to the size of release APKs, resulting in faster downloads, href="http://android-developers.blogspot.co.uk/2016/07/improvements-for-smaller-app-downloads.html">smaller
delta updates on the Play Store, and less wasted space on the device. Here
are some of the changes we made:


  • Files in the archive are now sorted to minimize differences between APK
    builds.
  • All file timestamps and metadata are zeroed out.
  • Level 6 and level 9 compression is checked for all files in parallel and the
    optimal one is used, i.e. if L9 provides little benefit in terms of size, then
    L6 may be chosen for better performance
  • Native libraries are stored uncompressed and page aligned in the APK. This
    brings support for the android:extractNativeLibs="false" option
    from Android 6.0 Marshmallow and lets applications use less space on the device
    as well as generate smaller updates on the Play Store
  • Zopfli compression is not used to better support Play Store update
    algorithms. It is not recommended to recompress your APKs with Zopfli.
    Pre-optimizing individual resources such as PNG files in your projects is still
    fine and recommended.


These changes help make your releases as small as possible so that users can
download and update your app even on a slower connection or on less capable
devices. But what about debug builds?


Debug builds for installation speed



When developing apps you want to keep the iteration cycle fast - change code,
build, and deploy on a connected device or emulator. Since Android Studio 2.0
we've been working to make all the steps as fast as possible. With Instant Run
we're now able to update only the changed code and resources during runtime,
while the new Emulator brings multi-processor support and faster ADB speeds for
quicker APK transfer and installation. Build improvements can cut that time even
further and in Android Studio 2.2 we're introducing incremental packaging and
parallel compression for debug builds. Together with other features like
selectively packaging resources for the target device density and ABI this will
make your development even faster.



A word of caution: the APK files created for Instant Run or by invoking a debug
build are not meant for distribution on the Play Store! They contain additional
instrumentation code for Instant Run and are missing resources for device
configurations other than the one that was connected when you started the build.
Make sure you only distribute release versions of the APK which you can create
using the Android Studio href="https://developer.android.com/studio/publish/app-signing.html?utm_campaign=android_discussion_api_111016&utm_source=anddev&utm_medium=blog#release-mode">Generate
Signed APK command or the assembleRelease Gradle task.


Monday, September 19, 2016

Android Studio 2.2


By Jamal Eason, Product
Manager, Android



Android Studio 2.2 is available to href="https://developer.android.com/studio/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">download today.
Previewed at Google I/O 2016, Android Studio 2.2 is the latest release of our
IDE used by millions of Android developers around the world.



Packed with enhancements, this release has three major themes: speed, smarts,
and Android platform support. Develop faster with features such as the new
Layout Editor, which makes creating an app user interface quick and intuitive.
Develop smarter with our new APK analyzer, enhanced Layout Inspector, expanded
code analysis, IntelliJ�s 2016.1.3 features and much more. Lastly, as the
official IDE for Android app development, Android Studio 2.2 includes support
for all the latest developer features in Android 7.0 Nougat, like href="https://developer.android.com/studio/intro/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#code_completion">code
completion to help you add Android platform features like href="https://developer.android.com/about/versions/nougat/android-7.0.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#multi-window_support">Multi-Window
support, href="https://developer.android.com/about/versions/nougat/android-7.0.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#tile_api">Quick
Settings API, or the redesigned href="https://developer.android.com/about/versions/nougat/android-7.0.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#notification_enhancements">Notifications,
and of course, the built-in href="https://developer.android.com/studio/run/emulator.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Android
Emulator to test them all out.



In this release, we evolved the Android Frameworks and the IDE together to
create the Constraint Layout. This powerful new layout manager helps you design
large and complex layouts in a flat and streamlined hierarchy. The
ConstraintLayout integrates into your app like a standard Android
support library, and was built in parallel with the new Layout Editor.





Android Studio 2.2 includes 20+ new features across every major phase of the
development process: design, develop, build, & test. From designing UIs with
the new ConstraintLayout, to developing C++ code with the Android
NDK, to building with the latest Jack compliers, to creating Espresso test cases
for your app, Android Studio 2.2 is the update you do not want to miss. Here�s
more detail on some of the top highlights:



Design


  • Layout Editor: Creating Android app user interfaces is now
    easier with the new user interface designer. Quickly construct the structure of
    your app UI with the new blueprint mode and adjust the visual attributes of each
    widget with new properties panel. href="https://developer.android.com/studio/write/layout-editor.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Learn
    more.



Layout Editor



  • Constraint Layout: This new layout is a flexible layout
    manager for your app that allows you to create dynamic user interfaces without
    nesting multiple layouts. It is backwards compatible all the way back to Android
    API level 9 (Gingerbread). ConstraintLayout works best with the new Layout
    Editor in Android Studio 2.2. href="https://developer.android.com/training/constraint-layout/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Learn
    more.



ConstraintLayout




Develop


  • Improved C++ Support: You can now use href="https://developer.android.com/studio/projects/add-native-code.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">CMake
    or ndk-build to compile your C++ projects from Gradle. Migrating projects
    from CMake build systems to Android Studio is now seamless. You will also find
    C++ support in the new project wizard in Android Studio, plus a number of bug
    fixes to the C++ edit and debug experience. href="https://developer.android.com/studio/projects/add-native-code.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Learn
    more.



C++ Code Editing & CMake Support



  • Samples Browser: Referencing href="http://developer.android.com/samples/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Android sample code
    is now even easier with Android Studio 2.2. Within the code editor window, find
    occurrences of your app code in Google Android sample code to help jump start
    your app development. Learn more.



Sample Code Menu




Build


  • Instant Run Improvements: Introduced in Android Studio 2.0,
    href="https://developer.android.com/studio/run/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#instant-run">Instant
    Run is our major, long-term investment to make Android development as fast
    and lightweight. Since launch, it has significantly improved the edit, build,
    run iteration cycles for many developers. In this release, we have made many
    stability and reliability improvements to Instant Run. If you have previously
    disabled Instant Run, we encourage you to re-enable it and let us know if you
    come across further issues. (Settings ? Build, Execution, Deployment ? Instant
    Run [Windows/Linux] , Preferences ? Build, Execution, Deployment ? Instant Run
    [OS X]). For details on the fixes that we have made, see the href="https://developer.android.com/studio/releases/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Android Studio
    2.2 release notes.



Enable Instant Run



  • APK Analyzer: Easily inspect the contents of your APKs to
    understand the size contribution of each component. This feature can be helpful
    when debugging href="https://developer.android.com/studio/build/multidex.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">multi-dex
    issues. Plus, with the APK Analyzer you can compare two versions of an APK. href="https://developer.android.com/studio/build/apk-analyzer.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Learn
    more.



APK Analyzer



  • Build cache (Experimental): We are continuing our
    investments to improve build speeds with the introduction of a new experimental
    build cache that will help reduce both full and incremental build times. Just
    add android.enableBuildCache=true to your
    gradle.properties file. href="http://tools.android.com/tech-docs/build-cache">Learn more.





Build Cache Setting




Test


  • Virtual Sensors in the Android Emulator: The Android
    Emulator now includes a new set of virtual sensors controls. With the new UI
    controls, you can now test href="https://developer.android.com/guide/topics/sensors/sensors_overview.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Android
    Sensors such as Accelerometer, Ambient Temperature, Magnetometer and more.
    Learn
    more
    .



Android Emulator Virtual Sensors



  • Espresso Test Recorder (Beta): The Espresso Test Recorder
    lets you easily create UI tests by recording interactions with your app; it then
    outputs the href="https://developer.android.com/topic/libraries/testing-support-library/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#Espresso">UI
    test code for you. You record your interactions with a device and add
    assertions to verify UI elements in particular snapshots of your app. Espresso
    Test Recorder then takes the saved recording and automatically generates a
    corresponding UI test. You can run the test locally, on your continuous
    integration server, or using href="https://developer.android.com/training/testing/unit-testing/instrumented-unit-tests.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#run-ctl">Firebase
    Test Lab for Android. href="https://developer.android.com/studio/test/espresso-test-recorder.html">Learn
    more.


Espresso Test Recorder


  • GPU Debugger (Beta): The GPU Debugger is now in Beta. You
    can now capture a stream of OpenGL ES commands on your Android device and then
    replay it from inside Android Studio for analysis. You can also fully inspect
    the GPU state of any given OpenGL ES command to better understand and debug your
    graphical output. href="https://developer.android.com/studio/debug/am-gpu-debugger.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Lean
    more.



GPU Debugger


To recap, Android Studio 2.2 includes these major features and more:







Design

  • href="https://developer.android.com/studio/write/layout-editor.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Layout
    Editor
  • href="https://developer.android.com/training/constraint-layout/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Constraint
    Layout
  • Layout
    Inspector
    (Experimental)
  • href="https://developer.android.com/studio/write/vector-asset-studio.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">PSD
    File Support in Vector Asset Studio


Develop


  • href="https://developer.android.com/studio/write/firebase.html">Firebase
    Plugin
  • Updated Code
    Analysis & Lint checks

  • href="https://developer.android.com/studio/intro/accessibility.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Enhanced
    accessibility support
  • Improved C++
    Support Edit & Debugging

  • href="https://confluence.jetbrains.com/display/IDEADEV/IntelliJ+IDEA+2016.1.3+Release+Notes">IntelliJ
    2016.1.3 platform update
  • Samples Browser
  • Improved Font Rendering

Build

  • href="https://developer.android.com/guide/platform/j8-jack.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#configuration">Jack
    Compiler Improvements
  • Java 8
    Language Support

  • href="https://developer.android.com/studio/projects/add-native-code.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">C++
    ndk-build or CMake
  • href="http://android-developers.blogspot.com/2016/05/android-studio-22-preview-new-ui.html">Merged
    Manifest Viewer
  • Build cache
    (Experimental)
  • OpenJDK Support
  • Instant Run Improvements


Test


  • href="https://developer.android.com/studio/test/espresso-test-recorder.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">Espresso
    Test Recorder (Beta)
  • APK
    Analyzer

  • href="https://developer.android.com/studio/debug/am-gpu-debugger.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">GPU
    Debugger (Beta)
  • href="https://developer.android.com/studio/run/emulator.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog#extended">Virtual
    Sensors in the Android Emulator



Learn more about Android Studio 2.2 by reviewing the href="https://developer.android.com/studio/releases/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">release notes
and the href="http://android-developers.blogspot.com/2016/05/android-studio-22-preview-new-ui.html">preview
blog post.



Getting Started



Download



If you are using a previous version of Android Studio, you can check for updates
on the Stable channel from the navigation menu (Help ? Check for Update
[Windows/Linux] , Android Studio ? Check for Updates [OS X]). You can also
download Android Studio 2.2 from the official href="https://developer.android.com/studio/index.html?utm_campaign=android studio_launch_2.2_091916&utm_source=anddev&utm_medium=blog">download page. To
take advantage of all the new features and improvements in Android Studio, you
should also update to the Android Gradle plugin version to 2.2.0 in your current
app project.



Next Release



We would like to thank all of you in the Android Developer community for your
work on this release. We are grateful for your contributions, your ongoing
feedback which inspired the new features in this release, and your highly active
use on canary and beta builds filing bugs. We all wanted to make Android Studio
2.2 our best release yet, with many stability and performance fixes in addition
to the many new features. For our next release, look for even more; we want to
work hard to address feedback and keep driving up quality and stability on
existing features to make you productive.



We appreciate any feedback on things you like, issues or features you would like
to see. Connect with us -- the Android Studio development team -- on our href="https://plus.google.com/103342515830390186255">Google+ page or on href="http://www.twitter.com/androidstudio">Twitter.






What's New in Android Studio 2.2

Thursday, May 19, 2016

Android Studio 2.2 Preview - New UI Designer & Constraint Layout


By Jamal Eason, Product Manager, Android





This week at Google I/O 2016 we launched Android Studio 2.2 Preview. This release is a large update that builds upon our focus to create a fast and productive integrated development environment (IDE) for Android. Developed in sync with the Android platform, Android Studio allows you to develop with the latest Android APIs and features. Since launching Android Studio at Google I/O just 3 years ago, we received great feedback from on you on what features you want the most. Today 92% of the top 125 apps & game developers on Google Play, plus millions of developers worldwide, use Android Studio. We want to continue to build features that will continue to make you more efficient when developing for Android and more productive.

Android Studio 2.2 Preview includes a portfolio of new features along the spectrum of developments, ranging from designing user interfaces to building and debugging your app in new ways. This preview includes the following new categories of features:


Design 


  • Layout Editor: A new user interface designer that helps you visually design the layouts in your app. Features like blueprint mode and the new properties panel allow you to quickly edit layouts and widgets faster.

  • Constraint Layout: A new powerful and flexible Android layout that allows you to express complex UIs without nesting multiple layouts. 

  • Layout Inspector: Debug a snapshot of your app layout running on the Android Emulator or device. Inspect the view hierarchy and corresponding attributes.




Develop


  • Firebase Plugin: Explore and integrate the suite of services offered by Firebase inside of Android Studio. Adding services like Analytics, Authentication, Notifications, and AdMob are just a few clicks away.

  • Enhanced Code Analysis: Android Studio checks the quality of your Android app code. In addition to 260 Android lint and code inspections, this release includes new code quality checks for Java 8 language usage and a new inspection infrastructure for more cross-file analysis.

  • Samples Browser: Referencing Android sample code is now even easier. Within the code editor window, find occurrences of your app code snippets in Google Android sample code to help jump start your app development.

  • Improved C++ Support: Android Studio 2.2 improves C++ development with the ability to edit, build, and debug pre-existing Android projects that use ndk-build or CMake rather than Gradle. Additionally, the existing lldb C++ debugger is now even better with project type auto-detection and a Java language aware C++ mode that lets you use a single debugger process to inspect both Java language and C++ runtimes.

  • IntelliJ 2016.1: Android Studio 2.2 includes all the latest updates from the underlying JetBrains product platforms IntelliJ.




Build


  • Jack Compiler Improvements: For those using the new Jack compiler, Android Studio 2.2 adds support for annotation processing, as well as incremental builds for reduced build times.

  • Merged Manifest Viewer: Diagnose how your AndroidManifest.xml merges with your app dependences across your project build variants. 




Test


  • Espresso Test Recorder: Record Espresso UI tests simply by using your app as a normal user. As you click through your app UI, reusable and editable test code is then generated for you. You can run the generated tests locally, in your Continuous Integration environment, or in Firebase Test lab

  • APK Analyzer: Drill into your APK to help you reduce your APK size, debug 64K method limit issues, view contents of Dex files and more.










Google I/O �16: What�s New in Android Development Tools







Deeper Dive into the New Features 


Design


  • Layout Editor: Android Studio 2.2 features a new user interface designer. There are many enhancements but some of the highlights include: 


    • Drag-and-drop widgets from the palette to the design surface or the component tree view of your app.

    • Design surface has a blueprint mode to inspect the spacing and arrangement of your layout. 

    • Properties panel now shows a curated set of properties for quick widget edits with a full sheet of advanced properties one click away.

    • UI builder can edit menu and system preference files. 






The new Layout Editor in Android Studio 2.2 Preview




Edit Menus in the new Layout Editor




  • Constraint Layout: This new layout is a flexible layout manager for your app that allows you to create dynamic user interfaces without nesting multiple layouts. It is distributed as a support library that is tightly coupled with Android Studio and backwards compatible to API Level 9. 



At first glance, Constraint Layout is similar to RelativeLayout. However, the Constraint Layout was designed to be used in Studio and it can efficiently express your app design so that you rely on fewer layouts like LinearLayout, FrameLayout, TableLayout, or GridLayout. Lastly, with the built-in automatic constraints inference engine. You can freely design your UI to your liking and let Android Studio do the hard work.



To help you get started, the built-in templates in the New Project Wizard in Android Studio 2.2 Preview now generate  a Constraint Layout. Alternately, you can right click on any layout in the new Layout Editor and select the Convert to ConstraintLayout option.



This is an early preview of the UI designer and Constraint Layout, and we will rapidly add enchantments in upcoming releases. Learn more on the Android Studio tools site.















    Constraint Layout








    Start Layout Inspector


    • Layout Inspector: For new and existing layouts, many times you may want to debug your app UI to determine if your layout is rendering as expected. With the new Layout Inspector, you can drill into the view hierarchy of your app and analyze the attributes of each component of UI on the screen. 



    To use the tool, just click on Layout Inspector Icon in the Android Monitor Window, and then Android Studio creates a snapshot of the current view hierarchy of your app for you to inspect.







    Layout Inspector





    Develop



    • Firebase Plugin: Firebase is the new suite of developers services that can help you develop high-quality apps, grow your user base, and earn more money. Inside of Android Studio, you can add Firebase to a new or existing Android app with the new Assistant window. To access the Firebase features click on the Tools menu and then select Firebase. You will want to first setup the brand new Firebase Analytics as the foundation as you explore other Firebase services like Firebase Cloud Messaging or Firease Crash Reporting to add your application. Learn more about the Firebase integration inside Android Studio here.












    Firebase Plugin for Android Studio



    • Code Sample Browser: In addition to importing Android Samples, the Code Sample Browser is a menu option inside Android Studio 2.2 Preview that allows you to find high-quality, Google-provided Android code samples based on the currently highlighted symbol in your project. To use the feature, highlight a Variables, Types and Methods in your code then Right Click to show a context menu for Find Sample Code. The results are displayed in a bottom output box.   






    Code Sample Browser



    Build



    • CMake and NDK-Build: For those of you using the Android NDK, Android Studio now supports building CMake and NDK-Build Android app projects by pointing Gradle at your existing build files. Once you�ve added your cmake or ndk-build project to Gradle, Android Studio will automatically open your relevant Android code files for editing and debugging in Studio.







    For CMake users, just add the path to your CMList.txt file in the externalNativeBuild section of your Gradle file:




    CMake Build in Android Studio



    For NDK-Build Users, just add the path to your *.mk file in the section of your Gradle file:







    NDK-Build in Android Studio





    • Improved Jack Tools: The new Jack Toolchain compiles your Java language source into Android dex bytecode. The Jack compiler allows some Java 8 language features, like lambdas, to be used on all versions of Android. This release adds incremental build and full support for annotation processing, so you can explore using Java 8 language features in your existing projects.





    To use incremental build with Jack add the following to your build.gradle file:








    Enable Jack Incremental Compile Option



    Jack will automatically apply annotations processors in your classpath. To use an annotation processor at compile-time without bundling it in your apk, use the new annotationProcessor dependency scope:







    Enable Jack Annotation Processing



    • Merged Manifest Viewer: Figuring out how your AndroidManifest merges with your project dependencies based on build types, flavors and variants is now easier with Android Studio. Navigate to your AndroidManifest.xml and click on the new Merged Manifest bottom tab. Explore how each node of your AndroidManifest resolves with various project dependencies.  






    Merged Manifest Viewer


    Test




    • Espresso Test Recorder: Sometimes writing UI tests can be tedious. With the Record Espresso UI tests feature, creating tests is now as easy as just using your app. Android Studio will capture all your UI interactions  and convert them into a fully reusable Espresso Test that you can run locally or even on Firebase Test lab. To use the recorder, go to the Run menu and select Record Espresso Test.







    Espresso Test Recorder




    • APK Analyzer: The new APK Analyzer helps you understand the contents and the sizes of different components in your APK. You can also use it to avoid 64K referenced method limit issues with your Dex files, diagnose ProGuard configuration issues, view merged AndroidManifest.xml file, and inspect the compiled resources file (resources.arsc). This can help you reduce your APK size and ensure your APK contains exactly the things you expect.



    The APK Analyzer shows you both the raw file size as well as the download size of various components in your APK. The download size is the estimated size users need to download when the APK is served from Google Play. This information should help you prioritize where to focus in your size reduction efforts.







    To use this new feature, click on the Build menu and select Analyze APK� Then, select any APK that you want to analyze.








    APK Analyzer




    • Java-aware C++ Debugger:  When debugging C++ code on targets running N and above, you can now use a single, Java language aware lldb instance. This debugger continues to support great lldb features like fast steps and memory watchpoints while also allowing you to stop on Java language breakpoints and view your Java language memory contents.







    • Auto Debugger Selection: Android Studio apps can now use debugger type �Auto.� This will automatically enable the appropriate debugger -- the Java language aware C++ debugger if enabled and otherwise the hybrid debugger for C++ projects.  Projects exclusively using the Java language will continue to use the Java language debugger.







    Enable Auto Debugger for C++


    What's Next 


    Download



    If you are using a previous version of Android Studio, you can check for updates on the Canary channel from the navigation menu (Help ? Check for Update [Windows/Linux] , Android Studio ? Check for Updates [OS X]). This update will download a new version, and not patch your existing copy of Android Studio. You can also download Android Studio 2.2 Preview from canary release site.



    For the Android Studio 2.2 Preview, we recommend you run a stable version alongside the new canary. Check out the tools site on how to run two versions at the same time.



    We appreciate any feedback on things you like, issues or features you would like to see. Connect with us -- the Android Studio development team -- on our Google+ page or on Twitter