aidl

Android remote service callbacks

拜拜、爱过 提交于 2019-11-27 20:17:11
(I have a remote service with an AIDL interface that is used by several client apps. I would like to add an asynchronous method to the interface for calls that take some time, but I need the solution to be secure , meaning that only my applications can communicate with the service. The client applications are signed with the same signature as the service app. Currently the apps just bind to the service and call a single interface method to perform various operations. One option is broadcasting an Intent from the service when the operation is complete and using a BroadcastReceiver in the client

Why ITelephony.aidl works?

佐手、 提交于 2019-11-27 10:37:19
I saw some SO posts which discussed about how to end a phone call programmtically, for example, this one . Yep, people focus on the result but no one actually explain the reason why it works? I tried the code, it works well. But I would like to know more details about what is going on underneath? Why by creating the ITelephony.aidl , the android hidden internal ITelephony interface is exposed in our project? How does ourself created ITelephony.aidl & the automatically generated java (/gen/ITelephony.java) link to android's ITelephony interface? Is it only because of the name matching (package

Android - Using method from a Service in an Activity?

穿精又带淫゛_ 提交于 2019-11-27 05:09:25
问题 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){

Android remote service callbacks

那年仲夏 提交于 2019-11-27 04:26:06
问题 (I have a remote service with an AIDL interface that is used by several client apps. I would like to add an asynchronous method to the interface for calls that take some time, but I need the solution to be secure , meaning that only my applications can communicate with the service. The client applications are signed with the same signature as the service app. Currently the apps just bind to the service and call a single interface method to perform various operations. One option is

bindService和AIDL的简单应用例子

隐身守侯 提交于 2019-11-27 03:37:34
1.Service不是一个单独的进程,它和它的应用程序在同一个进程中 2.Service不是一个线程,这样就意味着我们应该避免在Service中进行耗时操作 话不多说,我们直接上代码,是bingService启动service的,startService暂时先不上了。。。。。通过bindservice可以使service和avtivity通信。。。 首先创建一个TestServiceOne继承Service; public class TestServiceOne extends Service { private static final String TAG = "TestServiceOne"; private int count; private boolean quit; private MyBinder binder = new MyBinder(); public class MyBinder extends Binder{ public int getCount(){ return count; } } @Override public IBinder onBind(Intent intent) { Log.i(TAG, "onBind方法被调用!"); return binder; } @Override public void onCreate(){ super

Example of AIDL use

吃可爱长大的小学妹 提交于 2019-11-27 01:18:31
问题 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 回答1: AIDL is used for Binder. Binder is a mechanism

The import android.os.ServiceManager cannot be resolved

醉酒当歌 提交于 2019-11-26 21:44:04
问题 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 回答1: 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

how can I add the aidl file to Android studio (from the in-app billing example)

那年仲夏 提交于 2019-11-26 18:26:22
I am currently migrating an Eclipse app to Android Studio. This app was using the in app billing. My main problem is to compile the project and the aidl file (I guess you all use this file ) I get this error message: Gradle: error: cannot find symbol class IInAppBillingService Gradle: error: package IInAppBillingService does not exist So, following some tutorials, I move this file from com.mypackage.billing to src/main/aidl (see this reference ) But as soon, as I do that, I get this message: Gradle: Execution failed for task ':xxxxxxxxxxx:compileDebugAidl'. Failed to run command: (...) C:

Android Service讲解 和 aidl 实现

谁说胖子不能爱 提交于 2019-11-26 15:29:16
Android Service讲解 和 aidl 实现 代码下载 Android Service讲解 和 aidl 实现 一、Android Service 1.建立一个service service和activity很相识,只是service在后台运行,activity在前台运行,他们都属于同一个同一个线程里,都属于UI线程,所以service和Thread是完全不一样的东西。一些耗时的操作在Service里运行也要开辟新的线程。 新建一个自己的service,只需要继承系统Service就行了,看下面代码: public class AIDLService extends Service { private static final String TAG = "AIDLService" ; @Override public void onCreate () { super .onCreate(); Log.i(TAG, "onCreate() called" ); } @Override public int onStartCommand (Intent intent, int flags, int startId) { Log.i(TAG, "onStartCommand() called" ); return super .onStartCommand(intent,

Why ITelephony.aidl works?

。_饼干妹妹 提交于 2019-11-26 15:16:19
问题 I saw some SO posts which discussed about how to end a phone call programmtically, for example, this one. Yep, people focus on the result but no one actually explain the reason why it works? I tried the code, it works well. But I would like to know more details about what is going on underneath? Why by creating the ITelephony.aidl , the android hidden internal ITelephony interface is exposed in our project? How does ourself created ITelephony.aidl & the automatically generated java (/gen