CONMISANMA的正确答案——使用Cordova开发android桌面程序(launcher)

部分内容转载至: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、编译运行即可把你的应用变成桌面应用

 

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值