Android
Mobile integrations are quite similar to Web's, it should use WebView instead of the iframe element. You can almost use all the functions that is mentioned in the Web section. Main difference of the integration is that you need to tell the app explicitly to allow taking photo or using gallery to choose a photo. There might be slight differences by the Android API version your app is using, but the core concept is the same.
Note: Do not create different WebViews for Makeup and Nailpolish solutions. They should be using the same WebView.
#
1. Importing WebViewTo add a WebView to your app in the layout, add the following code to your activity's layout XML file:
#
2. StructureOn Android, you need to add some additional configurations. First create a file_paths.xml folder inside your app/src/main/res/xml then Add the following codes
Secondly add the following code inside the
After configuration is done. We can start creating our WebView. Initialize WebView instance by id and set configuration to allow the customization for JavaScript.
- Kotlin
- Java
After this step we can see our WebView with with Choose Model and Take a Photo options. Choose Model should be working but Take a photo is not. We will use onShowFileChooser function for open camera createImageFile for generate image path and onActivityResult function will be executed after image selected
- Kotlin
- Java
#
3. Communication with the Plugin/Remote ControlThe function calls to manipulate/customize the Plugin is the same that of Web version. There is only slight tweaks in invoking them due to the platform differences as you can can see the below.
Please remember that you can call the functions only after the initial load of WebView, just like the way it was in Web.
note
If you are already using our Template Engine on Landing Page Integration, you might not need them at all. They are only needed to control the Plugin remotely.
- Kotlin
- Java
#
4. Extra featuresHow to start the Plugin by specific product applied?
You need to have related product details registered in for your product by our digitalization team.
- Set by product code
- Set by special product id
#
Demo applicationsYou can request to see the basic demo applications that work on Android, as well.