iis服务器助手广告
返回顶部
首页 > 资讯 > 精选 >Android无障碍服务performAction怎么调用
  • 398
分享到

Android无障碍服务performAction怎么调用

2023-07-02 10:07:55 398人浏览 泡泡鱼
摘要

这篇文章主要介绍“Android无障碍服务perforMaction怎么调用”,在日常操作中,相信很多人在Android无障碍服务perfORMAction怎么调用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答

这篇文章主要介绍“Android无障碍服务perforMaction怎么调用”,在日常操作中,相信很多人在Android无障碍服务perfORMAction怎么调用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”Android无障碍服务performAction怎么调用”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

无障碍服务可以模拟一些用户操作,无障碍可以处理的对象,通过类 AccessibilitynodeInfo 表示,通过无障碍服务,可以通过它的 performAction 方法来触发一些 action ,包括:

ACTION_FOCUS // 获取焦点ACTION_CLEAR_FOCUS // 清除焦点ACTION_SELECT // 选中ACTION_CLEAR_SELECTION // 清除选中状态ACTION_ACCESSIBILITY_FOCUS // 无障碍焦点ACTION_CLEAR_ACCESSIBILITY_FOCUS // 清除无障碍焦点ACTION_CLICK // 点击ACTION_LONG_CLICK // 长按ACTION_NEXT_AT_MOVEMENT_GRANULARITY // 下一步移动ACTION_PREVIOUS_AT_MOVEMENT_GRANULARITY // 上一步移动ACTION_NEXT_html_ELEMENT // 下一个 html 元素ACTION_PREVIOUS_HTML_ELEMENT // 上一个 html 元素ACTION_SCROLL_FORWARD // 向前滑动ACTION_SCROLL_BACKWARD // 向后滑动

他们都可以通过performAction方法进行处理:

// in AccessibilityNodeInfopublic boolean performAction(int action) {    enforceSealed();    if (!canPerformRequestOverConnection(mConnectionId, mWindowId, mSourceNodeId)) {        return false;    }    AccessibilityInteractionClient client = AccessibilityInteractionClient.getInstance();    return client.performAccessibilityAction(mConnectionId, mWindowId, mSourceNodeId,            action, null);}

在这个方法中,第一步是检查 perform 是否可以通过 connection 请求,这里 connection 检查是根据通过 binder 通信传递过来的 id 检查连接是否正常。 然后通过AccessibilityInteractionClient对象,调用它的performAccessibilityAction方法去进行实际操作的。

AccessibilityInteractionClient

这个类是一个执行可访问性交互的单例,它可以根据 View 的快照查询远程的 View 层次结构,以及通过 View 层次结构,来请求对 View 执行某项操作。

基本原理:内容检索 api 从客户端的角度来看是同步的,但在内部它们是异步的。客户端线程调用系统请求操作并提供回调以接收结果,然后等待该结果的超时。系统强制执行安全性并将请求委托给给定的视图层次结构, 在该视图层次结构中发布消息(来自 Binder 线程),描述 UI 线程要执行的内容,其结果是通过上述回调传递的。但是,被阻塞的客户端线程和目标视图层次结构的主 UI 线程可以是同一个线程,例如无障碍服务和 Activity 在同一个进程中运行,因此它们在同一个主线程上执行。 在这种情况下,检索将会失败,因为 UI 线程在等待检索结果,会导致阻塞。 为了避免在进行调用时出现这种情况,客户端还会传递其进程和线程 ID,以便访问的视图层次结构可以检测发出请求的客户端是否正在其主 UI 线程中运行。 在这种情况下,视图层次结构,特别是对它执行 IPC 的绑定线程,不会发布要在 UI 线程上运行的消息,而是将其传递给单例交互客户端,通过该客户端发生所有交互,后者负责执行开始等待通过回调传递的异步结果之前的消息。在这种情况下,已经收到预期的结果,因此不执行等待。

上面是官方备注的描述,大概意思最好不要在主线程执行检索操作。

继续跟进它的performAccessibilityAction方法:

    public boolean performAccessibilityAction(int connectionId, int accessibilityWindowId,            long accessibilityNodeId, int action, Bundle arguments) {        try {            IAccessibilityServiceConnection connection = getConnection(connectionId);            if (connection != null) {                final int interactionId = mInteractionIdCounter.getAndIncrement();                final long identityToken = Binder.clearCallingIdentity();                final boolean success;                try {                    success = connection.performAccessibilityAction(                            accessibilityWindowId, accessibilityNodeId, action, arguments,                            interactionId, this, Thread.currentThread().getId()); // 【*】                } finally {                    Binder.restoreCallingIdentity(identityToken);                }                if (success) {                    return getPerformAccessibilityActionResultAndClear(interactionId);                }            }        } catch (RemoteException re) {            Log.w(LOG_TAG, "Error while calling remote performAccessibilityAction", re);        }        return false;    }

这里通过 getConnection(connectionId) 获取了一个 IAccessibilityServiceConnection 。

public static IAccessibilityServiceConnection getConnection(int connectionId) {    synchronized (sConnectionCache) {        return sConnectionCache.get(connectionId);    }}

这里的 sConnectionCache 通过 AccessibilityInteractionClient 的addConnection添加数据的,addConnection在 AccessbilityService 创建初始化时调用的:

case DO_INIT: {    mConnectionId = message.arg1;    SomeArgs args = (SomeArgs) message.obj;    IAccessibilityServiceConnection connection = (IAccessibilityServiceConnection) args.arg1;    IBinder windowToken = (IBinder) args.arg2;    args.recycle();    if (connection != null) {        AccessibilityInteractionClient.getInstance(mContext).addConnection(mConnectionId, connection);        mCallback.init(mConnectionId, windowToken);        mCallback.onServiceConnected();    } else {        AccessibilityInteractionClient.getInstance(mContext).removeConnection(mConnectionId);        mConnectionId = AccessibilityInteractionClient.NO_ID;        AccessibilityInteractionClient.getInstance(mContext).clearCache();        mCallback.init(AccessibilityInteractionClient.NO_ID, null);    }    return;}

也就是说,在 AccessbilityService 创建时,会将一个表示连接的对象存到 AccessibilityInteractionClient 的连接缓存中。

IAccessibilityServiceConnection

它是 AccessibilityManagerService 向 AccessbilityService 暴露的 aiDL 接口,提供给 AccessbilityService 调用AccessibilityManagerService 的能力。 上面的 performAction 流程中,调用到了 connection 的performAccessibilityAction方法。 而 IAccessibilityServiceConnection 有两个实现类,AccessibilityServiceConnectionImplAbstractAccessibilityServiceConnection,前者都是空实现,显然不是我们要调用到的地方,后者的performAccessibilityAction

@Overridepublic boolean performAccessibilityAction(int accessibilityWindowId,        long accessibilityNodeId, int action, Bundle arguments, int interactionId,        IAccessibilityInteractionConnectionCallback callback, long interrogatingTid)        throws RemoteException {    final int resolvedWindowId;    synchronized (mLock) {        if (!hasRightsToCurrentUserLocked()) {            return false;        }        resolvedWindowId = resolveAccessibilityWindowIdLocked(accessibilityWindowId);        if (!mSecurityPolicy.canGetAccessibilityNodeInfoLocked(                mSystemSupport.getCurrentUserIdLocked(), this, resolvedWindowId)) {            return false;        }    }    if (!mSecurityPolicy.checkAccessibilityAccess(this)) {        return false;    }    return performAccessibilityActionInternal(            mSystemSupport.getCurrentUserIdLocked(), resolvedWindowId, accessibilityNodeId,            action, arguments, interactionId, callback, mFetchFlags, interrogatingTid);}

最后的一行调用:

    private boolean performAccessibilityActionInternal(int userId, int resolvedWindowId, long accessibilityNodeId, int action, Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, int fetchFlags, long interrogatingTid) {        RemoteAccessibilityConnection connection;        IBinder activityToken = null;        // 同步获取 connection        synchronized (mLock) {            connection = mA11yWindowManager.getConnectionLocked(userId, resolvedWindowId);            if (connection == null)  {                return false;            }            final boolean isA11yFocusAction = (action == ACTION_ACCESSIBILITY_FOCUS) || (action == ACTION_CLEAR_ACCESSIBILITY_FOCUS);            if (!isA11yFocusAction) {                final WindowInfo windowInfo = mA11yWindowManager.findWindowInfoByIdLocked(resolvedWindowId);                if (windowInfo != null) activityToken = windowInfo.activityToken;            }            final AccessibilityWindowInfo a11yWindowInfo = mA11yWindowManager.findA11yWindowInfoByIdLocked(resolvedWindowId);            if (a11yWindowInfo != null && a11yWindowInfo.isInPictureInPictureMode() && mA11yWindowManager.getPictureInPictuReactionReplacinGConnection() != null && !isA11yFocusAction) {                connection = mA11yWindowManager.getPictureInPictureActionReplacingConnection();            }        }        // 通过 connection 调用到远程服务的performAccessibilityAction        final int interrogatingPid = Binder.getCallingPid();        final long identityToken = Binder.clearCallingIdentity();        try {            // 无论操作是否成功,它都是由用户操作的无障碍服务生成的,因此请注意用户Activity。            mPowerManager.userActivity(SystemClock.uptimeMillis(), PowerManager.USER_ACTIVITY_EVENT_ACCESSIBILITY, 0);            if (action == ACTION_CLICK || action == ACTION_LONG_CLICK) {                mA11yWindowManager.notifyOutsideTouch(userId, resolvedWindowId);            }            if (activityToken != null) {                LocalServices.getService(ActivityTaskManagerInternal.class).setFocusedActivity(activityToken);            }            connection.getRemote().performAccessibilityAction(accessibilityNodeId, action, arguments, interactionId, callback, fetchFlags, interrogatingPid, interrogatingTid);        } catch (RemoteException re) {            if (DEBUG) {                Slog.e(LOG_TAG, "Error calling performAccessibilityAction: " + re);            }            return false;        } finally {            Binder.restoreCallingIdentity(identityToken);        }        return true;    }

在这个方法中,通过 connection 调用到了远端的 performAccessibilityAction 方法。

关键的一行是:

connection.getRemote().performAccessibilityAction(accessibilityNodeId, action, arguments, interactionId, callback, fetchFlags, interrogatingPid, interrogatingTid);

这里的 connection 类型定义成了RemoteAccessibilityConnection

RemoteAccessibilityConnection

RemoteAccessibilityConnection 是AccessibilityWindowManager的内部类,它的getRemote()返回类型是IAccessibilityInteractionConnection

AccessibilityWindowManager

此类为 AccessibilityManagerService 提供 API 来管理 AccessibilityWindowInfo 和 WindowInfos。

IAccessibilityInteractionConnection

这是一个 AIDL 中定义的接口,用来进行 给定 window 中 AccessibilityManagerService 和 ViewRoot 之间交互的接口。

也就是说getRemote(). performAccessibilityAction(...)最终来到了 ViewRootImpl 中。

AccessibilityInteractionConnection

ViewRootImpl 中存在一个内部类AccessibilityInteractionConnection,它是这个 ViewAncestor 提供给 AccessibilityManagerService 的一个接口,后者可以与这个 ViewAncestor 中的视图层次结构进行交互。

它的performAccessibilityAction实现是:

@Overridepublic void performAccessibilityAction(long accessibilityNodeId, int action, Bundle arguments, int interactionId, IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid, long interrogatingTid) {    ViewRootImpl viewRootImpl = mViewRootImpl.get();    if (viewRootImpl != null && viewRootImpl.mView != null) {        viewRootImpl.getAccessibilityInteractionController().performAccessibilityActionClientThread(accessibilityNodeId, action, arguments,                    interactionId, callback, flags, interrogatingPid, interrogatingTid);    } else {        // We cannot make the call and notify the caller so it does not wait.        try {            callback.setPerformAccessibilityActionResult(false, interactionId);        } catch (RemoteException re) {                    }    }}

内部又是通过代理调用 ,ViewRootImpl 的 getAccessibilityInteractionController() 返回了一个 AccessibilityInteractionController 对象。

AccessibilityInteractionController

它的 performAccessibilityActionClientThread :

public void performAccessibilityActionClientThread(long accessibilityNodeId, int action,        Bundle arguments, int interactionId,        IAccessibilityInteractionConnectionCallback callback, int flags, int interrogatingPid,        long interrogatingTid) {    Message message = mHandler.obtainMessage();    message.what = PrivateHandler.MSG_PERFORM_ACCESSIBILITY_ACTION;    message.arg1 = flags;    message.arg2 = AccessibilityNodeInfo.getAccessibilityViewId(accessibilityNodeId);    SomeArgs args = SomeArgs.obtain();    args.argi1 = AccessibilityNodeInfo.getVirtualDescendantId(accessibilityNodeId);    args.argi2 = action;    args.argi3 = interactionId;    args.arg1 = callback;    args.arg2 = arguments;    message.obj = args;    scheduleMessage(message, interrogatingPid, interrogatingTid, CONSIDER_REQUEST_PREPARERS);}

组装了一个 message ,并通过 scheduleMessage 方法去执行:

private void scheduleMessage(Message message, int interrogatingPid, long interrogatingTid, boolean ignoreRequestPreparers) {    if (ignoreRequestPreparers || !holdOffMessageIfNeeded(message, interrogatingPid, interrogatingTid)) {        if (interrogatingPid == mMyProcessId && interrogatingTid == mMyLooperThreadId                && mHandler.hasAccessibilityCallback(message)) {            AccessibilityInteractionClient.getInstanceForThread(                    interrogatingTid).setSameThreadMessage(message);        } else {            if (!mHandler.hasAccessibilityCallback(message) && Thread.currentThread().getId() == mMyLooperThreadId) {                mHandler.handleMessage(message);            } else {                mHandler.sendMessage(message);            }        }    }}

这里实际上,如果是在主线程,则处理消息,如果不是,则发送消息到主线程处理。handler 的类型是 PrivateHandler ,在 AccessibilityInteractionController 内部定义。

它的处理消息方法的实现是:

@Overridepublic void handleMessage(Message message) {    final int type = message.what;    switch (type) {        // ...        case MSG_PERFORM_ACCESSIBILITY_ACTION: {            performAccessibilityActionUiThread(message);        } break;        // ...        default:            throw new IllegalArgumentException("Unknown message type: " + type);    }}

执行到了 performAccessibilityActionUiThread(message); :

    private void performAccessibilityActionUiThread(Message message) {        // ...         boolean succeeded = false;        try {            // ...            final View target = findViewByAccessibilityId(accessibilityViewId);            if (target != null && isshown(target)) {                mA11yManager.notifyPerformingAction(action);                if (action == R.id.accessibilityActionClickOnClickableSpan) {                    // 单独处理这个 hidden action                    succeeded = handleClickableSpanActionUiThread(target, virtualDescendantId, arguments);                } else {                    AccessibilityNodeProvider provider = target.getAccessibilityNodeProvider();                    if (provider != null) {                        succeeded = provider.performAction(virtualDescendantId, action, arguments);                    } else if (virtualDescendantId == AccessibilityNodeProvider.HOST_VIEW_ID) {                        succeeded = target.performAccessibilityAction(action, arguments);                    }                }                mA11yManager.notifyPerformingAction(0);            }        } finally {            try {                mViewRootImpl.mAttachInfo.mAccessibilityFetchFlags = 0;                callback.setPerformAccessibilityActionResult(succeeded, interactionId);            } catch (RemoteException re) {                            }        }    }

在这个流程中,分为三种情况去真正执行 performAction :

1. action == R.id.accessibilityActionClickOnClickableSpan

private boolean handleClickableSpanActionUiThread(        View view, int virtualDescendantId, Bundle arguments) {    Parcelable span = arguments.getParcelable(ACTION_ARGUMENT_ACCESSIBLE_CLICKABLE_SPAN);    if (!(span instanceof AccessibilityClickableSpan)) {        return false;    }    // Find the original ClickableSpan if it's still on the screen    AccessibilityNodeInfo infoWithSpan = null;    AccessibilityNodeProvider provider = view.getAccessibilityNodeProvider();    if (provider != null) {        infoWithSpan = provider.createAccessibilityNodeInfo(virtualDescendantId);    } else if (virtualDescendantId == AccessibilityNodeProvider.HOST_VIEW_ID) {        infoWithSpan = view.createAccessibilityNodeInfo();    }    if (infoWithSpan == null) {        return false;    }    // Click on the corresponding span    ClickableSpan clickableSpan = ((AccessibilityClickableSpan) span).findClickableSpan(            infoWithSpan.getOriginalText());    if (clickableSpan != null) {        clickableSpan.onClick(view);        return true;    }    return false;}

2. View. AccessibilityNodeProvider != null

当能够通过 View 获取到 AccessibilityNodeProvider 对象是,通过它的 performAction 方法,去执行真正的调用,它的真正调用在 AccessibilityNodeProviderCompat中,这个 Compat 的实现在ExploreByTouchHelper中的内部类MyNodeProvider中:

@Overridepublic boolean performAction(int virtualViewId, int action, Bundle arguments) {    return ExploreByTouchHelper.this.performAction(virtualViewId, action, arguments);}

在 ExploreByTouchHelper 中继续查看:

boolean performAction(int virtualViewId, int action, Bundle arguments) {    switch (virtualViewId) {        case HOST_ID:            return performActionForHost(action, arguments);        default:            return performActionForChild(virtualViewId, action, arguments);    }}
private boolean performActionForHost(int action, Bundle arguments) {    return ViewCompat.performAccessibilityAction(mHost, action, arguments);}private boolean performActionForChild(int virtualViewId, int action, Bundle arguments) {    switch (action) {        case AccessibilityNodeInfoCompat.ACTION_ACCESSIBILITY_FOCUS:            return requestAccessibilityFocus(virtualViewId);        case AccessibilityNodeInfoCompat.ACTION_CLEAR_ACCESSIBILITY_FOCUS:            return clearAccessibilityFocus(virtualViewId);        case AccessibilityNodeInfoCompat.ACTION_FOCUS:            return requesTKEyboardFocusForVirtualView(virtualViewId);        case AccessibilityNodeInfoCompat.ACTION_CLEAR_FOCUS:            return clearKeyboardFocusForVirtualView(virtualViewId);        default:            return onPerformActionForVirtualView(virtualViewId, action, arguments);    }}

前者调用到了 ViewCompat :

public static boolean performAccessibilityAction(@NonNull View view, int action,        Bundle arguments) {    if (Build.VERSION.SDK_INT >= 16) {        return view.performAccessibilityAction(action, arguments);    }    return false;}

然后是 View 的 :

public boolean performAccessibilityAction(int action, Bundle arguments) {  if (mAccessibilityDelegate != null) {      return mAccessibilityDelegate.performAccessibilityAction(this, action, arguments);  } else {      return performAccessibilityActionInternal(action, arguments);  }}

mAccessibilityDelegate.performAccessibilityAction的实现是:

public boolean performAccessibilityAction(View host, int action, Bundle args) {    return host.performAccessibilityActionInternal(action, args);}

也是调用到了 View 的performAccessibilityActionInternal 。 performAccessibilityActionInternal 的实现是:

// in View.javapublic boolean performAccessibilityActionInternal(int action, Bundle arguments) {    if (isNestedScrollingEnabled()            && (action == AccessibilityNodeInfo.ACTION_SCROLL_BACKWARD            || action == AccessibilityNodeInfo.ACTION_SCROLL_FORWARD            || action == R.id.accessibilityActionScrollUp            || action == R.id.accessibilityActionScrollLeft            || action == R.id.accessibilityActionScrollDown            || action == R.id.accessibilityActionScrollRight)) {        if (dispatchNestedPrePerformAccessibilityAction(action, arguments)) {            return true;        }    }    switch (action) {        case AccessibilityNodeInfo.ACTION_CLICK: {            if (isClickable()) {                performClickInternal();                return true;            }        } break;        case AccessibilityNodeInfo.ACTION_LONG_CLICK: {            if (isLongClickable()) {                performLongClick();                return true;            }        } break;        // ...    }    return false;}

以 AccessibilityNodeInfo.ACTION_CLICK 为例,内部调用是:

private boolean performClickInternal() {    // Must notify autofill manager before performing the click actions to avoid scenariOS where    // the app has a click listener that changes the state of views the autofill service might    // be interested on.    notifyAutofillManagerOnClick();    return performClick();}

这样就调用到了 View 的点击事件。

3. View. AccessibilityNodeProvider == null && virtualDescendantId == AccessibilityNodeProvider.HOST_VIEW_ID

target.performAccessibilityAction(action, arguments);

这里 target 是个 View, 也是走的 View 的 performAccessibilityAction ,和上面流程一样。

View 的 performClick 方法是同步的还是异步的?

public boolean performClick() {    // We still need to call this method to handle the cases where performClick() was called    // externally, instead of through performClickInternal()    notifyAutofillManagerOnClick();    final boolean result;    final ListenerInfo li = mListenerInfo;    if (li != null && li.mOnClickListener != null) {        playSoundEffect(SoundEffectConstants.CLICK);        li.mOnClickListener.onClick(this);        result = true;    } else {        result = false;    }    sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_CLICKED);    notifyEnterOrExitForAutoFillIfNeeded(true);    return result;}

同步的。

到此,关于“Android无障碍服务performAction怎么调用”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注编程网网站,小编会继续努力为大家带来更多实用的文章!

--结束END--

本文标题: Android无障碍服务performAction怎么调用

本文链接: https://www.lsjlt.com/news/341163.html(转载时请注明来源链接)

有问题或投稿请发送至: 邮箱/279061341@qq.com    QQ/279061341

本篇文章演示代码以及资料文档资料下载

下载Word文档到电脑,方便收藏和打印~

下载Word文档
猜你喜欢
  • Android无障碍服务performAction怎么调用
    这篇文章主要介绍“Android无障碍服务performAction怎么调用”,在日常操作中,相信很多人在Android无障碍服务performAction怎么调用问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答...
    99+
    2023-07-02
  • Android 无障碍服务 performAction 调用过程分析
    目录View 的 performClick 方法是同步的还是异步的?总结无障碍服务可以模拟一些用户操作,无障碍可以处理的对象,通过类 AccessibilityNodeInfo 表示...
    99+
    2024-04-02
  • android无障碍服务功能怎么实现
    Android无障碍服务功能可以通过编写无障碍服务来实现。以下是实现无障碍服务功能的一般步骤:1. 创建一个继承自Accessibi...
    99+
    2023-10-07
    android
  • Android无障碍监听通知怎么实现
    本篇内容主要讲解“Android无障碍监听通知怎么实现”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“Android无障碍监听通知怎么实现”吧!监听通知Android 中的 Accessibili...
    99+
    2023-07-02
  • flutter flutter_accessibility_service无障碍服务
    flutter_accessibility_service a plugin for interacting with Accessibility Service in Android. Accessibility services are...
    99+
    2023-08-24
    flutter android
  • Android 应用自动开启辅助(无障碍)功能并使用辅助(无障碍)功能
    目录 一.背景 二.前提条件 三.将普通应用转换成系统应用 1.在AndroidManifest文件中添加来源地址:https://blog.csdn.net/gongjdde/article/details/131431675...
    99+
    2023-09-10
    pycharm ide python
  • Android实现自动点击无障碍服务功能的实例代码
    ps: 不想看代码的滑到最下面有apk包百度网盘下载地址 1. 先看效果图 不然都是耍流氓 2.项目目录 3.一些配置 build.gradle plugins { ...
    99+
    2024-04-02
  • 消除服务器硬件标准化障碍:实用技巧
    克服兼容性障碍 定义清晰的规范:制定涵盖关键特性(如处理器、内存、存储和网络)的详细规范。这将确保不同供应商的服务器相互兼容。 测试和认证:在采购前对服务器进行全面的测试和认证,以验证它们是否符合规范。考虑使用行业认证组织,如SPEC...
    99+
    2024-02-28
    服务器标准化 硬件障碍 兼容性 供应链管理 成本优化
  • android怎么调用api接口
    在Android中,可以使用HttpClient或者HttpURLConnection来调用API接口。使用HttpClient调用...
    99+
    2023-08-25
    android
  • android怎么调用unity界面
    要在Android上调用Unity界面,首先需要在Android项目中集成Unity库。以下是一种常见的方法:1. 在Unity中,选择“File” -> “Build Settings”。2. 在弹出的对话框中,选择“Android”...
    99+
    2023-08-11
    android unity
  • 怎么在Android中调用WebService
    怎么在Android中调用WebService?针对这个问题,这篇文章详细介绍了相对应的分析和解答,希望可以帮助更多想解决这个问题的小伙伴找到更简单易行的方法。WebService是一种基于SOAP协议的远程调用标准,通过webservic...
    99+
    2023-05-30
    android webservice
  • android怎么调用activity方法
    要调用一个Activity的方法,首先需要获取Activity的实例,然后通过该实例来调用方法。以下是一种常用的方法调用方式:1. ...
    99+
    2023-09-16
    activity android
  • Android无需权限调用系统相机拍照怎么实现
    这篇“Android无需权限调用系统相机拍照怎么实现”文章的知识点大部分人都不太理解,所以小编给大家总结了以下内容,内容详细,步骤清晰,具有一定的借鉴价值,希望大家阅读完这篇文章能有所收获,下面我们一起来看看这篇“Android无需权限调用...
    99+
    2023-07-05
  • Android无需权限调起系统相机怎么实现
    这篇文章主要讲解了“Android无需权限调起系统相机怎么实现”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习“Android无需权限调起系统相机怎么实现”吧!在进行一些小型APP的开发,或者是...
    99+
    2023-07-05
  • android中怎么调用timer.cancel函数
    在Android中,可以通过以下步骤调用Timer的cancel()函数: 首先,创建一个Timer对象。例如: Timer t...
    99+
    2024-02-29
    android
  • Android startActivityForResult怎么调用与封装
    今天小编给大家分享一下Android startActivityForResult怎么调用与封装的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获...
    99+
    2023-07-05
  • Android怎么调用外部xml布局
    要调用外部的xml布局,可以使用LayoutInflater来动态加载布局文件。具体步骤如下: 在你想要调用外部xml布局的Ac...
    99+
    2023-10-24
    Android
  • javascript无法调用cab怎么解决
    今天小编给大家分享一下javascript无法调用cab怎么解决的相关知识点,内容详细,逻辑清晰,相信大部分人都还太了解这方面的知识,所以分享这篇文章给大家参考一下,希望大家阅读完这篇文章后有所收获,下面我们一起来了解一下吧。在 HTML ...
    99+
    2023-07-06
  • 云服务器怎么调用
    云服务器可以通过以下步骤进行调用:1. 登录云服务器的管理控制台。这通常需要使用您的云服务提供商提供的用户名和密码进行身份验证。2....
    99+
    2023-09-27
    云服务器
  • Android中surfacecreated调用问题怎么解决
    在Android中,SurfaceCreated是SurfaceView生命周期的一个回调方法,它在SurfaceView第一次创建...
    99+
    2024-02-29
    Android
软考高级职称资格查询
编程网,编程工程师的家园,是目前国内优秀的开源技术社区之一,形成了由开源软件库、代码分享、资讯、协作翻译、讨论区和博客等几大频道内容,为IT开发者提供了一个发现、使用、并交流开源技术的平台。
  • 官方手机版

  • 微信公众号

  • 商务合作