android设置添加设备QR码信息

摘要:客户衍生需求,通过扫QR码快速获取设备基础信息,并且基于POS SDK进行打印。

1. 定位至device info的xml添加相关perference

Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/my_device_info.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/my_device_info.xml	(版本 346)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/xml/my_device_info.xml	(版本 347)
@@ -92,10 +92,17 @@android:selectable="false"android:title="@string/my_device_info_device_details_category_title">+        <com.android.settings.widget.QRDeviceInfoPreference
+            android:key="qr_info"
+            android:order="18"
+            android:persistent="false"
+            android:selectable="false"
+            settings:controller="com.android.settings.deviceinfo.QRDeviceInfoPreferenceController" />
+<!-- SIM status --><Preferenceandroid:key="sim_status"
-            android:order="18"
+            android:order="19"android:title="@string/sim_status_title"settings:keywords="@string/keywords_sim_status"android:summary="@string/summary_placeholder"
Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java	(版本 346)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/aboutphone/MyDeviceInfoFragment.java	(版本 347)
@@ -41,6 +41,7 @@
+import com.android.settings.deviceinfo.QRDeviceInfoPreferenceController;
@@ -150,6 +151,7 @@
+        controllers.add(new QRDeviceInfoPreferenceController(context));return controllers;}

2. preference布局

Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/qr_device_info_preference.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/qr_device_info_preference.xml	(不存在的)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/layout/qr_device_info_preference.xml	(版本 347)
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:orientation="vertical" >
+
+    <ImageView
+        android:id="@+id/iv_qr_image"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="center"/>
+
+    <Button
+        android:id="@+id/print_button"
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_gravity="bottom|end"
+        android:paddingVertical="14dp"
+        android:drawableStart="@drawable/ic_print"
+        android:drawablePadding="9dp"
+        android:text="@string/print"
+        style="@style/ActionPrimaryButton"/>
+</FrameLayout>
Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/drawable/ic_print.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/drawable/ic_print.xml	(不存在的)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/drawable/ic_print.xml	(版本 347)
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright 2017 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.
+  -->
+
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:width="24dp"
+    android:height="24dp"
+    android:viewportWidth="24.0"
+    android:viewportHeight="24.0">
+    <path
+        android:pathData="M19,8L5,8c-1.66,0 -3,1.34 -3,3v6h4v4h12v-4h4v-6c0,-1.66 -1.34,-3 -3,-3zM16,19L8,19v-5h8v5zM19,12c-0.55,0 -1,-0.45 -1,-1s0.45,-1 1,-1 1,0.45 1,1 -0.45,1 -1,1zM18,3L6,3v4h12L18,3z"
+        android:fillColor="#FFFFFF"/>
+</vector>

3. 实现

QR码的生成使用的是google公开的com.google.zxing

Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreference.java
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreference.java	(不存在的)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreference.java	(版本 347)
@@ -0,0 +1,401 @@
+/*
+ * Copyright (C) 2017 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.
+ */
+
+package com.android.settings.widget;
+
+import android.app.AlertDialog;
+import android.content.Context;
+import android.content.DialogInterface;
+import android.graphics.Bitmap;
+import android.graphics.BitmapFactory;
+import android.graphics.Canvas;
+import android.os.Build;
+import android.os.Environment;
+import android.os.Handler;
+import android.os.Message;
+import android.os.SystemProperties;
+import android.telephony.TelephonyManager;
+import android.text.TextUtils;
+import android.util.AttributeSet;
+import android.util.Log;
+import android.view.LayoutInflater;
+import android.view.View;
+import android.widget.Button;
+import android.widget.ImageView;
+
+import androidx.preference.Preference;
+import androidx.preference.PreferenceViewHolder;
+
+import com.android.settings.R;
+
+import com.google.zxing.BarcodeFormat;   
+import com.google.zxing.EncodeHintType;   
+import com.google.zxing.MultiFormatWriter;   
+import com.google.zxing.WriterException;   
+import com.google.zxing.common.BitMatrix;
+
+import com.pos.sdk.accessory.PosAccessoryManager;
+import com.pos.sdk.printer.PosPrinter;
+
+import java.lang.StringBuilder;
+import java.util.Hashtable;
+
+public class QRDeviceInfoPreference extends Preference {
+
+    private static final String TAG = "QRDeviceInfoPreference";
+
+    private static final int BLACK = 0xff000000;
+
+    private static final int PRINTER_ERROR_NO_PAPER = 1;
+    private static final int PRINTER_ERROR_OVER_HEAT = 2;
+    private static final int PRINTER_STATE_CHANGED = 3;
+    private static final int PRINTER_ERROR_NO_BATTERY = 4;
+
+    private Context mContext;
+    private Bitmap qrCodeBitmap;
+    private Button mPrintBtn;
+    private ImageView qrImgImageView;
+    private PosPrinter mPrinter;
+    private TelephonyManager mTelephonyManager;
+    private String mSpVersion, mDsn, mPsn;
+
+    private PosPrinter.EventListener mListener = new PosPrinter.EventListener() {
+        @Override
+        public void onInfo(PosPrinter printer, int what, int extra) {
+            Log.i(TAG, "onInfo: what= " + what + ", extra= " + extra);
+            if (what == PosPrinter.PRINTER_INFO_STATE_CHANGED) {
+                mHandler.sendMessage(mHandler.obtainMessage(PRINTER_STATE_CHANGED, extra, 0));
+            }
+        }
+
+        @Override
+        public void onError(PosPrinter printer, int what, int extra) {
+            switch(what) {
+                case PosPrinter.PRINTER_ERROR_NO_PAPER:
+                    mHandler.sendEmptyMessage(PRINTER_ERROR_NO_PAPER);
+                    break;
+                case PosPrinter.PRINTER_ERROR_OVER_HEAT:
+                    Log.e(TAG, "PRINTER_ERROR_OVER_HEAT");
+                    mHandler.sendEmptyMessage(PRINTER_ERROR_OVER_HEAT);
+                    break;
+                case PosPrinter.PRINTER_ERROR_STATE:
+                    Log.e(TAG, "PRINTER_ERROR_STATE");
+                    if (extra == PosPrinter.PRINTER_STATE_NO_BATTERY) {
+                        mHandler.sendEmptyMessage(PRINTER_ERROR_NO_BATTERY);
+                    }
+                    break;
+                default:
+                    Log.e(TAG, "PRINTER_ERROR: " + what);
+                    break;
+            }
+        }
+
+        @Override
+        public void onCursorChanged(PosPrinter printer, int x, int y, int lastX, int lastY) {
+            Log.d(TAG, "onCursorChanged: x= " + x + ", y= " + ", lastX= " + ", lastY=" + lastY);
+        }
+    };
+
+    private Handler mHandler = new Handler() {
+        public void handleMessage(Message msg) {
+            super.handleMessage(msg);
+            switch (msg.what) {
+                case PRINTER_ERROR_NO_PAPER: {
+                    AlertDialog.Builder dlg = new AlertDialog.Builder(mContext);
+                    dlg.setTitle(R.string.reload_paper);
+                    dlg.setCancelable(false);
+                    dlg.setPositiveButton(R.string.been_installed_paper, new DialogInterface.OnClickListener(){
+                        @Override
+                        public void onClick(DialogInterface dialog, int whichButton) {
+                            mPrintBtn.setEnabled(false);
+                            mHandler.post(mPrinterRunnable);
+                        }
+                    });
+                    dlg.setNegativeButton(R.string.dlg_cancel, new DialogInterface.OnClickListener(){
+                        @Override
+                        public void onClick(DialogInterface dialog, int whichButton) {
+                            mPrintBtn.setEnabled(true);
+                        }
+                    });
+                    dlg.show();
+                    break;
+                }
+                case PRINTER_ERROR_OVER_HEAT: {
+                    AlertDialog.Builder dlg = new AlertDialog.Builder(mContext);
+                    dlg.setTitle(R.string.printer_overheat);
+                    dlg.setMessage(R.string.printer_overheat_summary);
+                    dlg.setCancelable(false);
+                    dlg.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){
+                        @Override
+                        public void onClick(DialogInterface dialog, int whichButton) {
+                            mPrintBtn.setEnabled(true);
+                        }
+                    });
+                    dlg.show();
+                    break;
+                }
+                case PRINTER_ERROR_NO_BATTERY: {
+                    AlertDialog.Builder dlg = new AlertDialog.Builder(mContext);
+                    dlg.setTitle(R.string.printer_no_battery);
+                    dlg.setMessage(R.string.printer_no_battery_summary);
+                    dlg.setCancelable(false);
+                    dlg.setPositiveButton(R.string.ok, new DialogInterface.OnClickListener(){
+                        @Override
+                        public void onClick(DialogInterface dialog, int whichButton) {
+                            mPrintBtn.setEnabled(true);
+                        }
+                    });
+                    dlg.show();
+                    break;
+                }
+                case PRINTER_STATE_CHANGED:
+                    if (msg.arg1 == PosPrinter.PRINTER_STATE_PRINTING) {
+                        mPrintBtn.setEnabled(false);
+                    } else {
+                        mPrintBtn.setEnabled(true);
+                    }
+                    break;
+                default:
+                    break;
+            }
+        }
+    };
+
+    public QRDeviceInfoPreference(Context context, AttributeSet attributeSet) {
+        this(context, attributeSet, 0);
+    }
+
+    public QRDeviceInfoPreference(Context context, AttributeSet attributeSet, int paramInt) {
+        super(context, attributeSet, paramInt);
+        setLayoutResource(R.layout.qr_device_info_preference);
+        mContext = context;
+        mTelephonyManager = (TelephonyManager) context.getSystemService(Context.TELEPHONY_SERVICE);
+        mDsn = mTelephonyManager.getDsn(mContext);
+        mPsn = mTelephonyManager.getPsn(mContext);
+        mSpVersion = PosAccessoryManager.getDefault().getSpVersion();
+
+        int ret = -1;
+        int numOfPrinter = PosPrinter.getNumberOfPrinters();
+        if (numOfPrinter > 0) {
+            mPrinter = PosPrinter.open();
+            if (mPrinter != null) {
+                mPrinter.setOnEventListener(mListener);
+                ret = 0;
+            }
+        }
+        if (ret == -1) {
+            Log.d(TAG, "no printer");
+        }
+    }
+
+    @Override
+    public void onBindViewHolder(PreferenceViewHolder view) {
+        super.onBindViewHolder(view);
+
+        mPrintBtn = (Button) view.findViewById(R.id.print_button);
+        mPrintBtn.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                mHandler.post(mPrinterRunnable);
+            }
+        });
+
+        qrImgImageView = (ImageView) view.findViewById(R.id.iv_qr_image);
+        qrImgImageView.setEnabled(false);
+        qrImgImageView.setOnClickListener(new View.OnClickListener() {
+            @Override
+            public void onClick(View v) {
+                showDialog();
+            }
+        });
+        qrImgImageView.setOnLongClickListener(new View.OnLongClickListener() {
+            @Override
+            public boolean onLongClick(View v) {
+                if (qrCodeBitmap != null) {
+                    print(qrCodeBitmap);
+                }
+                return true;
+            }
+        });
+
+        try {
+            String contentString = getDeviceInfo();
+            if (!TextUtils.isEmpty(contentString)) {
+                qrCodeBitmap = createQRCode(contentString, 350);
+                qrImgImageView.setImageBitmap(qrCodeBitmap);
+            }
+        } catch (WriterException e) {
+            // TODO Auto-generated catch block
+            e.printStackTrace();
+        }
+    }
+
+    private Bitmap createQRCode(String str,int widthAndHeight) throws WriterException {
+        Hashtable<EncodeHintType, String> hints = new Hashtable<EncodeHintType, String>();
+        hints.put(EncodeHintType.CHARACTER_SET, "utf-8");
+        BitMatrix matrix = new MultiFormatWriter().encode(str,
+                BarcodeFormat.QR_CODE, widthAndHeight, widthAndHeight);
+        int width = matrix.getWidth();
+        int height = matrix.getHeight();
+        int[] pixels = new int[width * height];
+
+        for (int y = 0; y < height; y++) {
+            for (int x = 0; x < width; x++) {
+                if (matrix.get(x, y)) {
+                    pixels[y * width + x] = BLACK;
+                }
+            }
+        }
+        Bitmap bitmap = Bitmap.createBitmap(width, height,
+                Bitmap.Config.ARGB_8888);
+        bitmap.setPixels(pixels, 0, width, 0, 0, width, height);
+
+        // add logo
+        Bitmap brandBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.mipmap.company_logo);
+        if (brandBitmap != null) {
+            bitmap = addLogoToQRCode(bitmap, brandBitmap);
+        }
+        return bitmap;
+    }
+
+    private Bitmap addLogoToQRCode(Bitmap qrCodeBitmap, Bitmap logoBitmap) {
+        if (qrCodeBitmap == null) {
+            Log.d(TAG, "addLogoToQRCode::qrCodeBitmap is null");
+            return null;
+        }
+
+        if (logoBitmap == null) {
+            Log.d(TAG, "addLogoToQRCode::logoBitmap is null");
+            return qrCodeBitmap;
+        }
+
+        int qrWidth = qrCodeBitmap.getWidth();
+        int qrHeight = qrCodeBitmap.getHeight();
+        int logoWidth = logoBitmap.getWidth();
+        int logoHeight = logoBitmap.getHeight();
+
+        if (qrWidth == 0 || qrHeight == 0) {
+            Log.d(TAG, "addLogoToQRCode::qrCodeBitmap size is wrong");
+            return null;
+        }
+
+        if (logoWidth == 0 || logoHeight == 0) {
+            Log.d(TAG, "addLogoToQRCode::logoBitmap size is wrong");
+            return qrCodeBitmap;
+        }
+
+        float scaleFactor = qrWidth * 1.0f / 5 / logoWidth;
+        Bitmap resultBitmap = Bitmap.createBitmap(qrWidth, qrHeight, qrCodeBitmap.getConfig());
+        Canvas canvas = new Canvas(resultBitmap);
+        canvas.drawBitmap(qrCodeBitmap, 0, 0, null);
+
+        canvas.scale(scaleFactor, scaleFactor, qrWidth / 2, qrHeight / 2);
+        canvas.drawBitmap(logoBitmap, (qrWidth - logoWidth) / 2, (qrHeight - logoHeight) / 2, null);
+        canvas.save(Canvas.ALL_SAVE_FLAG);
+        canvas.restore();
+
+        return resultBitmap;
+    }
+
+    private void print(Bitmap bitmap) {
+        int num = PosPrinter.getNumberOfPrinters();
+        if (num > 0) {
+            mPrinter = PosPrinter.open();
+            mPrinter.printBitmap(bitmap);
+        }
+    }
+
+    private void showDialog() {
+        AlertDialog.Builder builder = new AlertDialog.Builder(mContext);
+        final View dialogView = LayoutInflater.from(mContext).inflate(R.layout.qr_device_info_preference, null);
+        ImageView mImageView = (ImageView) dialogView.findViewById(R.id.iv_qr_image);
+        mImageView.setImageBitmap(qrCodeBitmap);
+        builder.setView(dialogView);
+        builder.setPositiveButton(R.string.print_settings, new DialogInterface.OnClickListener() { 
+            @Override 
+            public void onClick(DialogInterface dialog, int which) {
+                if (qrCodeBitmap != null) {
+                    print(qrCodeBitmap);
+                }
+            } 
+        });
+        builder.show();
+    }
+
+    private String getDeviceInfo() {
+        String model = "Model:" + Build.MODEL;
+        String dsn = "DSN:" + mDsn;
+        String psn = "PSN:" + mPsn;
+        String ap_version = "AP:" + SystemProperties.get("ro.build.sw.version");
+        String sp_version = "SP:" + mSpVersion;
+        String modem_version = "Modem:" + Build.getRadioVersion();
+        StringBuilder sb = new StringBuilder();
+        sb.append(model + "\n");
+        sb.append(dsn + "\n");
+        sb.append(psn + "\n");
+        sb.append(ap_version + "\n");
+        sb.append(sp_version + "\n");
+        sb.append(modem_version + "\n");
+        return sb.toString();
+    }
+
+    private Runnable mPrinterRunnable = new Runnable(){
+        @Override
+        public void run() {
+            mPrinter.cleanCache();
+            PosPrinter.Parameters param = mPrinter.getParameters();
+
+            param.setPrintAlign(param.ALIGH_CENTER);
+            mPrinter.setParameters(param);
+            Bitmap brandBitmap = BitmapFactory.decodeResource(mContext.getResources(), R.mipmap.company_logo);
+            if (brandBitmap != null) {
+                mPrinter.addBitmapToCache(brandBitmap);
+            }
+
+            param.setFontSize(30);
+            param.setPrintAlign(param.ALIGH_CENTER);
+            param.setFontName(Environment.getRootDirectory().toString() + "/fonts/DroidSansMono.ttf");
+            param.setFontEffet(param.EFFECT_BOLD);
+            mPrinter.setParameters(param);
+            mPrinter.addTextToCurCache("---" + mContext.getResources().getString(R.string.device_info) + "---");
+            
+            param.setFontSize(24);
+            param.setPrintAlign(param.ALIGH_LEFT);
+            param.setFontName(Environment.getRootDirectory().toString() + "/fonts/Roboto-Italic.ttf");
+            param.setFontEffet(param.EFFECT_NONE);
+            mPrinter.setParameters(param);
+            mPrinter.addTextToCurCache("Model: " + Build.MODEL);
+            mPrinter.addTextToCurCache("AP: " + SystemProperties.get("ro.build.sw.version"));
+            mPrinter.addTextToCurCache("SP: " + mSpVersion);
+            mPrinter.addTextToCurCache("DSN: " + mDsn);
+            mPrinter.addTextToCurCache("PSN: " + mPsn);
+            mPrinter.addTextToCurCache("Modem: " + Build.getRadioVersion());
+
+            param.setFontSize(18);
+            param.setPrintAlign(param.ALIGH_CENTER);
+            param.setFontName(Environment.getRootDirectory().toString() + "/fonts/DroidSansMono.ttf");
+            param.setFontEffet(param.EFFECT_LEAN);
+            mPrinter.setParameters(param);
+            mPrinter.addTextToCurCache("-----" + mContext.getResources().getString(R.string.website) + "-----");
+
+            if (qrCodeBitmap != null) {
+                mPrinter.addBitmapToCache(qrCodeBitmap);
+            }
+            mPrinter.addTextToCurCache("\n\n\n");
+            mPrinter.print();
+        }
+    };
+}

4. 控制preference是否显示

Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/config.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/config.xml	(版本 346)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/config.xml	(版本 347)
@@ -649,4 +649,6 @@+
+    <bool name="config_show_qr_info">true</bool></resources>
Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreferenceController.java
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreferenceController.java	(不存在的)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/src/com/android/settings/deviceinfo/QRDeviceInfoPreferenceController.java	(版本 347)
@@ -0,0 +1,35 @@
+package com.android.settings.deviceinfo;
+
+import android.content.Context;
+import androidx.preference.PreferenceScreen;
+
+import com.android.settings.R;
+import com.android.settings.core.BasePreferenceController;
+import com.android.settings.widget.QRDeviceInfoPreference;
+
+public class QRDeviceInfoPreferenceController extends BasePreferenceController {
+    private static final String PREF_KEY = "qr_info";
+    private QRDeviceInfoPreference mPreference;
+
+    public QRDeviceInfoPreferenceController(Context context) {
+        super(context, PREF_KEY);
+    }
+
+    @Override
+    public void displayPreference(PreferenceScreen screen) {
+        super.displayPreference(screen);
+        mPreference = (QRDeviceInfoPreference) screen.findPreference(PREF_KEY);
+    }
+
+    @Override
+    public int getAvailabilityStatus() {
+        return mContext.getResources()
+                .getBoolean(R.bool.config_show_qr_info)
+                ? AVAILABLE : DISABLED_FOR_USER;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return PREF_KEY;
+    }
+}

5. 相关字串

Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml	(版本 346)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values/strings.xml	(版本 347)
@@ -364,4 +364,15 @@
+
+    <string name="print">print</string>
+    <string name="reload_paper">reload paper</string>
+    <string name="dlg_cancel">cancel</string>
+    <string name="been_installed_paper">paper ready</string>
+    <string name="printer_overheat">printer overheat</string>
+    <string name="printer_overheat_summary">printer overheat, please try again later</string>
+    <string name="printer_no_battery">printer no battery</string>
+    <string name="printer_no_battery_summary">no battery, please install the battery and try again</string>
+    <string name="device_info">DEVICE INFO</string>
+    <string name="website">www.xxx.cn</string></resources>
Index: vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml
===================================================================
--- vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml	(版本 346)
+++ vendor/mediatek/proprietary/packages/apps/MtkSettings/res/values-zh-rCN/strings.xml	(版本 347)
@@ -386,4 +386,15 @@
+    <string name="print">打印</string>
+    <string name="reload_paper">请重新装纸</string>
+    <string name="dlg_cancel">"取消"</string>
+    <string name="been_installed_paper">已经装好纸</string>
+    <string name="printer_overheat">温度过热</string>
+    <string name="printer_overheat_summary">打印机温度过热,请稍候再试</string>
+    <string name="printer_no_battery">没有电池</string>
+    <string name="printer_no_battery_summary">未安装电池,请安装电池再试</string>
+    <string name="no_printer">没有找到打印机</string>
+    <string name="no_printer_summary">没有找到打印机,请检查打印硬件是否正常</string>
+    <string name="device_info">设备信息</string></resources>

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.rhkb.cn/news/16602.html

如若内容造成侵权/违法违规/事实不符,请联系长河编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

多机器人系统的大语言模型:综述

25年2月来自 Drexel 大学的论文“Large Language Models for Multi-Robot Systems: A Survey”。 大语言模型 (LLM) 的快速发展为多机器人系统 (MRS) 开辟新的可能性&#xff0c;从而增强通信、任务规划和人机交互。与传统的单机器人和多智体系统不同&#xff0c;MRS 带来独特…

【欧洲数据集】高分辨率网格气象数据集E-OBS

目录 数据概述最新版本 E-OBS 30.0e数据下载下载链接1:ECA&D官网下载链接2:ECMWF参考E-OBS 数据集(E-OBS, European high-resolution gridded dataset)是基于 European Climate Assessment & Dataset (ECA&D) 信息的高分辨率网格化观测数据集,涵盖欧洲地区的多…

游戏引擎学习第100天

仓库:https://gitee.com/mrxiao_com/2d_game_2 昨天的回顾 今天的工作重点是继续进行反射计算的实现。昨天&#xff0c;我们开始了反射和环境贴图的工作&#xff0c;成功地根据法线显示了反射效果。然而&#xff0c;我们还没有实现反射向量的计算&#xff0c;导致反射交点的代…

Mac上搭建宝塔环境并部署PHP项目

安装Docker Desktop》搭建Centos版本的宝塔环境》部署PHP项目 1. 下载Docker for mac 软件&#xff1a;https://www.docker.com/ 或使用终端命令&#xff1a;brew install --cask --appdir/Applications docker 2. 使用命令安装宝塔环境的centos7系统&#xff1a; docker pul…

从肠道菌群到炎症因子:读懂疾病的预警信号

当我们的皮肤被轻微割伤或烧伤时&#xff0c;伤口周围区域可能会变得红肿、发热&#xff0c;甚至伴有疼痛&#xff1b;感冒时&#xff0c;喉咙痛、肿胀&#xff1b;不小心扭伤后&#xff0c;可能会肿胀、疼痛和僵硬…这些都与炎症相关。 炎症&#xff0c;作为身体对损伤或感染的…

83.在 Vue3 中使用 OpenLayers 利用 TLE 计算并显示单个卫星的轨迹

1. 前言 在可视化开发中&#xff0c;卫星轨迹的实时计算与展示是一个比较有趣的应用场景。TLE&#xff08;Two-Line Element Set&#xff09;是一种用于描述卫星轨道参数的格式&#xff0c;我们可以通过 satellite.js 解析 TLE 数据&#xff0c;并计算卫星在任意时间点的位置。…

Vue3(2)

一.Vue新特性 &#xff08;1&#xff09;defineOptions:主要是用来定义Options API的选项 背景说明&#xff1a;有< script setup >之前&#xff0c;如果定义props&#xff0c;emits可以轻而易举地添加一个与setup平级 的属性。但是用了< script setup >后&#…

π 的奥秘:如何用有理数逼近无理数?

本文将围绕有理数、无理数、连续统以及它们之间的深刻联系展开讨论&#xff0c;并结合具体的数学理论如康托尔区间套定理、戴德金分割、柯西施瓦茨不等式等&#xff0c;进行简要探讨 由于本文并未深入探讨&#xff0c;可能存在部分不严谨的地方&#xff0c;也欢迎各位进行纠正…

图书管理项目(spring boot + Vue)

想要该项目的话&#xff0c;就 jia 我&#xff0c;并在评论区给我说一下&#xff0c;只需要1元&#xff0c;我把整个项目发给你 jia微&#xff1a;18439421203&#xff08;名字叫&#xff1a;Bingo&#xff09; 运行图片&#xff1a;

131,【2】 攻防世界 catcat-new

进入靶场 &#x1f431; 点击图片时发现url处很可疑 想到文件读取 ../app.py # 导入 os 模块&#xff0c;用于与操作系统进行交互&#xff0c;例如文件操作、路径操作等 import os # 导入 uuid 模块&#xff0c;用于生成通用唯一识别码&#xff0c;常用于生成随机的密钥 imp…

NO.12十六届蓝桥杯备战|关系操作符|操作符连用|浮点数比较|练习2道(C++)

关系操作符 关系操作符介绍 ⽤于⽐较的表达式&#xff0c;称为“关系表达式”&#xff08;relational expression&#xff09;&#xff0c;⾥⾯使⽤的运算符就称为“关 系运算符”&#xff08;relational operator&#xff09;&#xff0c;主要有下⾯6个。 运算符描述>⼤…

.NET Web-静态文件访问目录浏览

一、Web根目录访问 创建wwwroot文件夹app.UseStaticFiles(); // 启⽤静态⽂件中间件url/路径 进行访问 二、Web根目录之外的文件 app.UseStaticFiles(new StaticFileOptions {FileProvider new PhysicalFileProvider(Path.Combine(builder.Environment.ContentRootPath,&qu…

【漏洞复现】Casbin get-users 账号密码泄漏漏洞

免责声明 请勿利用文章内的相关技术从事非法测试&#xff0c;由于传播、利用此文所提供的信息而造成的任何直接或者间接的后果及损失&#xff0c;均由使用者本人负责&#xff0c;作者不为此承担任何责任。工具来自网络&#xff0c;安全性自测&#xff0c;如有侵权请联系删除。…

PPDock:复旦大学团队研发的蛋白质-配体“盲对接“技术

PPDock: Pocket Prediction-Based Protein−Ligand Blind Docking 发表于Journal of Chemical Information and Modeling&#xff0c;第一作者为 Jie Du&#xff0c;通讯作者为 Manning Wang&#xff0c;研究团队来自复旦大学。该研究提出一种新的基于口袋预测的蛋白质 - 配体盲…

中间件-安装Minio-集成使用(ubantu-docker)

目录 1、安装docer 2、运行以下命令拉取MinIO的Docker镜像 3、检查当前所有Docker下载的镜像 4、创建目录 5、创建Minio容器并运行 6、SDK操作 FileUploader.java 1、安装docer 参考这篇&#xff1a;Linux安装Docker 2、运行以下命令拉取MinIO的Docker镜像 docker pull…

使用 Notepad++ 编辑显示 MarkDown

Notepad 是一款免费的开源文本编辑器&#xff0c;专为 Windows 用户设计。它是替代记事本&#xff08;Notepad&#xff09;的最佳选择之一&#xff0c;因为它功能强大且轻量级。Notepad 支持多种编程语言和文件格式&#xff0c;并可以通过插件扩展其功能。 Notepad 是一款功能…

Java 大视界 -- 区块链赋能 Java 大数据:数据可信与价值流转(84)

&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎来到 青云交的博客&#xff01;能与诸位在此相逢&#xff0c;我倍感荣幸。在这飞速更迭的时代&#xff0c;我们都渴望一方心灵净土&#xff0c;而 我的博客 正是这样温暖的所在。这里为你呈上趣味与实用兼具的知识&#xff0c;也…

【Android开发】Android Studio汉化

前言 该插件是官方支持插件&#xff0c;未对任何软件进行修改和破解 Android Studio 是基于 IntelliJ IDEA 社区版开发的集成开发环境&#xff08;IDE&#xff09;&#xff0c;专门用于Android应用程序的开发。以下是为什么 Android Studio 能使用 IntelliJ IDEA 插件的原因&am…

七、I2C通信读取LM75B温度

7.1 概述 I2C&#xff08;Inter-Integrated Circuit&#xff09;是一种同步、多主从、串行通信协议&#xff0c;由飞利浦公司开发&#xff0c;主要用于短距离通信&#xff0c;尤其在集成电路之间。 7.1.1 主要特点 两线制&#xff1a;仅需SDA&#xff08;数据线&#xff09;…

CSS 小技巧 —— CSS 实现 Tooltip 功能-鼠标 hover 之后出现弹层

CSS 小技巧 —— CSS 实现 Tooltip 功能-鼠标 hover 之后出现弹层 1. 两个元素实现 <!DOCTYPE html> <html lang"zh-CN"> <head><meta charset"UTF-8"><title>纯 CSS 实现 Tooltip 功能-鼠标 hover 之后出现弹层</titl…