Skip to main content

Posts

Showing posts from November, 2019

Connection type HTTP not supported in Android Pie(9)

Sometimes we face the error that same application which support http not working in some mobile devices specially in android pie and above devices and even some websites not showing in WebView with http connection type url . The error is something like this: Exception: IOException java.io.IOException: Cleartext HTTP traffic to * not permitted and same error in Web View like: so in this post we will learn about how to solve this problem and make our app support for all devices. So lets start - As per the Android Documentation  From Android 9 Pie now, requests without encryption will never work. And by default, the System will expect you to use TLS by default. Starting with Android 9 (API level 28), cleartext support is disabled by default. Android 9 adds built-in support for DNS over TLS, automatically upgrading DNS queries to TLS if a network's DNS server supports it. so from android pie we can say that the default http is not supported and by default connecti

How to Create Image Slider with Page Indicator

Image slider are used in almost every Android Application .In this post we will Learn about Creating Image Slider with page Indicator.So lets start with Coding part:- First of all we need to add this library in our build.gradle file compile 'com.squareup.picasso:picasso:2.3.3' Step 1: activity_main.xml <RelativeLayout android:layout_width="match_parent" android:layout_height="200dp"> <android.support.v4.view.ViewPager android:id="@+id/vp_slider" android:layout_width="match_parent" android:layout_height="match_parent" /> <LinearLayout android:id="@+id/ll_dots" android:layout_width="match_parent" android:layout_height="30dp" android:layout_alignParentBottom="true" android:layout_marginBottom="20dp" android:gravity="center" android:orientation="horizontal"></LinearLayout> </Rel

How to Download Apk file from Url and Install Programmatically

In this post we learn about download apk file from server or website and then install it Programmatically in Phone. Sometimes we have to download external apk file from server and then install if downloading successfully finished.For this we use AsyncTask class  for background process. So here is Code Snippet for this task.Lets Start :- Before this we have to add these Permissions in Manifest.xml file : <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> DownloadNewVersion.java class DownloadNewVersion extends AsyncTask<String,Integer,Boolean> { @Override protected void onPreExecute() { super.onPreExecute(); bar = new ProgressDialog(getActivity()); bar.setCancelable(false); bar.setMessage("Downl