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

11/8/17

What's New in Android Studio 3.0

What's New in Android Studio 3.0:

Android Studio 3.0 brings a ton of new features and improvements, including Kotlin support, Android O APIs, Java 8 language features support, external APK debugging, Instant Apps modules and refactoring, an integrated Android Profiler and more.

Migrating to Android Gradle Plugin 3.0.0:

Android Studio 3.0: Android Profiler:

Android Studio 3.0: Java 8 Language Features Support:


Read more in the release notes here: https://goo.gl/7yo9SM

Read More
Advertisement

5/22/17

Download and install Android Studio 3.0 Canary 1 on Ubuntu 17.04

This post show how to Download and install Android Studio 3.0 Canary 1 on 64-bit Ubuntu 17.04, over Windows 10/Oracle VirtualBox,


Firstly, Install Ubuntu 17.04 on Windows 10/Oracle VirtualBox.

Before install Android Studio on 64-bit Ubuntu 17.04, install 32-bit libraries:
$ sudo dpkg --add-architecture i386
$ sudo apt-get update
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386

(details refer to Fix "Unable to run mksdcard SDK tool" when install Android Studio on Linux)

Download Android Studio 3.0 Canary, visit https://developer.android.com/studio/preview/index.html
Unpack the ZIP file, to any directory you want.
Open a terminal, navigate into <android-studio>/bin/ and execute studio.sh

This video show how:


Setup for debugging on real device:

On Ubuntu/Linux, to debug on real device, you have to set up your system to detect your device.
(referencec: https://developer.android.com/studio/run/device.html#setting-up)

Edit/Create /etc/udev/rules.d/51-android.rules
$ sudo nano /etc/udev/rules.d/51-android.rules

Add the code:
SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"

Where 00b4 is the vendor ID, replace it to match your device. For my Samsung device, replace with 04e8.

You can check your USB vendor ID here: https://developer.android.com/studio/run/device.html#VendorIds.

or try to find it using lsusb command.



Kotlin programming language, Now official on Android. It's a dummy Hello World of Kotlin language, created in Android Studio 3.0 Canary 1.



Read More
Advertisement

Get USB devices' vendor ID and product ID on Linux, using lsusb command

To get the vendor ID/product ID of attached USB devices in Linux, you can use the command lsusb.

This video show how to, tested on Ubuntu 17.05 over Windows 10/Oracle VirtualBox 5.1




reference: Ubuntu Manual - lsusb



Read More
Advertisement

5/19/17

Fix "Unable to run mksdcard SDK tool" when install Android Studio on Linux

If you install Android Studio on 64-bit Linux and reported with error:
Unable to run mksdcard SDK tool



Most probably some 32-bit libraries are missed.

If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0

If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686

reference: Troubleshoot Android Studio - Linux libraries


When I try to install the 32-bit libraries on Ubuntu 16.04.2 LTS (64-bit) on VirtualBox with the command:

$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0

The errors reported:
E: Unable to locate package lib32bz2-1.0
E: Couldn't find any package by glob 'lib32bz2-1.0'
E: Couldn't find any package by regex 'lib32bz2-1.0'

To fixed it, add 32 bit architecture with the command:
$ sudo dpkg --add-architecture i386
$ sudo apt-get update

Re-install with the command 
$ sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 libbz2-1.0:i386


Done:


Read More
Advertisement

2/11/17

Building interfaces with ConstraintLayout in Android Studio

The new Layout Editor in Android Studio 2.2 include a new blueprint mode, revamped properties inspector and support for ConstraintLayout, a new way to define layouts for your apps.


In this Android Tool Time episode Wojtek KaliciƄski shows you the basics of working with ConstraintLayouts in the visual editor. If you want to try it out yourself, you can find our codelab here: https://codelabs.developers.google.com/codelabs/constraint-layout

When you’re familiar with the layout editor interface, read the rest of our Medium article where you’ll find some more advanced tips and tricks for ConstraintLayout: https://goo.gl/a5orYw


Read More
Advertisement

2/6/17

IOException: not create document. Error

When I prepare the example "Display PDF in assets folder (inside APK)", I face with the error of "java.io.IOException: not create document. Error". It should be generated by the code:

pdfRenderer = new PdfRenderer(fileDescriptor);


Somebody commented it's caused by new version of Gradle (ref: https://github.com/googlesamples/android-PdfRendererBasic/issues/1), so I edit dependencies of buildscript in build.gradle (Project: ...), use gradle:2.1.2 to solve this problem.


Read More
Advertisement

Create assets folder in Android Studio, and copy file into.

How to create assets folder in Android Studio, and copy a PDF file into the assets folder.

Read More
Advertisement