[英]AIDL Service and Android Open Source
I've created an AIDL service called IHelloService and I am trying to call it from IOBridge under the libcore module. 我创建了一个名为IHelloService的AIDL服务,并且尝试从libcore模块下的IOBridge调用它。
Currently my code looks like this 目前我的代码看起来像这样
// import
import android.os.IHelloService;
import android.os.ServiceManager;
....
IHelloService helloService = IHelloService.Stub.asInterface(ServiceManager.getService("hello"));
int val = helloService.getVal();
I run into errors when doing a standard build. 在进行标准构建时遇到错误。 The errors include package android.os does not exist
and cannot find symbol ServiceManager
and IHelloService
错误包括package android.os does not exist
并且cannot find symbol ServiceManager
和IHelloService
I've already declared package android.os
in the HelloService aidl file, so I don't think that's the issue. 我已经在HelloService aidl文件中声明了package android.os
,所以我认为这不是问题。
Any help would be appreciated. 任何帮助,将不胜感激。
Sang, 桑
Your issue is actually one I have been working through. 您的问题实际上是我一直在努力解决的问题。 What you need to do is build a new SDK for use with that specific service so that Android Studio (I am assuming that is what you are using) can recognize it as being available in your version of the ROM. 您需要做的是构建一个可与该特定服务一起使用的新SDK,以便Android Studio(我假设您正在使用的)可以将其识别为您的ROM版本中可用的。
Here is what you should do: (found at https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt ) 这是您应该执行的操作:(位于https://android.googlesource.com/platform/sdk/+/master/docs/howto_build_SDK.txt )
Now that the SDK is made, you will need to point Android Studio to the new SDK. 制作完SDK后,您需要将Android Studio指向新的SDK。 TO do this: 去做这个:
There might be other ways to do this, but that is the process I am working with currently. 可能还有其他方法可以做到这一点,但这就是我目前正在使用的过程。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.