Android原生工程配置 官网配网地址:
https://nativesupport.dcloud.net.cn/AppDocs/usesdk/android

  1. App离线SDK下载 我这边给大家放在资料里面了

  2. 新建Android项目Hello-H5

    注意:Android项目目录不要有中文

  3. 拷贝android-gif-drawable-release@1.2.17.aar、lib.5plus.base-release.aar、miit_mdid_1.0.10.aar、uniapp-release.aar到libs下

  4. 在build.gradle中添加资源引用

implementation fileTree(dir: 'libs', include: ['*.aar', '*.jar'], exclude: [])implementation "com.android.support:support-v4:28.0.0"implementation "com.android.support:appcompat-v7:28.0.0"implementation 'com.android.support:recyclerview-v7:28.0.0'implementation 'com.facebook.fresco:fresco:1.13.0'implementation "com.facebook.fresco:animated-gif:1.13.0"implementation 'com.github.bumptech.glide:glide:4.9.0'implementation 'com.alibaba:fastjson:1.1.46.android'


5.uni-app配置时需要在build.gradle中添加aaptOptions配置

aaptOptions {    additionalParameters '--auto-add-overlay'    ignoreAssetsPattern "!.svn:!.git:.*:!CVS:!thumbs.db:!picasa.ini:!*.scc:*~"  }


6. 在Androidmanifest.xml配置应用启动页

 <activity      android:name="io.dcloud.PandoraEntry"      android:configChanges="orientation|keyboardHidden|keyboard|navigation"      android:label="@string/app_name"      android:launchMode="singleTask"      android:hardwareAccelerated="true"      android:theme="@style/TranslucentTheme"      android:screenOrientation="user"      android:windowSoftInputMode="adjustResize" >      <intent-filter>          <action android:name="android.intent.action.MAIN" />          <category android:name="android.intent.category.LAUNCHER" />      </intent-filter>  </activity>  <activity      android:name="io.dcloud.PandoraEntryActivity"      android:launchMode="singleTask"      android:configChanges="orientation|keyboardHidden|screenSize|mcc|mnc|fontScale|keyboard"      android:hardwareAccelerated="true"      android:permission="com.miui.securitycenter.permission.AppPermissionsEditor"      android:screenOrientation="user"      android:theme="@style/DCloudTheme"      android:windowSoftInputMode="adjustResize">      <intent-filter>          <category android:name="android.intent.category.DEFAULT" />          <category android:name="android.intent.category.BROWSABLE" />          <action android:name="android.intent.action.VIEW" />          <data android:scheme="h56131bcf" />      </intent-filter>  </activity>


7) 添加图片资源

8) 新建assets文件夹,添加子文件夹data和apps

9) 拷贝资源到data目录下

10) 修改dcloud_control.xml的值,这里我填写了helloh5,大家可以随便填写

11) 在apps下面新建helloh5\www文件夹,注意helloh5就是刚刚你们填写的appid值。
12) 打包Vue项目,注意修改manifest.json中appid的值,这个值就是Android中dcloud_control.xml的appid的值

命令打包:npm run build:app-plus
  1. 把编译出来的项目拷贝到Android中

更多相关文章

  1. 没有一行代码,「2020 新冠肺炎记忆」这个项目却登上了 GitHub 中
  2. 不吹不黑!GitHub 上帮助人们学习编码的 12 个资源,错过血亏...
  3. 一款霸榜 GitHub 的开源 Linux 资源监视器!
  4. Android中使用Sonar进行代码质量分析
  5. Android(安卓)图片文件夹区别
  6. Android(安卓)SdCard 新建文件夹并在文件夹中读、写文件
  7. Android开发资源获取国内代理
  8. Android通过URL获取网络资源
  9. Eclipse集成Android(安卓)NDK开发环境

随机推荐

  1. Android即时通讯(转)
  2. Android轻松搞定Dialog提示动画效果
  3. Android之查看Wifi密码
  4. Android(安卓)代码混淆语法讲解及常用模
  5. 第九章 多语言环境的支持和多屏幕的适配(2
  6. Android(安卓)仿Iphone文件夹分裂效果
  7. Android(安卓)开机如何跨过Luancher界面
  8. android sqlit数据库升级,添加字段
  9. Android(安卓)UI界面(分辨率)最实用的的
  10. Android(安卓)SurfaceView 详解(一)