How to use the MUI framework in Android native app

Source: Internet
Author: User

First from the official website http://www.dcloud.io/download Hbuilder, with the software to create a HTML5 mobile app project, specifically to the official website to view the corresponding documents.

The next step is to introduce the written hbuilder into our Android project.

First to http://ask.dcloud.net.cn/article/103 download Hbuilder Offline pack Android version sdk,sdk there's a hbuilder-integrate project we'll use, and then we'll start ~~~~~

Create a new project (Myfirstmui) with Android studio first.

1 , import jar package, can choose from the Hbuilder-integrate Project Libs, specifically to import which jar package can be viewed from the Feature-android.xls in the SDK.

2. Add App Resources:

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/77/D9/wKioL1ZvtELyfM-VAAAxEtCfurI070.png "style=" float: Left; "title=" QQ picture 20151215143258.png "alt=" Wkiol1zvtelyfm-vaaaxetcfuri070.png "/>

① Create the Assets folder under the project directory and add the apps directory under the assets directory

② Create an App ID directory with the same name in the Apps directory

③ Creating the WWW directory under the same name as the app ID

④ Copy the app resource and application configuration file (Manifest.json) to the WWW directory


Where the "h5b1ea68d" directory name is the ID name in the app Manifest.json, be sure to agree.









Add control.xml files and properties.xml files to the Assets->data directory

650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M00/77/D9/wKioL1Zvt2iSYvWSAAA3cBScjBo255.png "style=" float: Left; "title=" QQ picture 20151215144357.png "alt=" Wkiol1zvt2isyvwsaaa3cbscjbo255.png "/>



Where the AppID value of the Control.xml file is the AppID of the Hbuilder app, 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 to the application resource must be maintained with version in Manifest.json The name value is exactly the same; the version value is the application base version number (the value returned by Plus.runtime.innerVersion), and do not modify it arbitrarily.


The properites file is used to correspond to the JS class name and the Android package name, and the user can add or hack the file according to the plugin used by the development project.



These two files can be copied from the Hbuilder-integrate Project for modification.






3 . Copy the required resource files into the drawable and layout folder:

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/DA/wKioL1ZvvyLBz7BnAAAxff-ydck090.png "title=" QQ picture 20151215151918.png "alt=" Wkiol1zvvylbz7bnaaaxff-ydck090.png "/>

4. Modify the Androidmanifest.xml file

The Versioncode in the file is consistent with the version-and-code values in Manifest.json, and Versionname is identical to the name value in Manifest.json. Add the function permissions according to the Androidmanifest.xml file in the Hbuilder-integrate project.

5. Add Code compilation Test

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/77/DB/wKiom1ZvvVnDg3nYAAAzI-bPSMI728.png "title=" QQ picture 20151215151205.png "alt=" wkiom1zvvvndg3nyaaazi-bpsmi728.png "/> Note rinfomation to be copied into the project along with its directory.

See document HTTP://ASK.DCLOUD.NET.CN/ARTICLE/81

By the end of this, I have attached myself to the example I wrote that you can download for reference, which is written in Android studio, in the same vein as Eclipse.


---------------------here is the split line-----------------------


In addition, if you want to introduce multiple Hbuilder-written app modules into an Android project, copy the resources to the assets directory, and then configure multiple apps in the Control.xml file to refer to multiple modules.

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/77/DA/wKioL1ZvwdTSmg4fAAAjXoFdTmk164.png "title=" QQ picture 20151215153104.png "alt=" Wkiol1zvwdtsmg4faaajxofdtmk164.png "/>

This article is from "Snail Journey" blog, please be sure to keep this source http://8432499.blog.51cto.com/8422499/1723227

How to use the MUI framework in Android native app

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.