1. Download 5+SKD
http://ask.dcloud.net.cn/article/103
2. Unzip to any directory
3. Import Hbuilder-hello Project
4. Specify the app identity in Androidmanifest.xml
Package= "com.xxx" app ID, reverse domain name format
Android:versioncode= "10101" app version number
Android:versionname= "1.1.1" app version name
5. Configure the app name in String.xml
6. Configure the app icon and launch screen
7. Update Application Resources
Change the HelloH5 folder name to the name you want, and the demo changes to Pbsmui:
Right-click Apps–directory Path
Delete content inside www folder, keep www empty folder, copy the MUI resources into this folder with Hbuilder
8. Modify the parent directory name of the WWW file or name value and ID value in Manifest.json to keep the three consistent
9. Modify Manifest.json
Modify the version information in Manifest.json consistent with the version information in Androidmanifest.xml
10. Configure Application Information
Open the Control.xml file under App->src->main->assets, modify the values for AppID and AppVer:
Where the AppID value is the AppID of the Hbuilder application, it must be exactly the same as the ID value in the app Manifest.json; AppVer is the version number of the app, and the upgrade for the app resource must be maintained with version in Manifest.json The name value is exactly the same; the version value is the applied base version number (the value returned by Plus.runtime.innerVersion), and do not modify it arbitrarily.
11. Call Javaapi
11.1 Create a Java class file testactivity, add a static method, a simple test method, return the string "1":
11.2 Calling the Java API in Mui.js
<script src= "Js/mui.min.js" ></script>
<script src= "Js/jquery.min.js" ></script>
<script type= "Text/javascript" >
Mui.init ()
$ (function () {
Mui.plusready (function () {
Calling the Java method
$ (". Login_btn"). Click (function () {
Introducing Java class files
var ac = Plus.android.importClass ("com.xxx.xxx.TestActivity");
Calling a static method
var data = Ac.getdata ();
Output return value
alert (data);
})
})
})
</script>
12. Configuration to complete the compilation run
After the app is configured, press shift F10 to run the app and select the device you want to run in the list of devices that pops up dialog box:
finish the call.
Androidstudio Offline Pack MUI