Java SDK
Learn how to integrate Safepay into your Java Android App
A set of components allowing easy integration of Safepay Button and Safepay Checkout into your website, powered by zoid
1. Add WebView to your layout XML file
Open the XML layout file (activity_main.xml or any other layout file) and add a WebView element.
2. Load URL in WebView
In your Java code, you can load a URL into the WebView by finding the WebView instance and calling the loadUrl method.
3. Create a WebViewClient
If you want to detect changes in the URL history of a WebView, you can use the doUpdateVisitedHistory method in combination with the WebHistoryItem class. Create a WebViewClient and override the doUpdateVisitedHistory method
4. Use the WebHistoryItem
Use the WebHistoryItem class to access the URL history items. Check if the url contains /external/mobile
Feedback
What do you think of our integration document? Let us know here support@getsafepay.com
Preview
<WebViewandroid:id="@+id/webview"android:layout_width="match_parent"android:layout_height="match_parent"/>