Tip：The following documents assume that you already have a certain Android development experience.
1.using source code: Can quickly use the latest features of WEEX, according to your own characteristics of the project. So, you can do some related improvements.
2.using SDK: WEEX will regularly release a stable version at jcenter.jcenter
Make sure the following configuration is complete:
- JDK version >= 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 23.0.1 (buildToolsVersion in build.gradle)
- Android Support Repository >= 17 (for Android Support Library)
If you are the first time to try or have a higher demand for stability, you can use the way to dependence on the SDK.
The steps are as follows:
- Create an Android project. There is nothing to be specified, according to your habits to.
- Update build.gradle by adding the following dependencies:
Note: the version can be high can not be low.
Note: There is a complete code address in the appendix
- Implement the picture download interface, set the initialization.
- Start rendering
1.Download source code. git clone https://github.com/alibaba/weex.
2.Create an android project.
3.Import the SDK Module through the following path:
File->New-Import Module-> chose WEEX SDK Module(weex/android/sdk) -> Finish
4.Add the following dependencies: compile project (‘: weex_sdk’) to build.gradle file.
5.Other settings please refer to the above “Quick to use”.
Appendix: WXSample address
Import Weex iOS SDK to your existing project, if not, you can create a new project.
Before proceeding, make sure that the Podfile file is under the project file. If not, create one and open with text editor.
- Integration framework
WeexSDK The latest version on cocoaPods can be obtained here .
Add the following to the Podfile file:
- Integrate with source code
First copy the ios / sdk directory to your existing project directory (here to copy the root directory of your existing project as an example), and then add the Podfile file.
Open the command line, switch to the directory of the Podfile file, and run the pod install command. If there are no errors, it means that the environment has been configured.
In the AppDelegate.m file to do the initialization operation, usually in the didFinishLaunchingWithOptions method as follows to add.
Weex supports both full page rendering and partial rendering. What you need to do is render Weex’s view with the specified URL and add it to its parent container. The parent container is generally a viewController.
WXSDKInstance is a very important class that provides a basic method and some callbacks, such as renderWithURL, onCreate, onFailed, etc., can be found in WXSDKInstance.h.
In the dealloc phase of the viewController destroyed Weex instance, can play a role in avoiding memory leaks.
The Weex SDK can be compiled from the source code. You can try the latest feature in the new feature or bugfix branch.
Refer to here for direct import of weexSDK.