aidl

Android Aidl Compile Error: couldn't find import for class

社会主义新天地 提交于 2019-11-29 03:59:52
( I know there're multiple questions on stackoverflow and elsewhere (like google group) about adding parcelable for NetworkInfo but this is not about that. ) My work is under $(AOSP_ROOT)/device/ and involves multiple aidl files. one of it is like, package com.example; parcelable SomeRequest; And another aidl is like, package com.example; import com.example.SomeRequest; interface SomeService { SomeRequest getRequest(); } And I'll get compile errors like, device/somedevice/sdk/libs/aidl/com/example/SomeService.aidl:9: couldn't find import for class com.example.SomeRequest I'm wondering it is

aidl 详解

余生颓废 提交于 2019-11-29 01:34:48
aidl 是 android interface define language 的缩写,主要是作为进程间通讯的一个接口规范,这种通讯是一种普通的 client-server 的模式,对于 client 来说只需知道 aidl 即可,无需知道实现细节就能实现调用,之所以用 aidl 是因为系统可以自动完成 decompose/marshal 或者 serialize/unserialize 的工作。 对于 server 端主要是提供 service, 这个 service 可以是 started service, 也可以是 bound service,也可以两者兼具,started service 是一直运行的, bound service 如果不同时是 started service,那么只是在 client 调用 bindService 的时候被创建来提供服务,调用结束后就自动销毁了,对于 bound service 可以支持三种通讯方式,一是进程内通讯,这时不涉及 aidl,二是单线程通讯,这时通过 messenger,本质上也是 aidl 的方式,第三种是 aidl,这种是支持并发调用 service 的 来源: https://www.cnblogs.com/sky-view/p/11437843.html

Does oneway declaration in Android .aidl guarantee that method will be called in a separate thread?

随声附和 提交于 2019-11-28 21:41:36
问题 I am designing a framework for a client/server application for Android phones. I am fairly new to both Java and Android (but not new to programming in general, or threaded programming in particular). Sometimes my server and client will be in the same process, and sometimes they will be in different processes, depending on the exact use case. The client and server interfaces look something like the following: IServer.aidl: package com.my.application; interface IServer { /** * Register client

Example of AIDL use

大城市里の小女人 提交于 2019-11-28 19:06:06
to understand the AIDL in android, i want one real life example, means the at what scenario of development we need to use AIDL . by reading the Android Docs ... It puts me in confusion and so many question, so it is hard to read whole doc for me, can anyone help me is it for communicating with outside the phone. or to communicating with different apps, (why we need to communicate with other apps) what kind of service they are talking in docs AIDL is used for Binder. Binder is a mechanism to do RPC calls on/from an Android Service. When to use AIDL? When you need a Service. When do you need a

Android RemoteExceptions and Services

人盡茶涼 提交于 2019-11-28 17:54:09
So I've written a Service and an Activity for the Android OS. My service is running in it's own process, so all the communication between my Activities and the Service happens via IPC. I use the standard Android .aidl mechanism for this. So far everything works fine. However, the AIDL generates all method stubs using "throws RemoteException" so I have to handle them. I did a quick grep on the entire Android source-code and only found three cases where this exception is ever thrown. These are in a different service that I don't connect with. I checked the C-sources as well because in theory

Best way for Service that starts Activity to communicate with it

扶醉桌前 提交于 2019-11-28 07:54:57
问题 I have a service that listens to a socket. When receiving certain input it is to create an activity. When receiving other input, it is to kill this activity. I have struggled for a while to make the service communicate with the activity through AIDL (http://developer.android.com/guide/developing/tools/aidl.html), but this seems to not be effective. I think AIDL is only effective when the process that is to be talked to is a service, not when it is an activity? I would love some directions or

How can I use AIDL remote service to deal with defferent clients' concurrent requests?

Deadly 提交于 2019-11-28 04:53:57
问题 I'm writting a plug-in which defines a remote Service and provides a AIDL interface for 3rd party developers. How can I use this remote service to deal with defferent clients' concurrent requests? It is that service apk's activitys can keep status for each client, when they switched between each other, how to do it? 回答1: This can be achieved using HandlerThread with Looper which maintains and service all the request no matter received from 100 applications. For this AIDL callback interface is

AIDL unable to find the definition of a Parcelable class

荒凉一梦 提交于 2019-11-28 04:18:00
问题 I have the following project structure. My StockInfo.java is perfectly fine. StockInfo.java (No error) package org.yccheok.jstock.engine; import android.os.Parcel; import android.os.Parcelable; public class StockInfo implements Parcelable { ... ... StockInfo.aidl (No error) package org.yccheok.jstock.engine; parcelable StockInfo; StockInfoObserver.aidl (Error!) package org.yccheok.jstock.engine; interface StockInfoObserver { void update(StockInfo stockInfo); } AutoCompleteApi.aidl (Error!)

Android - Using method from a Service in an Activity?

佐手、 提交于 2019-11-28 03:24:45
I have the folowing method in a Service in my appplication: public void switchSpeaker(boolean speakerFlag){ if(speakerFlag){ audio_service.setSpeakerphoneOn(false); } else{ audio_service.setSpeakerphoneOn(true); } } So my question is whats the best and most effective way to be able to use this method in an Activity like follows final Button speaker_Button = (Button) findViewById(R.id.widget36); speaker_Button.setOnClickListener(new View.OnClickListener(){ public void onClick(View v){ switchSpeaker(true); //method from Service } }); Do I have to do an AIDL or is there a simpler way? You have to

The import android.os.ServiceManager cannot be resolved

女生的网名这么多〃 提交于 2019-11-28 00:30:28
I'm using aidl to answer call automagically, code as following: ITelephony.Stub.asInterface(ServiceManager.getService("phone")) .answerRingingCall(); I import ServiceManager.class import android.os.ServiceManager; but there's a problem:The import android.os.ServiceManager cannot be resolved How can I make it work? Thanks Chaitali android.os.ServiceManager is a hidden class (i.e., @hide ) and hidden classes (even if they are public in the Java sense) are removed from android.jar, hence you get the error when you try to import ServiceManager . Hidden classes are those that Google does not want