Skip to content

Commit

Permalink
Merge pull request #17 from vivekpanchal/Fix_networkError
Browse files Browse the repository at this point in the history
Fixed the Network Issue due to the CLEARTEXT error
  • Loading branch information
evrencoskun authored Jan 10, 2020
2 parents f19476a + 035a78a commit 00cbac4
Show file tree
Hide file tree
Showing 4 changed files with 125 additions and 1 deletion.
116 changes: 116 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:usesCleartextTraffic="true"
android:networkSecurityConfig="@xml/network_config"
android:theme="@style/AppTheme">
<activity
android:name=".ui.MainActivity">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
public class NetworkUtils {

private static final String LOG_TAG = NetworkUtils.class.getSimpleName();
private static final String BASE_URL = "http://vuetable.ratiw.net/api/";
private static final String BASE_URL = "https://vuetable.ratiw.net/api/";

private static Retrofit getRetrofit() {
return new Retrofit.Builder().baseUrl(BASE_URL).addConverterFactory(GsonConverterFactory
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/xml/network_config.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<network-security-config>
<domain-config cleartextTrafficPermitted="true">
<domain includeSubdomains="true">localhost</domain>
</domain-config>
</network-security-config>

0 comments on commit 00cbac4

Please sign in to comment.