1. Download our Official Android App: Forums for Android!

Apps services and call backs

Discussion in 'Android Development' started by GIR, Jul 26, 2011.

  1. GIR

    GIR Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    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 (Text):
    1.  
    2. Syntax error on token "Stub", static expected
    3.  
    and
    Code (Text):
    1.  
    2. Type mismatch: cannot convert from Stub to IBinder
    3.  
    Can anyone help?

    Regards,
    GIR
     

    Advertisement

  2. GIR

    GIR Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    *bump*
     
  3. QuackWare

    QuackWare Newbie
    Rank:
    None
    Points:
    16
    Posts:
    22
    Joined:
    Jul 14, 2010

    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.
     
  4. GIR

    GIR Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    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
     
  5. QuackWare

    QuackWare Newbie
    Rank:
    None
    Points:
    16
    Posts:
    22
    Joined:
    Jul 14, 2010

    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.
     
  6. GIR

    GIR Well-Known Member
    Thread Starter
    Rank:
    None
    Points:
    18
    Posts:
    96
    Joined:
    Feb 14, 2010

    Feb 14, 2010
    96
    10
    18
    Classified.
    UK
    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..
     

Share This Page

Loading...