Android

Requirement

Make sure the following configuration is completed:

  • JDK >= 1.7 , and configure the environment variable
  • Android SDK installed and configure the environment variable
  • Android SDK version 23 (compileSdkVersion in build.gradle)
  • SDK build tools version 21.1.2 (buildToolsVersion in build.gradle)
  • Android Support Repository >= 17 (for Android Support Library)
  • Weex SDK >= 0.16.X

Steps

The steps are as follows:

  1. Create an Android project. There is nothing to be specified, according to your habits to.
  2. At this moment, our publication is being reviewed by Maven. Once published, source dependency will be changed to AAR dependency. Download source code, update build.gradle by adding the following dependencies:
    compile project ':bridges:weex-bridge:android:weex_bridge'
    
  3. Register GCanvas Module and Component to your Weex Application.
    WXSDKEngine.registerModule("gcanvas", GCanvasWeexModule.class);
    WXSDKEngine.registerComponent("gcanvas", WXGCanvasWeexComponent.class);
    
  4. Modify AndroidManifest.xml, add below line to acquire OpenGL ES features.
    <uses-feature android:glEsVersion="0x00020000" />
    

iOS

Requirement

Steps

  1. Install components with CocoaPods
    pod 'WeexGcanvas'
    pod 'WeexPluginLoader'
    

WeexPluginLoader would dynamic register Weex Module and Component of GCanvas, so we do not need to register manually.