Posts

Showing posts from May, 2017

How to blur background images?

Image
There are many libraries available for blur the background.They are providing many good functionalities if your need is just blur the background then you don't need to import big libraries.Here is the simplest way to blur your background lets have a look.   Let us starting with Layout.XML file.Let's create activity_main.xml you can choose your own name and set the id to the parent layout.Here I gave the name "relFullScreen" don't forget to set the id to parent layout this is very important we see it later on. <?xml version="1.0" encoding="utf-8"?> <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/relFullScreen" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/colorPrimary"> <ImageView android:layout_width="100dp" android:layout_height="100dp" android:layout

Upload Image using okHttp

Many developer facing the problem with upload image using okHttp.So here is the clear solution which works with every OS.You just need to implement this " Multipart Request " class. OPTION 1 : First of all Download the OkHttp dependency and paste it into your build.gradle file. dependencies {    compile 'com.squareup.okhttp3:okhttp:3.7.0' } OPTION 2 : Or If you have .jar file for OkHttp then put it into libs folder and then paste the below code in build.gradle file. dependencies {    compile files('libs/okhttp-3.7.0.jar') }   You can choose any option from above either options 1 dependency or option 2 jar file choice is yours. Now, add useLibrary Http legacy in build.gradle file inside android method. android {     useLibrary 'org.apache.http.legacy' } Now let us create a class with the name of " MultipartRequest " and paste the below code. import android.content.Context; import android.util.Log; import org.apache.http.Ht