Monday, October 30, 2017

Whats new in Android Studio 3.0

Android Studio is the official tool for developing Android applications, includes everything we need.

To get the latest version of android studio click 
Help > Check for update (on Mac, Android Studio > Check for updates).

If you're the MAC user you'll face the following issue, just click cancel and continue.


The primary purpose of the 3.0 is to improve the build performance for that projects which have a large number of modules. When using this plugin with large project. you should experience the following updates 

  • Support for android 8.0
  • Support for Java 8 libraries and Java 8 language features (without the Jack compiler).
  • Improved Gradle Sync speed
  • AAPT2 is now enabled by default in
  • Kotlin Support
  • Supports the device file explorer

    To open 
    click View > Tool Windows > Device File Explorer.
  • Supports developing intant apps

  • Supports the adaptive icons for launching the androids apps in 8.0
    to start,
     right-click on the res folder in your project, and then click New > Image Asset. In the Asset Studio window, select Launcher Icons (Adaptive and Legacy) as the icon type.
          
  • Supports for font resources, you can choose various inbuilt font resources for your Android projects, instead of adding manually onto font folder



  • Added Google Moven repository./
    Android studio now uses Google's moven repository by default instead of depending on Android SDK manager to get updates for Android support library, Google play services, Firebase and other dependencies
    allprojects {
        repositories {
            google()
        }
    }
  • Native debugging with windows-32 no longer supports.
    in case if developers chooses to debug apps using window-32 they can use 
    Android Studio 2.3.

Wednesday, October 25, 2017

Fingerprint Authentication

                           

Android 6.0 Marshmallow offers new features for developers and user. This post will help developers to teach how to add Fingerprint authentications to apps.

There are several advantages of using the fingerprint authentications

> Fast and easy to use
> Secured : fingerprint uniquely identifies
> Online transactions are safer 

There are several steps you have to follow before using fingerprint, It could really seems quite complex but this post help you step by step.

* Verify that lock screen is secured by PIN, password or pattern
* Check at least on fingerprint is registered on your phone
* Get access to android keystore to store the key used to encrypt or decrypt an object

* Generate an encryption key and the cipher
* Start the authentication process
* Implement callback methods to handle authentication event

Pre-requisites Android SDK 26
Android build tool v26.0.1
Android support repository


Before starting our app should get permission to access the sensor and fingerprint from android core, It can be done by just adding permission tag in manifest.xml file

<uses-permission android:name="android.permission.USE_FINGERPRINT" /> 

Now we create mainActivity class to handle all authentication process.
FingerprintAuthenticationDialogFragment.java

Small helper class to manage text/icon around fingerprint authentication UI.