Posts

Android Curl View Animation | Java | Kotlin | And

Step 1.  Add the JitPack repository to your build file Add it in your root build.gradle at the end of repositories: allprojects { repositories { .. . maven { url ' https://jitpack.io ' } } } Step 2.  Add the dependency dependencies { compile ' com.github.yogeshpaliyal:Android-Curl-View-Animation:-SNAPSHOT ' } Step 3.  Add Curl View To Your Layout < techpaliyal .com.curlviewanimation.CurlView android : layout_width = " match_parent " android : layout_height = " match_parent " app : horizontal_two_page = " false " android : id = " @+id/curlView " /> Step 4.  Create Int Array (JAVA) Java ArrayList< Integer > arrImages = new ArrayList< Integer > (); Kotlin var arrImages = ArrayList< Int > () Step 5.  Load Array(Both Java & Kotlin) arrImages . add( R . drawable . img1); arrImages . add( R . drawable . img2);

Android Easy Runtime Permissions with Dexter

Image
We all know that Android Marshmallow introduced runtime permissions letting user to allow or deny any permission at runtime. Implementing runtime permissions is a tedious process and developer needs to write lot of code just to get a single permission. In this article, we are going to simplify the process of adding the runtime permissions using Dexter library. Using this library, the permissions can be implemented in few minutes. This is an introductory article about the Dexter covering basic features offered by the library. Dexter provides other features like using it with SnackBar, different types of listeners, error handling and few other. You can find more information on Dexter’s developer page. 1. Dexter Permissions Library To get started with Dexter, add the dependency in your build.gradle dependencies {      // Dexter runtime permissions      implementation 'com.karumi:dexter:4.2.0' } 1.1 Requesting Single Permission To request a sin

How To Add Kotlin Anko Library

Image
Anko is a Kotlin library which makes Android application development faster and easier. It makes your code clean and easy to read, and lets you forget about rough edges of the Android SDK for Java. Anko consists of several parts: Anko Commons : a lightweight library full of helpers for intents, dialogs, logging and so on; Anko Layouts : a fast and type-safe way to write dynamic Android layouts; Anko SQLite : a query DSL and parser collection for Android SQLite; Anko Coroutines : utilities based on the kotlinx.coroutines library. Anko Commons Anko Commons is a "toolbox" for Kotlin Android developer. The library contains a lot of helpers for Android SDK, including, but not limited to: Intents ( wiki ); Dialogs and toasts ( wiki ); Logging ( wiki ); Resources and dimensions ( wiki ).   add to your project Level Gradle ext.anko_version = '0.10.1'   add this to your app level gradle compile "org.jetbrains.anko:anko: $anko

Compressor Library Kotlin + Java

Image
    Compressor is a lightweight and powerful android image compression library. Compressor will allow you to compress large photos into smaller sized photos with very less or negligible loss in quality of the image.  Gradle dependencies { compile ' id.zelory:compressor: 2.1 . 0 ' }   Let's compress the image size! Compress Image File var compressedImageFile = Compressor( this ).compressToFile(actualImageFile)   Compress Image File to Bitmap var compressedImageBitmap = Compressor( this ).compressToBitmap(actualImageFile)   I want custom Compressor! var compressedImage =Compressor( this ) .setMaxWidth( 640 ) .setMaxHeight( 480 ) .setQuality( 75 ) .setCompressFormat(Bitmap.CompressFormat.WEBP) .setDestinationDirectoryPath(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_PICTURES).getAbsolutePath()) .compressToFile(actualImage)   Source: Compressor

Fast Android Networking Library Kotlin

Image
Requirements Fast Android Networking Library can be included in any Android application. Fast Android Networking Library supports Android 2.3 (Gingerbread) and later. Using Fast Android Networking Library in your application Add this in your build.gradle compile 'com.amitshekhar.android:android-networking:1.0.0'   Do not forget to add internet permission in manifest if already not present < uses-permission android :name= "android.permission.INTERNET" />   Then initialize it in onCreate() Method of application class : AndroidNetworking.initialize( applicationContext )   Making a GET Request AndroidNetworking.get( "https://fierce-cove-29863.herokuapp.com/getAllUsers/{pageNumber}" ) .addPathParameter( "pageNumber" , "0" ) .addQueryParameter( "limit" , "3" ) .addHeaders( "token" , "1234" ) .setTag( "test" ) .setPriority