Browse Source

1、android 测试代码更新

tags/0.0.1
PH2 4 years ago
parent
commit
9b32ac2b43
1 changed files with 46 additions and 1 deletions
  1. +46
    -1
      example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java

+ 46
- 1
example/android/app/src/main/java/cn/zhios/zhiying_base_widget_example/MainActivity.java View File

@@ -1,13 +1,58 @@
package cn.zhios.zhiying_base_widget_example; package cn.zhios.zhiying_base_widget_example;


import cn.zhios.zhiying_comm.ZhiyingCommPlugin;
import cn.zhios.zhiying_comm.ZhiyingFlutterCommHandler;
import cn.zhios.zhiying_comm.ZhiyingFlutterCommNativable;
import cn.zhios.zhiying_comm.ZhiyingFlutterCommNative;
import cn.zhios.zhiying_comm.ZhiyingFlutterCommNativeResult;

import java.util.HashMap;
import java.util.Map;

import androidx.annotation.NonNull; import androidx.annotation.NonNull;

import io.flutter.embedding.android.FlutterActivity; import io.flutter.embedding.android.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine; import io.flutter.embedding.engine.FlutterEngine;
import io.flutter.plugins.GeneratedPluginRegistrant; import io.flutter.plugins.GeneratedPluginRegistrant;


public class MainActivity extends FlutterActivity {
public class MainActivity extends FlutterActivity implements ZhiyingFlutterCommNativable {
@Override @Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) {
GeneratedPluginRegistrant.registerWith(flutterEngine); GeneratedPluginRegistrant.registerWith(flutterEngine);
ZhiyingFlutterCommNative.getInstance().regist(this);
}


boolean localDebug = false;

@Override
public void openPage(Map params) {

}

@Override
public void openNativePage(Map params) {

}

@Override
public Map getSetting() {
Map map = new HashMap();
map.put("domain", "http://192.168.0.113:5000"); //"http://120.76.175.204:8989");
map.put("master_id", "123456");
map.put("secret_key", "123456");
map.put("token", "123465");
return map;
}

@Override
public void invokeMethod(String method, Map<String, Object> params, ZhiyingFlutterCommHandler handler) {
return;
}

@Override
protected void onDestroy() {
super.onDestroy();
ZhiyingFlutterCommNative.getInstance().unregist();
} }
} }

Loading…
Cancel
Save