当前位置: 首页 > wzjs >正文

建设厅官方网站新资质标准创建网站的流程是什么

建设厅官方网站新资质标准,创建网站的流程是什么,驾校网站建设和推广,邢台网站制作一、前言 开机向导原理其实就是将特定的category的Activity加入ComponentResolver&#xff0c;如下 <category android:name"android.intent.category.SETUP_WIZARD"/>然后我们开机启动的时候&#xff0c;FallbackHome结束&#xff0c;然后启动Launcher的时候…

一、前言

开机向导原理其实就是将特定的category的Activity加入ComponentResolver,如下

 <category android:name="android.intent.category.SETUP_WIZARD"/>

然后我们开机启动的时候,FallbackHome结束,然后启动Launcher的时候,就会找到对应的开机向导Activity页面。所以我们现定制我们自己的应用。

二、定制MyApp

1.清单文件,定义好权限和Launcer相关的category

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"xmlns:tools="http://schemas.android.com/tools"><uses-permission android:name="android.permission.WRITE_SETTINGS"tools:ignore="ProtectedPermissions" /><uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS"tools:ignore="ProtectedPermissions" /><applicationandroid:allowBackup="true"android:dataExtractionRules="@xml/data_extraction_rules"android:fullBackupContent="@xml/backup_rules"android:icon="@mipmap/ic_launcher"android:label="@string/app_name"android:roundIcon="@mipmap/ic_launcher_round"android:supportsRtl="true"android:theme="@style/Theme.MyProvision2"tools:targetApi="31"><activityandroid:name=".MainActivity"android:exported="true"android:label="@string/app_name"android:theme="@style/Theme.MyProvision2"><intent-filter android:priority="2"><action android:name="android.intent.action.MAIN"/><category android:name="android.intent.category.HOME"/><category android:name="android.intent.category.DEFAULT"/><category android:name="android.intent.category.SETUP_WIZARD"/></intent-filter></activity></application></manifest>

2.MainActivity,简单一个页面,点击之后完成配置

package com.example.myprovision2import android.content.ComponentName
import android.content.pm.PackageManager
import android.os.Bundle
import android.provider.Settings
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.activity.enableEdgeToEdge
import androidx.compose.foundation.Image
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Scaffold
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import com.example.myprovision2.ui.theme.MyProvision2Themeclass MainActivity : ComponentActivity() {override fun onCreate(savedInstanceState: Bundle?) {super.onCreate(savedInstanceState)enableEdgeToEdge()setContent {MyProvision2Theme {Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->Greeting(name = "Android",modifier = Modifier.padding(innerPadding))Box(Modifier.fillMaxSize(), contentAlignment = Alignment.Center) {Image(modifier=Modifier.fillMaxSize(),painter = painterResource(R.drawable.pic),contentScale = ContentScale.FillBounds,contentDescription = "")OutlinedButton(onClick = {finishSetup()}) {Text(text = "FINISH SET UP",)}}}}}}private fun finishSetup() {setProvisioningState()disableSelfAndFinish()}private fun disableSelfAndFinish() {// remove this activity from the package manager.val pm = packageManagerval name: ComponentName = ComponentName(this, MainActivity::class.java)pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,PackageManager.DONT_KILL_APP)
//         terminate the activity.finish()}private fun setProvisioningState() {
//        Settings
//        Log.i(TAG, "Setting provisioning state")// Add a persistent setting to allow other apps to know the device has been provisioned.Settings.Global.putInt(contentResolver, Settings.Global.DEVICE_PROVISIONED, 1)Settings.Secure.putInt(contentResolver, Settings.Secure.USER_SETUP_COMPLETE, 1)}}@Composable
fun Greeting(name: String, modifier: Modifier = Modifier) {Text(text = "Hello $name!",modifier = modifier)
}@Preview(showBackground = true)
@Composable
fun GreetingPreview() {MyProvision2Theme {Greeting("Android")}
}

3.这里有特殊的权限,需要在system/etc/permissions内配置,我们准备一下权限的xml
com.example.myprovision2.xml

<?xml version="1.0" encoding="utf-8"?>
<!--~ Copyright (C) 2019 The Android Open Source Project~~ Licensed under the Apache License, Version 2.0 (the "License");~ you may not use this file except in compliance with the License.~ You may obtain a copy of the License at~~      http://www.apache.org/licenses/LICENSE-2.0~~ Unless required by applicable law or agreed to in writing, software~ distributed under the License is distributed on an "AS IS" BASIS,~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.~ See the License for the specific language governing permissions and~ limitations under the License-->
<permissions><privapp-permissions package="com.example.myprovision2"><permission name="android.permission.WRITE_SECURE_SETTINGS"/></privapp-permissions>
</permissions>

4.修改Android.bp

android_app_import {name: "MyApp",// this needs to be a privileged applicationprivileged: true,// Make sure the build system doesn't try to resign the APKdex_preopt: {enabled: false,},arch: {arm: {apk: "MyApp.apk",},arm64: {apk: "MyApp.apk",},x86: {apk: "MyApp.apk",},x86_64: {apk: "MyApp.apk",},},certificate: "platform",required: ["MyAppPermissions"],}// 定义 XML 文件复制规则 
prebuilt_etc {name: "MyAppPermissions",      // 模块唯一标识 src: "com.example.myprovision2.xml", // 源文件路径(相对于当前 Android.bp )sub_dir: "permissions",        // 指定 system/etc 下的子目录 filename: "com.example.myprovision2.xml", // 目标文件名(可重命名)}

完成之后我们make MyApp就会自动复制权限xml到对应目录下。

三、验证

我们push apk和xml到对应目录下之后,然后重启设备。这里重启之前还需要重置一下变量

adb shell settings put secure user_setup_complete 0

这样解锁有就可以正常启动我们自定义的开机向导了。

http://www.dtcms.com/wzjs/505558.html

相关文章:

  • 公司网站建设备选方案评价标准域名检测
  • 深圳宝安区石岩街道关键词优化百家号
  • 网站开发可行性技术方案广告主广告商对接平台
  • 网站开发好的语言陕西网站建设网络公司
  • 一个简单校园网的设计新媒体seo培训
  • seo网站优化培训班常用的搜索引擎有哪些
  • 优秀的网页设计网站北京seo技术
  • 浙江省网站建设公司排名网络营销品牌公司
  • 国外的智慧城市建设网站百度手机助手官网
  • 专业网页设计工具360优化大师官方网站
  • jsp法院网站模板关键词优化排名平台
  • 查建设施工资质的网站站长之家查询工具
  • 郑州网站备案百度广告推广平台
  • 乌鲁木齐市疫情发布会最新消息百度上做优化一年多少钱
  • 奢侈品 网站建设方案社群营销的十大步骤
  • 寿光哪里做网站微信引流主动被加软件
  • 网站跳出率多少正常广告营销策略有哪些
  • 邵阳住建部网站百度快速排名软件
  • 做网站价格表百度一下就知道官方
  • 企业网站管理系统安装教程上海营销seo
  • 自己怎么做网站建设关键词搜索爱站网
  • 导航类网站怎么做排名朝阳网站建设
  • 怎么做微信辅助的网站seo优化首页
  • 小型网站设计及建设论文范本网络广告策划方案范文
  • 河间做网站的电话品牌推广是做什么的
  • 济南做网站公司河南网站开发公司
  • 做网站怎么做seo关键词推广
  • 优质的做网站百度地图推广怎么收费标准
  • 只使用html做简单网站seo广告优化
  • 高端婚纱摄影网站什么是网络营销