PhizClip Android DEMO
๐ https://www.phizclip.com/ ๐
[Home Page](https://www.finclip.com/) | [Example Mini-App](https://www.finclip.com/#/market) | [Documentation](https://www.finclip.com/mop/document/) | [Deployment Guide](https://www.finclip.com/mop/document/introduce/quickStart/cloud-server-deployment-guide.html) [SDK Integration Guide](https://www.finclip.com/mop/document/introduce/quickStart/intergration-guide.html) | [API List](https://www.finclip.com/mop/document/develop/api/overview.html) | [Component List](https://www.finclip.com/mop/document/develop/component/overview.html) | [Privacy Commitment](https://www.finclip.com/mop/document/operate/safety.html)
-----
## ๐ค What is PhizClip?
Have you ever **thought** that the developed WeChat Mini-App can be put in your own APP to run directly, and you only need to develop the Mini-App once, and then you can open it in different applications, isn't it incredible?
Have you ever **tried** to introduce an SDK in your own APP, and you can not only open the Mini-App in the app, but also customize the Mini-App interface and modify the Mini-App style, don't you think it is more incredible?
**This is PhizClip, with much INCREDIBLE !**
## โ๏ธ Steps
### The first step is to configure the build.gradle file
Add the address of the maven warehouse in the project's `build.gradle`:
```bash
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.5.2"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.60"
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
maven {
url "https://gradle.finogeeks.club/repository/applet/"
credentials {
username "applet"
password "123321"
}
}
}
}
```
### Step 2 Depend on SDK in gradle
`implementation 'com.finogeeks.lib:finapplet:+'`
### Step 3 Configure obfuscation rules
After integrating the SDK, in order to avoid obfuscation of some codes in the SDK that cannot be obfuscated, the following configuration needs to be added to the obfuscation rule configuration file of the project:
``-keep class com.finogeeks.** {*;}``
### Step 4 SDK initialization
We strongly recommend initializing the SDK in `Application`. The parameters that need to be passed in to initialize the SDK are as follows:
```java
FinAppConfig config = new FinAppConfig.Builder()
.setAppKey("SDKKEY")
.setAppSecret("SECRET")
.setApiUrl("https://api.finclip.com")
.setApiPrefix("/api/v1/mop/")
.setGlideWithJWT(false)
.build();
FinCallback callback = new FinCallback() {
@Override
public void onSuccess(Object result) {
// SDK initialization successful
}
@Override
public void onError(int code, String error) {
// SDK initialization failed
Toast.makeText(AppletApplication.this, "SDK initialization failed", Toast.LENGTH_SHORT).show();
}
@Override
public void onProgress(int status, String error) {
}
};
FinAppClient.INSTANCE.init(this, config, callback);
```
The SDK is implemented using a multi-process mechanism. Each applet runs in an independent process, that is, one applet corresponds to one process. When initializing the SDK, special attention should be paid to the following: **When the mini program process is created, there is no need to perform any initialization operations. Even the initialization of the mini program SDK does not need to be performed in the mini program process.**
> Give an example๐ฐ
The application uses some third-party libraries. These libraries need to be initialized when the application starts. When initializing in Application, these third-party libraries only need to be initialized when the current process is the host process. Mini program processes do not need to initialize these libraries. of.
Therefore, before initializing the SDK, you must determine which process the current process is. If it is a small program process, no operations will be performed:
```java
if (FinAppClient.INSTANCE.isFinAppProcess(this)) {
return;
}
```
### Step 5: Open the mini program
```java
FinAppClient.INSTANCE.getAppletApiManager().startApplet(this, "appid");
```
- **SDK KEY** and **SDK SECRET** can be obtained from [PhizClip](https://finclip.com/#/home), click [here](https://finclip.com/#/register ) Register an account;
- After entering the platform, add your own package name on the "Application Management" page and click "Copy" to get the key\secret\apisever field;
- **apiServer** and **apiPrefix** are fixed fields, please refer to this DEMO directly;
- **Mini Program ID** is the Mini Program APP ID listed in the management background. It needs to be created in "Mini Program Management" and associated in "Application Management";
> The Mini Program ID is different from the WeChat Mini Program ID! (This refers specifically to the ID of the PhizClip platform)
## ๐ Integrated documentation
[Click here](https://www.finclip.com/mop/document/introduce/quickStart/intergration-guide.html#_2-android-%E5%BF%AB%E9%80%9F%E9%9B%86%E6%88%90) View the Android Quick Integration documentation
## ๐ Directory Structure
```
.
โโ.github
โ
โโ.idea Automatically generated by the IDE, no need to pay attention
โ
โโapp Project source code main directory
โ โ
โ โ build.gradle Apply build configuration
โ โ
โ โ proguard-rules.pro Obfuscated configuration
โ โ
โ โโrelease Build the apk directory generated by the application
โ โ
โ โโsrc
โ โโandroidTest Unit test directory, automatically generated by the IDE, no need to pay attention
โ โ
โ โโmain Application source code main directory
โ โ โ AndroidManifest.xml application manifest file
โ โ โ
โ โ โโjava Application source code directory
โ โ โ
โ โ โโres Resource file directory
โ โ โโdrawable darwable resource directory
โ โ โ
โ โ โโdrawable-v24 darwable resource directory
โ โ โ
โ โ โโlayout Layout file directory
โ โ โ
โ โ โโmipmap-anydpi-v26 Picture resource directory
โ โ โ
โ โ โโmipmap-hdpi Picture resource directory
โ โ โ
โ โ โโmipmap-mdpi Picture resource directory
โ โ โ
โ โ โโmipmap-xhdpi Picture resource directory
โ โ โ
โ โ โโmipmap-xxhdpi Picture resource directory
โ โ โ
โ โ โโmipmap-xxxhdpi Picture resource directory
โ โ โ
โ โ โโvalues Configuration directory of various resource values
โ โ
โ โโtest Unit test directory, automatically generated by the IDE, no need to pay attention
โ
โโgradle Gradle version configuration directory, generally no need to pay attention to it
```
## ๐ Links
The following is information on common questions and guidelines for your development and experience with PhizClip
- [Home Page](https://www.finclip.com/#/home)
- [Example Mini-App](https://www.finclip.com/#/market)
- [Documentation](https://www.finclip.com/mop/document/)
- [SDK Integration Guide](https://www.finclip.com/mop/document/introduce/quickStart/intergration-guide.html)
- [Structure of PhizClip](https://www.finclip.com/mop/document/develop/guide/structure.html)
- [Integration Guidelines(iOS)](https://www.finclip.com/mop/document/runtime-sdk/ios/ios-integrate.html)
- [Integration Guidelines(Android)](https://www.finclip.com/mop/document/runtime-sdk/android/android-integrate.html)
- [Integration Guidelines(Flutter)](https://www.finclip.com/mop/document/runtime-sdk/flutter/flutter-integrate.html)
## โ๏ธ Contact
Scan the QR code below with WeChat and follow the official public number **Finogeeks** for more exciting content.
Scan the QR code below with WeChat and invite into the official WeChat exchange group (add friend note: **finclip consulting**) to get more exciting content.
## Stargazers
[![Stargazers repo roster for @finogeeks/finclip-android-demo](https://reporoster.com/stars/finogeeks/finclip-android-demo)](https://github.com/finogeeks/finclip-android-demo/stargazers)
## Forkers
[![Forkers repo roster for @finogeeks/finclip-android-demo](https://reporoster.com/forks/finogeeks/finclip-android-demo)](https://github.com/finogeeks/finclip-android-demo/network/members)
## ๐ Languages
- [็ฎไฝไธญๆ](./README.md)
- [English](./readme_en.md)
- [Portuguรชs](./readme_pt.md)