首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
社区首页 >问答首页 >“允许所有时间”位置提示不会出现在Android 29中。

“允许所有时间”位置提示不会出现在Android 29中。
EN

Stack Overflow用户
提问于 2020-05-20 01:12:46
回答 7查看 34.3K关注 0票数 21

在SDK 29中,我无法获得“允许所有时间”的位置提示。我已经在清单中设置了这些权限:

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

并请求用户在运行时允许这些权限。但是它只返回“当应用程序打开时”和“拒绝”选项。

任何关于如何在SDK 29中显示它的想法。

EN

回答 7

Stack Overflow用户

回答已采纳

发布于 2020-05-20 01:41:23

为了访问运行Android 10 (API级别29)或更高版本的设备的后台位置,还需要在清单文件中使用下面的权限。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
 <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />

有关更多信息,请参考下面的链接

https://developer.android.com/training/location/permissions?hl=fr

票数 17
EN

Stack Overflow用户

发布于 2020-05-20 01:30:59

在清单中添加权限ACCESS_BACKGROUND_LOCATION。要求在android 10及更高版本上显示始终允许选项。

参见https://developer.android.com/training/location/background#evaluate中的第二点

票数 7
EN

Stack Overflow用户

发布于 2020-06-28 08:00:53

我发现仅仅在清单中添加权限是不够的。我必须为用户提供一个选项,以便在启动时授予它,就像我需要为ACCESS_FINE_LOCATION所做的那样。有趣的是,当我检查这个应用程序中是否已经授予了后台权限时,它从来没有给出错误。但是如果我不检查,我就得不到“允许所有时间”的选项。这是在Android像素2版本10上。

这在安卓的10+版本中是唯一必要的。请求这两种权限使用户可以在对话框中选择.当然,用户可能不会选择“所有时间”。没有人能做这件事!

我有点不好意思添加我的代码,因为我知道这很糟糕。当然还有其他人可以改进它。我无法找到避免两次遍历权限的方法。

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
/**
 * This method lists all the permissions needed and gives reasons for each of them in a single
 * dialog. When the user presses ok, Android will popup separate dialogs for each permission
 * that is needed. In the case of location, the "Allow all the time" gives background permission
 * "Allow only while the app is running gives just the location permission while in foreground.
 * @return false if permissions are to be requested, true if they have already been granted.
 *
 * In Android 11 Build 30 things are a lot different. One has to ask for location first, approve
 * the 'while the app is running' option and then upon return in the Activity result, ask for
 * the background. Thus the new variable 'secondPassR' to handle this case. After the background
 * one comes back to the Activity result and then one can go into the main activity.
 */
static boolean secondPassR = false;
private static final int REQUEST_CODE_MULTIPLE_PERMISSIONS = 57;
private boolean requestPermissions(Activity activity)
{
    Log.v(TAG, "requestPermissions() called");
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M)
    {
        final List<String> permissionsList = new ArrayList<>();
        final List<String> reasonList = new ArrayList<>();

        if(!addPermission(permissionsList, Manifest.permission.ACCESS_FINE_LOCATION, activity))
        {
            reasonList.add("LOCATION PERMISSION: Needs needs to be granted for the Bluetooth " +
                    " LE scanner to discover devices!\n\n");
        }
        if ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) && (Build.VERSION.SDK_INT < Build.VERSION_CODES.R) || secondPassR)
        {
            if (!addPermission(permissionsList, Manifest.permission.ACCESS_BACKGROUND_LOCATION, activity))
            {
                reasonList.add("BACKGROUND PERMISSION: Needs to be granted for the Bluetooth " +
                        "LE Scanner to run in the background.\n\n");
            }
        }
        if (permissionsList.size() > 0)
        {
            if (reasonList.size() > 0)
            {
                // Need Rationale
                StringBuilder message = new StringBuilder(reasonList.get(0));
                for (int i = 1; i < reasonList.size(); i++)
                {
                    message.append(" ").append(reasonList.get(i));
                }
                final androidx.appcompat.app.AlertDialog.Builder builder =
                        new androidx.appcompat.app.AlertDialog.Builder(new ContextThemeWrapper(activity, R.style.Theme_AppCompat_Light));
                builder.setTitle("Demo needs the following permissions:");
                if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N)
                {
                    builder.setMessage(Html.fromHtml(message.toString(), Html.FROM_HTML_MODE_LEGACY));
                }
                else
                {
                    builder.setMessage(Html.fromHtml(message.toString()));
                }
                builder.setPositiveButton(android.R.string.ok, null);
                builder.setOnDismissListener(dialog -> {
                    Log.v(TAG, "Requesting permissions");
                    activity.requestPermissions(permissionsList.toArray(new String[0]),  // newer Java recommended
                            REQUEST_CODE_MULTIPLE_PERMISSIONS);
                });
                builder.show();
                return false;
            }
            activity.requestPermissions(permissionsList.toArray(new String[0]),   // newer Java recommended
                    REQUEST_CODE_MULTIPLE_PERMISSIONS);
        }
        else
        {
            return true;
        }
    }
    else
    {
        return true;
    }
    return false;
}

@TargetApi(23)
private boolean addPermission(List<String> permissionsList, String permission, Activity activity)
{
    Log.v(TAG,
            "addPermission() called with: " + "permissionsList = " +
                    "[" + permissionsList + "], permission = [" + permission + "]");
    if (ActivityCompat.checkSelfPermission(activity, permission) != PackageManager.PERMISSION_GRANTED)
    {
        permissionsList.add(permission);
        // Check for Rationale Option
        return activity.shouldShowRequestPermissionRationale(permission);
    }
    return true;
}

@Override
public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
{
    super.onRequestPermissionsResult(requestCode, permissions, grantResults);
    String permission = "";
    Log.v(TAG,
            "onRequestPermissionsResult() called with: " + "requestCode = [" + requestCode +
                    "], permissions = [" + Arrays.toString(permissions) + "]," +
                    " grantResults = [" + Arrays.toString(grantResults) + "]");
    if (requestCode == REQUEST_CODE_MULTIPLE_PERMISSIONS)
    {
        for (int i = 0; i < permissions.length; i++)
        {
            switch (permissions[i])
            {
                case Manifest.permission.ACCESS_FINE_LOCATION:
                    if (grantResults[i] == PackageManager.PERMISSION_GRANTED)
                    {
                        Log.d(TAG, "H@H: onRequestPermissionsResult: FINE LOCATION PERMISSION");
                        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R)
                        {
                            Log.d(TAG, "H@H: Now requesting BACKGROUND PERMISSION for version 11+");
                            secondPassR = true;
                            requestPermissions(thisActivity);
                            return;
                        }
                    }
                    break;
                case Manifest.permission.ACCESS_BACKGROUND_LOCATION:
                    if (grantResults[i] == PackageManager.PERMISSION_GRANTED)
                    {
                        Log.d(TAG, "H@H: onRequestPermissionsResult: BACKGROUND PERMISSION");
                    }
                    break;
            }
        }
    }
    Log.d(TAG, "Starting primary activity");
    secondPassR = false;
    startActivityForResult(new Intent(context, PchaDemoPhg_Activity.class), EXIT_QUIT);
}

private void showMessageOKCancel(String message, DialogInterface.OnClickListener okListener)
{
    new AlertDialog.Builder(this)
            .setMessage(message)
            .setCancelable(false)
            .setPositiveButton("OK", okListener)
            .create()
            .show();
}

==============更新ANDROID 12和ActivityResultLauncher =======

有了Android 12,就会出现一组新的权限,我们不必再要求使用BTLE扫描仪的位置权限。THey还有一种处理活动结果的新方法,即ActivityResultLauncher,内置特性之一是运行时权限。下面是我现在用于从ANdroid 6+请求蓝牙扫描仪和后台权限的内容。我使用单权限启动程序在每个请求之前放置一个解释对话框。用户体验比我以前要好得多。(我包括字符串资源。)

代码语言:javascript
代码运行次数:0
运行
AI代码解释
复制
import android.Manifest;
import android.annotation.SuppressLint;
import android.content.pm.PackageManager;
import android.os.Build;
import android.os.Bundle;
import android.text.Html;
import android.util.Log;

import androidx.activity.result.ActivityResultCallback;
import androidx.activity.result.ActivityResultLauncher;
import androidx.activity.result.contract.ActivityResultContracts;
import androidx.appcompat.app.AlertDialog;
import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.ContextThemeWrapper;
import androidx.core.app.ActivityCompat;

import java.util.ArrayList;
import java.util.List;


/*
    resource strings used:
    <string name="permissions_connect_12">&lt;p&gt;This app needs permission to connect to Bluetooth devices&lt;/p&gt; </string>
    <string name="permissions_scan_12">&lt;p&gt;To search for Bluetooth devices this app needs permission to use the BLE scanner.&lt;/p&gt; </string>
    <string name="permissions_overlay_11">READ CAREFULLY! Setting permissions in Android 11+ is much more complicated!\n\n
        This app wants to popup a dialog when it discovers a PHD that it can work with.\n\n
        It needs Window-Overlay permissions to do that. Android will start a Settings system activity where it will list all the installed applications.\n\n
        You will need to scroll down to Health@Home PHG and tap it. That will bring you to the original pre-11 Settings system overlay permission activity.
        Give the permission and use the back arrow to exit. You will need use the back arrow once more to return to Health@Home.</string>
    <string name="permissions_location">&lt;p&gt;&lt;font color=\"#007700\"&gt;&lt;b&gt;LOCATION PERMISSION:&lt;/b&gt;&lt;/font&gt; Needs to be granted in order for this app to use the Bluetooth LE scanner.
        The scanner is needed to discover BLE health devices and know what they are.&lt;/p&gt;
        &lt;p&gt;&lt;font color=\"red\"&gt;&lt;b&gt;This app does NOT use location information or expose location information!&lt;/b&gt;&lt;/font&gt;
        Without this permission you will only be able to work with SPP and HDP devices.&lt;/p&gt;</string>
    <string name="permissions_background">&lt;p&gt;BACKGROUND PERMISSION: Needs to be granted for the Bluetooth LE Scanner to run in the background
        to support re-connection without user intervention.&lt;/p&gt;
        &lt;p&gt;Please select \'Allow all the time\'.&lt;/p&gt;</string>
 */
public class PermissionsActivity extends AppCompatActivity
{
    private final static String TAG = PermissionsActivity.class.getName();

    private final static boolean isVersionS_Plus = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S); // 31
    private final static boolean isVersionM_Plus = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M); // 23 (Marshmallow)
    private final static boolean isVersionN_Plus = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N);
    private static final boolean isVersionO_Plus = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O);
    private static final boolean isVersionR = (Build.VERSION.SDK_INT == Build.VERSION_CODES.R); // 30
    private static final boolean isVersionR_Plus = (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R); // 30
    private static final boolean isVersionOtoR = ((Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)  // 26
            && (Build.VERSION.SDK_INT <= Build.VERSION_CODES.R));  // 30


    private final List<String> permissionsList = new ArrayList<>();
    private final List<String> reasonList = new ArrayList<>();
    private int index = 0;  // Keeps track of what permission is being requested
    private int indexMax;   // The maximum number of permissions being asked for (set below)

    ActivityResultLauncher<String> activityResultLauncher =
            registerForActivityResult(new ActivityResultContracts.RequestPermission(), new ActivityResultCallback<Boolean>()
            {
                @Override
                public void onActivityResult(Boolean result)
                {
                    Log.d(TAG, "HH2: Permission " + permissionsList.get(index) + (result ? " granted" : "rejected"));
                    index++;
                    if (index >= indexMax)
                    {
                        handlePermissionSummary();
                    }
                    else
                    {
                        requestPermissions(index);
                    }
                }
            });

    @Override
    protected void onCreate(Bundle savedInstanceState)
    {
        super.onCreate(savedInstanceState);
        // too lazy to make a layout; your activity very likely has one!
        if (handlePermissions())
        {
            //setLoginScreen();  // Do what needs to be done after permissions are granted or if they already are granted
        }
    }

    // Method checks to see if the needed permissions are granted and if they are it returns true.
    // If they are not granted the method returns false but starts the process of asking the user to grant the permissions
    @SuppressLint("NewApi")
    private boolean handlePermissions()
    {
        if (isVersionS_Plus)  // Android 12 + (31+)  Completely new runtime permissions for Bluetooth in Android 12
        {                     // At least one no longer has to ask for location permissions for Bluetooth completely
                              // confusing the user.
            // Requesting BLUETOOTH_CONNECT, BLUETOOTH_SCAN, and ACCESS_BACKGROUND_LOCATION. The latter is still needed
            // to use the BTLE scanner in the background.

            // There is a weird bug in Android 12 with respect to the BLUETOOTH_CONNECT and BLUETOOTH_SCAN
            // permissions. If you need both, regardless of what order you ask for them in, you get only one
            // dialog from Android where the user grants the permission. But you have to ask for both permissions
            // (if you need both). See this bug: https://issuetracker.google.com/issues/214434187
            // Thus I skip the application dialog by making it empty for the second permission and just request
            // the permission. That way both permissions get granted.
            if (checkSelfPermission(Manifest.permission.BLUETOOTH_CONNECT) != PackageManager.PERMISSION_GRANTED)
            {
                permissionsList.add(Manifest.permission.BLUETOOTH_CONNECT);
                reasonList.add(getString(R.string.permissions_connect_12));
            }
            if (checkSelfPermission(Manifest.permission.BLUETOOTH_SCAN) != PackageManager.PERMISSION_GRANTED)
            {
                permissionsList.add(Manifest.permission.BLUETOOTH_SCAN);
                reasonList.add(""); // Work-a-round. If empty, present no dialog explaining the request to the user
                //reasonList.add(getString(R.string.permissions_scan_12));
            }
            if (checkSelfPermission(Manifest.permission.ACCESS_BACKGROUND_LOCATION) != PackageManager.PERMISSION_GRANTED)
            {
                permissionsList.add(Manifest.permission.ACCESS_BACKGROUND_LOCATION);
                reasonList.add(getString(R.string.permissions_background));
            }
            indexMax = 3; // Need three permissions
        }
        else if (isVersionM_Plus)
        {
            // Need location permissions to use the BTLE Scanner. Some versions of Android after 6 require FINE location and
            // some require only coarse and some both. TO minimize headache, I always ask for FINE and place COARSE location
            // in the Manifest file. That gives you use of the BTLE scanner for all pre-12 versions of Android
            if (checkSelfPermission(Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) // Android 6 +
            {
                permissionsList.add(Manifest.permission.ACCESS_FINE_LOCATION); // Require ACCESS_COARSE_LOCATION in Manifest file as well
                reasonList.add(getString(R.string.permissions_location));
                indexMax = 1;  // Need only one here
            }
            if (isVersionOtoR)  // Android 8 - 11. For these versions need BACKGROUND permission to use the scanner in the background.
            {
                if (checkSelfPermission(Manifest.permission.ACCESS_BACKGROUND_LOCATION) != PackageManager.PERMISSION_GRANTED)
                {
                    permissionsList.add(Manifest.permission.ACCESS_BACKGROUND_LOCATION);
                    reasonList.add(getString(R.string.permissions_background));
                    indexMax = 2;  // Need two permissions here
                }
            }
        }
        // If no permissions are needed, return true.
        if (permissionsList.size() == 0)
        {
            return true;
        }
        // Otherwise, begin the permission request sequence which involves launching permission requests.
        // The process is asynchronous, so the launch returns immediately.
        requestPermissions(index);
        return false;  // returning false indicates that permissions have not been granted and the request process is ongoing
    }

    // THis method pops up an application dialog explaining to the user why the application needs the requested permission.
    // When the user clicks OK, the permission request is launched. Android pops up whatever system action it dreams up to
    // handle the request. Sometimes it is a dialog, and sometimes it is an activity.
    // After the user responds, the result is returned in ActivityResultCallback above. The result is a boolean - true if
    // granted, false if not. Within the callback, the 'index' is checked. If there are more permissions to request,
    // this method is called again. If not, the summary method below is called.
    // It's ugly, but it is the only way I have been able to figure out how to place an explanation dialog before each
    // Android System action for the permission. Using the multiple permission approach I could not get my dialogs to
    // appear before each of the Android actions.
    @SuppressLint("NewApi")
    private void requestPermissions(int index)
    {
        if (reasonList.get(index).isEmpty()) // Work-a-round for Android 12. If explanation is empty then
        {
            // Skip explanation dialog but still request permission. Android pops up no dialog but auto-grants permission.
            activityResultLauncher.launch(permissionsList.get(index));
            return;
        }
        // Popup a dialog explaining why the app needs this permission and perhaps what Android is going to put you
        // through to grant the permission. For example, for BLUETOOTH_CONNECT/SCAN permissions Android pops up a
        // dialog. But for BACKGROUND permissions, Android presents an Activity. Exiting the dialog requires different
        // behavior from the user than exiting an activity.
        final androidx.appcompat.app.AlertDialog.Builder builder =
                new androidx.appcompat.app.AlertDialog.Builder(new ContextThemeWrapper(this, R.style.Theme_AppCompat_Light));
        builder.setTitle("Health@Home needs the following permission:");
        if (isVersionN_Plus)
        {
            builder.setMessage(Html.fromHtml(reasonList.get(index), Html.FROM_HTML_MODE_LEGACY));
        }
        else
        {
            builder.setMessage(Html.fromHtml(reasonList.get(index)));
        }
        builder.setPositiveButton(android.R.string.ok, null);
        builder.setOnDismissListener(dialog ->
        {
            Log.v(TAG, "HH2: Requesting permissions");
            activityResultLauncher.launch(permissionsList.get(index));
        });
        builder.show();
    }

    // THis method just summarizes the results of the permissions.
    @SuppressLint("NewApi")
    private void handlePermissionSummary()
    {
        boolean connectOk = (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_CONNECT) == PackageManager.PERMISSION_GRANTED);
        boolean scanOk = (ActivityCompat.checkSelfPermission(this, Manifest.permission.BLUETOOTH_SCAN) == PackageManager.PERMISSION_GRANTED);
        boolean locationOk = (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED);
        boolean backgroundOk = (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_BACKGROUND_LOCATION) == PackageManager.PERMISSION_GRANTED);

        Log.d(TAG, "HH2: BLUETOOTH_CONNECT Permissions are " + connectOk);
        Log.d(TAG, "HH2: BLUETOOTH_SCAN Permissions are " + scanOk);
        Log.d(TAG, "HH2: ACCESS_FINE_LOCATION Permissions are " + locationOk);
        Log.d(TAG, "HH2: ACCESS_BACKGROUND_LOCATION Permissions are " + backgroundOk);

        String message = "";
        if (!connectOk && isVersionS_Plus)
        {
            message = "<p><b>Bluetooth Connect permissions not given.</b> You will be unable to find and connect to Bluetooth Low Energy devices</p>";
        }
        if (!scanOk && isVersionS_Plus)
        {
            message = "<p><b>Bluetooth Scan permissions not given.</b> You will be unable to find and connect to Bluetooth Low Energy devices</p>";
        }
        if (!locationOk && !isVersionS_Plus)
        {
            message = "<p><b>Location permissions not given.</b> You will be unable to find and connect to Bluetooth Low Energy devices</p>";
        }
        if (!backgroundOk && isVersionO_Plus)
        {
            message = message + "<p><b>Background permissions not given.</b> Operations with Bluetooth Low Energy devices will only work " +
                    "while Health@Home PHG is visible on the screen.</p>";
        }
        if (!message.isEmpty())
        {
            message = message + "<p>Remedies:<br>1. Restart Health@Home PHG.<br>2. Set permissions directly in the Android Settings menu<br>" +
                    "3. Uninstall and re-install Health@Home PHG</p>";
            final AlertDialog.Builder builder =
                    new AlertDialog.Builder(new ContextThemeWrapper(this, R.style.Theme_AppCompat_Light));
            builder.setTitle("Health@Home not given certain permissions!");
            if (isVersionN_Plus)
            {
                builder.setMessage(Html.fromHtml(message, Html.FROM_HTML_MODE_LEGACY));
            }
            else
            {
                builder.setMessage(Html.fromHtml(message));
            }
            builder.setPositiveButton(android.R.string.ok, null);
            builder.setOnDismissListener(dialog ->
            {
                Log.d(TAG, "Starting Login");
               // setLoginScreen(); // Do whatever you would do after permissions are handled
            });
            builder.show();
            return;
        }
        Log.d(TAG, "Starting Login");
      //  setLoginScreen(); // Do whatever you would do after permissions are handled
    }
}
票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61909313

复制
相关文章
Python Numpy 从文件中读取数据
测试文件内容(test1.txt) hello,123,nihao 8,9,10 io,he,no 测试代码 import numpy # dtype:默认读取数据类型,delimiter:分隔符 world_alcohol = numpy.genfromtxt("test1.txt", dtype=str, delimiter=",") # 数据结构 print(type(world_alcohol)) # 数据内容 print(world_alcohol) # 帮助文档 print(help(nump
山海散人
2021/03/03
4.2K0
matlab读取mnist数据集(c语言从文件中读取数据)
mnist database(手写字符识别) 的数据集下载地:http://yann.lecun.com/exdb/mnist/。
全栈程序员站长
2022/08/01
5K0
matlab读取mnist数据集(c语言从文件中读取数据)
Java串口编程:串口数据的发送与监听读取「建议收藏」
本人在近期的开发工作中遇到向串口发送设备控制指令的需求,遂对串口编程进行了略微深入的钻研,在此对自己的一些心得和经验进行总结,以供大家参考与交流。 #串口介绍 #   串口全称为串行接口,一般指COM接口,是采用串行通信方式的扩展接口。其特点是数据位的传送按位顺序进行,最少只需一根传输线即可完成,成本低但传送速度慢。由于串口(COM)不支持热插拔及传输速率较低,目前部分新主板和大部分便携电脑已取消该接口。现在串口多用于工业控制和测量设备以及部分通信设备中。   根据美国电子工业协会(EIA: Electronic Industry Association)制定的标准,串口可以分为RS-232、RS-422以及RS-485等种类,其中以RS-232类型的接口最为典型和常见,本文所使用的是RS-232类型的9针串口(RS-232类型有25接口,但是现在几乎不再使用)。如图 1所示,是RS-232类型9针串口的实物示意图。RS-232类型9针串口每一个引脚的作用说明如图 2所示。
全栈程序员站长
2022/11/17
6.5K0
Java串口编程:串口数据的发送与监听读取「建议收藏」
用Pandas从HTML网页中读取数据
本文,我们将通过几步演示如何用Pandas的read_html函数从HTML页面中抓取数据。首先,一个简单的示例,我们将用Pandas从字符串中读入HTML;然后,我们将用一些示例,说明如何从Wikipedia的页面中读取数据。
老齐
2020/05/15
9.6K0
用Pandas从HTML网页中读取数据
VFP多线程读取串口
因为我要发送的指令很多,所以当时用方案二同步去读取,结果很卡。方法一倒没有试过,但COM口只支持16个。
加菲猫的VFP
2023/08/21
3280
VFP多线程读取串口
如何从 Ring Buffer 读取?
原文地址:http://mechanitis.blogspot.com/2011/06/dissecting-disruptor-how-do-i-read-from.html​​ 作者是 Trisha Gee, LMAX 公司的一位女工程师。 这是理解 LMAX​ 开发的 Disruptor 模式​ 系列博客的下一篇。 从 上一篇博客​ 我们都明白了什么是 Ring Buffer 以及 它有多棒。遗憾的是,我还没有提到当你实际使用 Disruptor 时,怎样读写数据。 ConsumerBarrier 与
张善友
2018/01/29
2K0
如何从 Ring Buffer 读取?
CAT客户端如何从Apollo中读取配置?
以下就是这个示例的运行环境,如果版本号不一样,区别也应该不会很大,可以根据实际情况做相应调整。
万猫学社
2022/04/22
3.7K0
CAT客户端如何从Apollo中读取配置?
【说站】Python中JSON数据如何读取
2、由直接从JSON文件读写的JSON函数组成。Python内置JSON包,是标准库的一部分,不需要安装。
很酷的站长
2022/11/24
2.1K0
【说站】Python中JSON数据如何读取
如何用R语言从网上读取多样格式数据
生活中,我们面临着各种各样的数据:比如你的成绩单,比如公司的财务报表,比如朋友圈的一些状态,比如微信里的一段语音……我们生活的大数据时代的一个重要特征便是数据的多样化(variety)。
机器学习AI算法工程
2018/03/14
7K0
如何用R语言从网上读取多样格式数据
如何同时从多个文本文件读取数据
在很多时候,需要对多个文件进行同样的或者相似的处理。例如,你可能会从多个文件中选择数据子集,根据多个文件计算像总计和平均值这样的统计量。当文件数量增加时,手动处理文件的可能性会减小,出错的概率会增加。
TalkPython
2019/05/24
3.9K0
如何用R语言从网上读取多样格式数据
生活中,我们面临着各种各样的数据:比如你的成绩单,比如公司的财务报表,比如朋友圈的一些状态,比如微信里的一段语音……我们生活的大数据时代的一个重要特征便是数据的多样化(variety)。 也许你期待的数据是这样的:
机器学习AI算法工程
2018/03/12
6.2K0
如何用R语言从网上读取多样格式数据
从天擎读取EC数据
最近我们在试用天擎,测试了从天擎读取EC数据,请求数据的程序来自天擎网站(见下图),数据传输的速度和稳定度都相当不错,尤其是可以按需求请求数据,避免了“一个馒头搭块糕”式的打包式下载数据对于时间和存储空间的极大浪费。请求江苏地区要素场时,数据基本秒出,感觉畅爽无比
郭好奇同学
2021/03/25
2K0
从天擎读取EC数据
如何使用python读取txt文件中的数据
发布者:全栈程序员栈长,转载请注明出处:https://javaforall.cn/139037.html原文链接:https://javaforall.cn
全栈程序员站长
2022/09/02
6.8K0
python从txt文件读取数据
  (作为一个python初学者,记录一点学习期间的笔记,方便日后查阅,若有错误或者更加便捷的方法,望指出!)
py3study
2020/01/19
3.9K0
python从txt文件读取数据
java pfx,如何从Java中的PFX文件读取公钥[通俗易懂]
I am able to read private key from PFX file but not public key. I am using following code to read public key.
全栈程序员站长
2022/08/14
4.7K0
如何从Node.js中的命令行读取输入
您是否正在使用Node.js中开发一个小的CLI工具,并希望能够提示用户从命令行输入输入? Node.js正是为此目的提供了readline模块。 它提供了一个接口,用于从可读流(例如process.stdin)中一次读取一行数据。
ccf19881030
2020/10/26
8.6K0
病态方程组
其精确解是x=1.0,y=0.0 。如图所示,点(1.0,0.0)是方程组所表示的两条直线的交点。
fem178
2019/07/17
1.1K0
病态方程组
实用:如何将aop中的pointcut值从配置文件中读取
改造老项目,须要加一个aop来拦截所的web Controller请求做一些处理,由于老项目比较多,且包的命名也不统一,又不想每个项目都copy一份相同的代码,这样会导致后以后升级很麻烦,不利于维护。于是我们想做成一个统一的jar包来给各项目引用,这样每个项目只须要引用该jar,然后配置对应的切面值就可以了。
Bug开发工程师
2019/12/09
24K1
如何读取单细胞数据
注:同方法二,如果没有 “all.datatable.txt” 的文件,也可忽略此步骤。这里只是提供多种情况下的读入方法。(想尝试的话,方法一有生成 “all.datatable.txt” 的代码,不过要注意路径。)
生信技能树jimmy
2020/06/23
5.4K0
点击加载更多

相似问题

从串口读取数据

50

从串口读取数据

10

从串口读取数据

31

如何从串口读取数据和向串口写入数据?

22

如何从串口读取GPS数据

122
添加站长 进交流群

领取专属 10元无门槛券

AI混元助手 在线答疑

扫码加入开发者社群
关注 腾讯云开发者公众号

洞察 腾讯核心技术

剖析业界实践案例

扫码关注腾讯云开发者公众号
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档
查看详情【社区公告】 技术创作特训营有奖征文