当前位置:网站首页>Uniapp plug-in development
Uniapp plug-in development
2022-06-11 08:13:00 【bright and dazzling】
Detailed view
https://nativesupport.dcloud.net.cn/NativePlugin/course/android
1、 Create a new one library
2、 Configure just created Module Of build.gradle Information .
repositories {
flatDir {
dirs 'libs'
}
}
dependencies {
compileOnly fileTree(dir: 'libs', include: ['*.jar'])
compileOnly fileTree(dir: '../app/libs', include: ['uniapp-v8-release.aar'])
compileOnly 'androidx.recyclerview:recyclerview:1.0.0'
compileOnly 'androidx.legacy:legacy-support-v4:1.0.0'
compileOnly 'androidx.appcompat:appcompat:1.0.0'
implementation 'com.alibaba:fastjson:1.1.46.android'
implementation 'com.facebook.fresco:fresco:1.13.0'
}
3、 establish TestModule class
package com.mingshine.utils;
import com.alibaba.fastjson.JSONObject;
import io.dcloud.feature.uniapp.annotation.UniJSMethod;
import io.dcloud.feature.uniapp.common.UniModule;
public class CommonUtils extends UniModule {
//run JS thread
@UniJSMethod(uiThread = false)
public JSONObject testSyncFunc() {
JSONObject data = new JSONObject();
data.put("code", "success");
return data;
}
}
4、 Generate uni-app plug-in unit 
|-- DCloud-RichAlert —> plug-in unit id Named folder
|-- android —> Android plug in directory 


package.json
{
"name": "utils",
"id": "ComMingshineUtils",
"version": "1.0.0",
"description": " Tools ",
"_dp_type":"nativeplugin",
"_dp_nativeplugin":{
"android": {
"plugins": [
{
"type": "module",
"name": "ComMingshineUtils-CommonUtils",
"class": "com.mingshine.utils.CommonUtils"
}
],
"integrateType": "aar"
}
}
}
边栏推荐
- JSP development model
- Getting started with bladed tutorial (video)
- Typescript recognizable Union
- TypeScript-声明合并
- A detailed explanation of one of the causes of dead loop caused by array out of bounds in C language
- Jupyter notebook code completion plug-in + Solution
- DAMENG 数据库登陆
- TypeScript-键盘映射
- (taking pytorch as an example) a simple understanding of the regularization method of path (depth) -drop path
- 【 史上最全的ENSP【安装图解】!】
猜你喜欢

Use of Excel to XML tool of TestLink

Using Tkinter to realize guessing numbers game

2022.6.7 special student simulation

Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)

2022.6.7 特长生模拟

How CSDN reports plagiarized articles

Detailed explanation of shift operator and bit operator in C language

如何做好空状态设计?来看这份全面总结

Summary of evaluation index knowledge points in target detection: summary of IOU cross overlap unit and map/ap/tp/fp/np

进程控制:进程等待(回收子进程)
随机推荐
Collation of basic knowledge of intermediate development of Andrews (for interview)
项目实训-克隆门
Return in foreach and break in for
TypeScript-命名空间
避免list的并发修改异常的几种方式
Shell Programming Notes
Typescript type protection
(resolved) the tqdm progress bar in the Jupiter notebook does not update and display in one line, but scrolls down to output
TypeScript-头文件使用细节
Semiconductor memory classification
2022.6.6 extra long growth simulation
node报错整理
TypeScript-键盘映射
Understanding of Poisson distribution and Poisson process and Erlang distribution and their relations (important theories in queuing theory and operational research)
(resolved) pychart debug error -unicode decodeerror: 'UTF-8' codec can't decode byte 0xe8 in position 1023
Use special characters to splice strings "+“
如何做好空状态设计?来看这份全面总结
TypeScript-类和接口、类和泛型、接口合并现象
TypeScript-类型保护
JS learning basics document Write write a line of text in the page