Androis service autostarting at boot

Im trying to do that on Delphi and hitting the wall every time. I need to try it on Fire + Oxygene but cant find the way to do and test a service.

Please give me a start point. Im lost here.

I need to vuild a sevrice auto starting at boot. The service need to read a table (already have that in SQlLite) and sened new items (already have a procedure to do that). Then sleeps X lapse of time. Also need the service wake on x meters moved from a original GPS position.

All taht must be included to be istalled on another GUI app already working developed with delphi. If is obligatory to do again with Fire im ready to do the works.

Thanks for any help or litlle sample to help me.

Best regards.

How do you do it in Java? same way will wort in Oxygene.