1
0
Fork 0
小程序引擎 PhizClip 安卓运行环境,让小程序在安卓应用中无缝运行 / Android DEMO for PhizClip
 
 
Go to file
sannilake 4686469eec 英文版readme翻译 2023-11-09 15:29:32 +08:00
.github/workflows Create issue.yml 2022-02-08 14:37:53 +08:00
.idea update finapplet version 2023-02-03 11:53:54 +08:00
app update finapplet version 2023-02-03 11:53:54 +08:00
gradle/wrapper initial commit 2020-03-07 20:26:34 +08:00
.gitignore initial commit 2020-03-07 20:26:34 +08:00
README.md 英文版readme翻译 2023-11-09 15:29:32 +08:00
build.gradle Update 2020-12-04 14:06:09 +08:00
demo_readme2.png Add files via upload 2021-02-05 15:54:40 +08:00
finclip.jks 签名打包 2020-12-16 11:21:10 +08:00
gradle.properties initial commit 2020-03-07 20:26:34 +08:00
gradlew initial commit 2020-03-07 20:26:34 +08:00
gradlew.bat initial commit 2020-03-07 20:26:34 +08:00
phizlogo.png 英文版readme翻译 2023-11-09 15:29:32 +08:00
readme_en.md 英文版readme翻译 2023-11-09 15:29:32 +08:00
settings.gradle initial commit 2020-03-07 20:26:34 +08:00
yippi.jpeg Add files via upload 2021-02-05 15:54:40 +08:00

readme_en.md

PhizClip Android DEMO

👉 https://www.phizclip.com/ 👈


🤔 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:

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:

FinAppConfig config = new FinAppConfig.Builder()
        .setAppKey("SDKKEY")
	      .setAppSecret("SECRET")
        .setApiUrl("https://api.finclip.com")
        .setApiPrefix("/api/v1/mop/")
        .setGlideWithJWT(false)
        .build();
FinCallback<Object> callback = new FinCallback<Object>() {
    @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:

if (FinAppClient.INSTANCE.isFinAppProcess(this)) {
    return;
}

Step 5: Open the mini program

FinAppClient.INSTANCE.getAppletApiManager().startApplet(this, "appid");
  • SDK KEY and SDK SECRET can be obtained from PhizClip, click here 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 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

The following is information on common questions and guidelines for your development and experience with PhizClip

☎️ 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

Forkers

Forkers repo roster for @finogeeks/finclip-android-demo

🌏 Languages