dev android,and complete load context

This commit is contained in:
pengfei.zhou
2019-07-18 16:29:24 +08:00
parent f2fc57bbc7
commit 2a34d7b638
21 changed files with 425 additions and 43 deletions

View File

@@ -3,6 +3,7 @@
package="com.github.pengfeizhou.hegodemo">
<application
android:name=".MyApplication"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"

View File

@@ -3,7 +3,8 @@ package com.github.pengfeizhou.hegodemo;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import com.github.pengfeizhou.hegodemo.R;
import com.github.pengfeizhou.hego.HegoContext;
import com.github.pengfeizhou.hego.HegoUtils;
public class MainActivity extends AppCompatActivity {
@@ -11,5 +12,7 @@ public class MainActivity extends AppCompatActivity {
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
HegoContext hegoContext = HegoContext.createContext(HegoUtils.readAssetFile("test.js"), "demo");
hegoContext.callJS("");
}
}

View File

@@ -2,10 +2,17 @@ package com.github.pengfeizhou.hegodemo;
import android.app.Application;
import com.github.pengfeizhou.hego.Hego;
/**
* @Description: Android
* @Author: pengfei.zhou
* @CreateDate: 2019-07-18
*/
public class MyApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Hego.init(this);
}
}