aidl

Conversion to Dalvik format failed with error 1 - Why?

谁都会走 提交于 2019-12-01 19:27:30
I only added to an existing fully working project, the file com/android/vending/billing/IMarketBillingService.aidl (I didn't add anything else (from the market_billing sample) yet, since I am not even trying to use the service yet) It compiles and builds perfectly, but when I try to run it, I receive the following in the console: java.lang.IllegalArgumentException: already added: Lcom/android/vending/billing/IMarketBillingService$Stub$Proxy; Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123) Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163) Dx at com

android aidl import

大兔子大兔子 提交于 2019-12-01 18:47:44
I'm trying to import android.content.Context to AIDL file but eclipse doesn't recognize it.. here's my code: package nsip.net; import android.content.Context; // error couldn't find import for class ... interface IMyContactsService{ void printToast(Context context, String text); } Can anyone help me? Using android.content.Context isn't going to work since it doesn't implement android.os.Parcelable . However - ff you have a class ( MyExampleParcelable for instance) that you want to transfer in an AIDL interface (& that actually implements Parcelable ) you create an .aidl file,

Tracking user idle time within the app in Android

南笙酒味 提交于 2019-12-01 11:58:18
As far as I know, there is no system API for me to get user idle time . When I say user idle time, I mean user have some interaction on the touch screen within my app. Therefore, I want to track it by my self. The way come up to my mind is to extends Activity and override onuserinteraction method to save the last user active time. But the challenge is that my app have multiple processes. I am not sure the following way is the correct and efficient way. I want to use SharedPreference with MODE_WORLD_WRITEABLE flag to store the user last active time. To avoid the performance issue, I also cache

Tracking user idle time within the app in Android

非 Y 不嫁゛ 提交于 2019-12-01 10:05:19
问题 As far as I know, there is no system API for me to get user idle time . When I say user idle time, I mean user have some interaction on the touch screen within my app. Therefore, I want to track it by my self. The way come up to my mind is to extends Activity and override onuserinteraction method to save the last user active time. But the challenge is that my app have multiple processes. I am not sure the following way is the correct and efficient way. I want to use SharedPreference with MODE

Can't use .aidl files across library projects?

对着背影说爱祢 提交于 2019-12-01 09:13:19
In the spirit of re-using code, I'm trying to create a few library projects. However, I seem to run into a problem defining .aidl files that span the libraries. Here is the problem: In library A I have Foo.java and Foo.aidl. Foo.java is Parcelable so the aidl declaration is: Foo.aidl: package com.example.library.A; parcelable Foo; Now I'm trying to create library B. In library B I want to define a service interface that uses class Foo: IMyService.aidl: package com.example.library.B; import com.example.library.A.Foo; interface IMyService { void requestSomething(in Foo fooBug); } This file does

How to implement callbacks using IntentService on Android?

独自空忆成欢 提交于 2019-12-01 07:16:46
If it must implement with AIDL? And please kindly provide an example, thanks. EDIT: There are several solutions, Does anyone know which is better? Zsombor Erdődy-Nagy You might be looking for the ResultReceiver class ( http://developer.android.com/reference/android/os/ResultReceiver.html ). You extend it, pass it along with the intent you invoke the Service with (it's parcelable), then when your task completes in the Service , you call the ResultReceiver's onReceiveResult() method with the results. SohailAziz checkout this post : Using ResultReceiver in Android , discussing the implementation

Can't use .aidl files across library projects?

我的未来我决定 提交于 2019-12-01 06:49:05
问题 In the spirit of re-using code, I'm trying to create a few library projects. However, I seem to run into a problem defining .aidl files that span the libraries. Here is the problem: In library A I have Foo.java and Foo.aidl. Foo.java is Parcelable so the aidl declaration is: Foo.aidl: package com.example.library.A; parcelable Foo; Now I'm trying to create library B. In library B I want to define a service interface that uses class Foo: IMyService.aidl: package com.example.library.B; import

When to use an aidl based service?

帅比萌擦擦* 提交于 2019-12-01 02:57:39
Under what circumstances would using AIDL to define a service interface be the correct decision (rather than just creating an extension to the service class)? You need to use AIDL if you want a class outside of your application's process to access the Service. If you're only using the service from inside your application, you can use a local service . Tushar Tarkas Merely extending a service class will not allow your service to expose its methods to outside entities. If you want your service to be exposed/used by code which runs out of your android app, you will have to define an AIDL for it.

AIDL interface between two applications

与世无争的帅哥 提交于 2019-12-01 00:11:52
I've stuck a total wall with the AIDL interfacing. I've an app which has to be controlled via 3rd party application (I've enough control over this so I can ask them to implement what ever I need into their activity) Originally my app was also an activity with interface and everything but I've changed it to be a background service and for testing, I created a dummy app which manages to start the service app to the background. Now I would like a way to request method calls from the service (mainly; start, stop, sendData). I've created the .aidl files for both apps. The aidl file implements only

How to find the status of VPN connection through framework APIs or any other efficient method?

戏子无情 提交于 2019-11-30 12:14:07
So far: I found the following solutions Using Broadcastreceiver The broadcast receiver is deprecated from ICS Using Ping or Traceroute It's definitely going to take lots of time and its not efficient Polling for DNS server changes It's definitely going to take lots of time and its not efficient Using ip-address Even though it won't take much time depending on the network connection it may vary My conclusion: So far all the solutions I found are either not efficient or not so reliable. My questions: If VPN is connected in android device then android OS must be aware of it. Are there any public