部分内容转载至:android手把手教你开发launcher(一)(AndroidStudio版)
测试系统:DEEPIN LINUX 15.6
测试软件:ANDROID STUDIO 3.1.3 & Cordova 8.0.0
测试机器:i6200扫描枪
1、创建应用:
cordova create hello com.example.hello HelloWorld
2、添加安卓平台:
cordova platform add android --save
3、打开ANDROID STUDIO,选择创建的“hello”文件夹,选中文件夹中的../hello/platforms/android,点击确认
4、等待项目build完毕(进度条走完了还要再等十几秒),双击项目的app/manifests/AndroidManifest.xml
5、内容如下:
<?xml version='1.0' encoding='utf-8'?>
<manifest android:hardwareAccelerated="true"
android:versionCode="10000"
android:versionName="1.0.0"
package="com.example.hello"
xmlns:android="http://schemas.android.com/apk/res/android">
<supports-screens android:anyDensity="true"
android:largeScreens="true"
android:normalScreens="true"
android:resizeable="true"
android:smallScreens="true"
android:xlargeScreens="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application android:hardwareAccelerated="true"
android:icon="@mipmap/icon"
android:label="@string/app_name"
android:supportsRtl="true">
<activity android:configChanges="orientation|keyboardHidden|keyboard|screenSize|locale"
android:label="@string/activity_name"
android:launchMode="singleTop"
android:name="MainActivity"
android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
android:windowSoftInputMode="adjustResize">
<intent-filter android:label="@string/launcher_name">
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="16" android:targetSdkVersion="26" />
</manifest>
6、添加两行内容至<intent-filter>
<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />
7、编译运行即可把你的应用变成桌面应用