Posts

Github OAuth Client Library - Android

Image
The Github_OAuth library helps to easily add a Github's OAuth implementation flow to your Android application. It will open a new Dialog Fragment with webview and user token will be returned on callback. Find more about GitHub's OAuth implementation Let’s go through a sample application that authenticate using Github. complete source code of this library and sample application is available on Github. Setup Using Gradle The Github-OAuth library is pushed to jcenter, so you need to add the following dependency to your app's build.gradle. As a module If you can't include it as gradle dependency, you can also download this GitHub repo and copy the library folder to your project. Usage Obtaining GithubAuthenticator instance Obtaining an access token via the GithubAuthenticator Authenticate will open a new Dialog Fragment with webview and user token will be returned on callback Enable logs Scope can also be defined (optional)

Picture-in-Picture: Working in Android Oreo

Image
From release of the Android O , which saw some exciting new additions for us to get our hands on! One of the most noticeable user-facing changes is the introduction of a picture in picture (PIP) option – similar to an Apple iPad feature added in iOS 9 – which should make multitasking easier in some circumstances.   PIP is a special type of multi-window mode mostly used for video playback. PIP mode is already available for Android TV; Android O makes the feature available on other Android devices. Let’s take a look at this exciting new feature and how we can implement it into our Android applications! To learn more about Picture-in-Picture I created a playground project to have a play with the new features. You can check this out for yourself here! What is Picture-In-Picture? Picture-in-Picture (PiP) allows you to keep videos open as they play on top of of another screen. This wouldn’t be the same as the multi-window feature which allows users to keep two

How to Use Kotlin in Your Android Projects

Image
One great news of moving to Kotlin is, do not need to start from a new project. You could add it to your existing Java Android project. The language is interoperable with Java. So you could use steps below either for a new or existing project. Setting up Your Environment By default, Android Studio has no idea what to do with Kotlin, so the first step is to install the Kotlin plugin and configure Kotlin in your project. Installing the Kotlin Plugin Launch Android Studio and install the kotlin plugin. In Android Studio's quick start menu, select Configure >> Plugins . click on Install JetBrains plugin… Search for and select Kotlin from the list and click Install . When the installation completes, restart Android Studio to activate the plugins. Configuring Your Project to Use Kotlin Now IDE can understand and run Kotlin code, but need to configure kotlin for every project. Create a new project in Android Studio from File >> New

Kotlin: Do more with less code

Image
Java is the most widely used language for Android development, but that doesn’t mean it is always the best choice.The biggest problem with Java is that it is old , verbose , not a “ modern language ” and don’t forget the infamous NullPointerException . Java 8 , bringing some modern flavors to the language but Android certainly doesn’t use all the features of Java 8 and we are still stuck in the old Java 7 and 6.That's where Kotlin comes in: This relatively new open source language, based on the Java Virtual Machine (JVM), is gaining traction with Android software engineers. What is Kotlin? Kotlin is a statically-typed programming language(sometimes referred to as Swift for Android) that runs on the JVM, developed by the JetBrains team , and is now in its 1.1 version. What makes it useful in Android development is that it compiles to JVM bytecode. It is fully compatible with Java, and Kotlin code can be simply converted to Java code and vice versa (there is a plugin

Introduction to Spring Animation

Image
When writing an application, it's important to consider exactly what your graphical demands will be. Varying graphical tasks are best accomplished with varying techniques. Android provides a variety of powerful APIs for applying animation to UI elements and drawing custom 2D and 3D graphics. Dynamic-animation is a new module introduced in revision 25.3.0 of the Android Support Library . It provides a small set of classes for making realistic Physics-based Animations . What is Physics-based Animation Physics-based animation uses the fundamentals of physics to build animations. An animation is driven by force. The animation comes to rest when the force reaches equilibrium. The new set of animation APIs embeds physics to render a more natural-looking and flexible animation. Spring Animation Spring Animation is one of the animation API provided by the Dynamic-animation module. Physics-based animations are driven by force. Spring force, is one such force that guides in