Add Privacy Policy page to your Android application

If you received an email from Google that says: if you don’t add Privacy Policy to your app it will be removed from the play store, this tutorial shows how to add Privacy Policy to your App so it will not get removed.

  1. Display privacy policy inside your app.
  2. Display the privacy policy on your developer website.
  1. Create a standard “privacy policy” page in this website, it will generate an HTML, download HTML, upload HTML to Dropbox and add your link to Play console.(watch youtube video).
  2. Add the downloaded HTML file to your Android project assets folder.<currently I just load the HTML in an activity, FUTURE: maybe add the dropbox link to activity and just open webview to your dropbox URL www.MyDROPboxlink/../….com

3. Create new activity PrivacyPolicyActivity()

public class PrivacyPolicyActivity extends Activity {
WebView web;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_privacy_policyctivity);

web =(WebView)findViewById(R.id.webView);
web.loadUrl("file:///android_asset/privacy_policy.html");

}

}

4. Layout activity_privacy_policyctivity.xml below:

<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".PrivacyPolicyActivity">

<WebView
android:id="@+id/webView"
android:layout_width="368dp"
android:layout_height="503dp"
tools:layout_editor_absoluteX="8dp"
tools:layout_editor_absoluteY="8dp"
tools:ignore="MissingConstraints" />
</androidx.constraintlayout.widget.ConstraintLayout>

5. Add button to your activity

Button privacyPolicyButton = (Button) this.findViewById(R.id.privacyPolicyButton);
privacyPolicyButton.setTextSize(18);
privacyPolicyButton.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
// TODO Auto-generated method stub
Intent intent = new Intent(getApplicationContext(),
PrivacyPolicyActivity.class);
startActivity(intent);
}
});

Run.

Resubmit your app to the Play Store.

A. Upload generated HTML to dropbox, get link and added to your Play Store app description “developer website”.

One of my Apps was removed because it didn’t had a privacy policy. I did the two steps from the tutorial and my app is Published again.

software engineer, read, swim, travel. apps: https://goo.gl/rDuuQw https://goo.gl/15GvfE

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store