Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Android] Background Services do not work #260

Open
danturu opened this issue Mar 29, 2014 · 8 comments
Open

[Android] Background Services do not work #260

danturu opened this issue Mar 29, 2014 · 8 comments

Comments

@danturu
Copy link

danturu commented Mar 29, 2014

how can I use background services? I've got the following warn (it works when compile using pure titanium cli):

Unable to start service Intent { cmp=com.yydigital.tishadowapp/.Appdata-private:__test_android_mediaService }: not found
@dbankier
Copy link
Owner

Are you using the container app? If so, have you added the necessary bit to the tiapp.xml?

@danturu
Copy link
Author

danturu commented Mar 31, 2014

you mean tishadowapp's tiapp.xml?

I've just added it to tishadowapp's tiapp.xml, recompiled but it doesn't work. Same error. I don't use a stand-alone application that runs on TiShadow (http://www.yydigital.com/blog/2013/2/19/TiShadow_Appify)

from tishadowapp's tiapp.xml:

...
   <services>
      <service url="media.js" type="interval" />
  </services>
</android>

from my application's tiapp.xml:

...
   <services>
      <service url="media.js" type="interval" />
  </services>
</android>

like i said before it works without tishadow container. hmm...

@dbankier
Copy link
Owner

Ok. I see the issue. I'll have a fix/explanation soon.

@dbankier
Copy link
Owner

So the issue is that when using TiShadow the source is placed in the applicationDataDirectory (the writable area) but I didn't think background services can work like that at the moment. For example if you change to the tiapp.xml in the tishadowapp to something like this:

      <services>
        <service url="appdata-private://my_app/logservice.js" type="interval"/>
       </services>

It can't compile. Not sure how to fix this at the moment... The workaround for the moment is to build the service into the container app or just do not use service. You can use the Ti.Shadow property to see if you are running inside TiShadow.

@dbankier dbankier changed the title android background service not found [Android] Background Services do not work Mar 31, 2014
@dbankier dbankier added the bug label Mar 31, 2014
@danturu
Copy link
Author

danturu commented Mar 31, 2014

ok, thanx... I will try to isolate services inside TiShadow container.

@rotorgames
Copy link

@dbankier There is progress ? It is very necessary to use the service with tishadow. How to do it , any suggestions .

@rotorgames
Copy link

@dbankier @rosendi I sent a pull request with corrections tidev/titanium-sdk#6698

The service works with tishadow, hope appcelerator, take my changes.

@dbankier
Copy link
Owner

dbankier commented Mar 9, 2015

Awesome.

I'd be very interested to see if AppC accept the PR.

Thanks!

Everyone reading this should watch the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants