Only specific analysis of the latest version of AppCan, important or specific issues
I have a few key points to solve the problem
- Look decompile package
- See Android running up the log, log analysis
- See source code appcan-android to see appcan js source code
- Narrow the scope of the problem
1. decompile AppCan official to give you a bag
- Access to resources file after decompiling
- assets in the catalog:
-
error and widget catalog and info.xml AppCan this folder is generated for you, these resources intact copy to you AS project. Empty widget folder (Make sure widget files in a folder no distortion)
-
Remember lib folder under the .so files, which are to be put in your Android Studio projects, eg:
3. Import plug-in you use on AppCan, need to build gradle jar package or by importing:
PS: When adding .jar package folder there
AndroidManifest.xml
andplugin.xml
,AndroidManifest.xml
in the code is added to the projectAndroidManifest.xml
file.plugin.xml
Add tores/xml/plugin.xml
, the file does not exist create it. Missing jar package to find ways to download,
2. copy the code to the next AS assets \ widget directory
3. Several pit
//设置侧滑
appcan.window.setSlidingWindow({
rightSliding : {
width : 240,
url : "uexWindow_right.html"
},
animationId : '1', //仿QQ侧滑
bg : '' //仿QQ侧滑;注:res目录为js文件夹同级目录wgtRes
});
When running this code will crash, error Resources not found, because AppCan packed their own time to add some resource files to our .apk file, and then reference the runtime. Our new AS there are no resources to this file, so an error
(function($) {
alert("ready end!");
appcan.ready(function(){
alert("ready ready!");
}
window.uexOnload = function(){
alert("ready ready!");
}
})($);
among them
appcan.ready(function(){
alert("ready ready!");
}
Do not run, the reason is not clear, but the code is replaced
window.uexOnload = function(){
alert("ready ready!");
}
On it
Reference links
- http://bbs.appcan.cn/forum.php?mod=viewthread&tid=26149
- https://www.cnblogs.com/lovelgx/articles/7698836.html
- http://newdocx.appcan.cn/app-engine/uexWindow
- http://plugin.appcan.cn/
- http://newdocx.appcan.cn/JSSDK/Window
- https://github.com/AppCanOpenSource/appcan-android/tree/568fd35621550f23ebb4b1b6507222cce1d743bf