• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps services and call backs

GIR

Member
Hello,

I have a program that I wrote that detects motion via the sensors, and I am having trouble finding tutorials on how to go about this - namely sending data to and from and service.

I found some tutorials that looked promising - IF I target 1.5, as it uses AIDL, and for some reason eclipse throws errors such as :
Code:
Syntax error on token "Stub", static expected
and
Code:
Type mismatch: cannot convert from Stub to IBinder
Can anyone help?

Regards,
GIR
 
To be honest its really hard to figure out what your problem is when all you provide are 2 cryptic error messages. Providing the entire class file or more of the code would really help out.
 
Thanks for getting back.
Im trying to teach myself about services.
I have a motion sensing block of code that needs to go into a service (so i can sample the sensors once every few seconds to save battery) and that service needs to send data back , im not fussed how, either an int value, a string or a boolean will do, and the service needs to recieve a values (sensitivy) so it can adjust the threshold value if needed.

Ive looked for almost a week now, but finding a tutorial for services with bi-directional communication or call backs for api 7 (2.1) is prooving fruitless!

I think I've made so many changes to the project that raised that issues that i need to scub it and start again.

GIR
 
So you followed the samples here: Service | Android Developers with no luck? I found that reading over the documentation and following along with their samples worked fine. The error messages in your first post seem to be some sort of syntactical error though.
 
Its above my current level of understanding, I guess I just need a simple code example to alter and play with so I can learn from that..
 
Back
Top