FinClip Android DEMO
This project provides DEMO samples for running small programs in the Android environment
https://www.finclip.com/ ?
Official website | Sample applet | Development documentation | Deployment guide | SDK integration guide | API list | Component list | Privacy commitment
Have you ever thought that the developed WeChat applet can be run directly in your own APP? You only need to develop the applet once and open it in different applications. Isn't it incredible?
Have you ever tried introducing an SDK into your own APP? In the application, you can not only open the mini program, but also customize the mini program interface and modify the mini program style. Doesn’t it feel even more incredible?
This is FinClip, there are so many incredible things!
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 "
}
}
}
}
implementation 'com.finogeeks.lib:finapplet:+'
After integrating the SDK, in order to prevent some codes in the SDK that cannot be obfuscated from being obfuscated, you need to add the following configuration to the obfuscation rule configuration file of the project:
-keep class com.finogeeks.** {*;}
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初始化成功
}
@ Override
public void onError ( int code , String error ) {
// SDK初始化失败
Toast . makeText ( AppletApplication . this , "SDK初始化失败" , 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 fact that 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 ;
}
FinAppClient . INSTANCE . getAppletApiManager (). startApplet ( this , "appid" );
The Mini Program ID is different from the WeChat Mini Program ID! (This refers specifically to the ID of the FinClip platform)
Click here to view Android Quick Integration Documentation
.
├─.github
│
├─.idea 由IDE自动生成,无需关注
│
├─app 项目源码主目录
│ │
│ │ build.gradle 应用构建配置
│ │
│ │ proguard-rules.pro 混淆配置
│ │
│ ├─release 构建应用生成的apk目录
│ │
│ └─src
│ ├─androidTest 单元测试目录,由IDE自动生成,无需关注
│ │
│ ├─main 应用源码主目录
│ │ │ AndroidManifest.xml 应用清单文件
│ │ │
│ │ ├─java 应用源码目录
│ │ │
│ │ └─res 资源文件目录
│ │ ├─drawable darwable资源目录
│ │ │
│ │ ├─drawable-v24 darwable资源目录
│ │ │
│ │ ├─layout 布局文件目录
│ │ │
│ │ ├─mipmap-anydpi-v26 图片资源目录
│ │ │
│ │ ├─mipmap-hdpi 图片资源目录
│ │ │
│ │ ├─mipmap-mdpi 图片资源目录
│ │ │
│ │ ├─mipmap-xhdpi 图片资源目录
│ │ │
│ │ ├─mipmap-xxhdpi 图片资源目录
│ │ │
│ │ ├─mipmap-xxxhdpi 图片资源目录
│ │ │
│ │ └─values 各项资源值配置目录
│ │
│ └─test 单元测试目录,由IDE自动生成,无需关注
│
└─gradle gradle版本配置目录,一般情况下无需关注
The following content is frequently asked questions and guidance information when you develop and experience FinClip.
Scan the QR code below on WeChat and follow the official public account "Fantay Geek" to get more exciting content.
Scan the QR code below on WeChat to join the official WeChat communication group to get more exciting content.