global Variable that can be read by service before activity starts

barx

Well-Known Member
Licensed User
Longtime User
Hey all,

What type of variable (and placed where) can be read by a service and activity. But the service must be able to read it before any activity loads, i.e. a boot service. Trying to keep a filename in a var so that all aspects of project can read / write it at any time. Use a process globals and all was ok until i reboot the device and the service that starts on boot cannot read it until the said activity have loaded.

Hope that makes sense, thanks
 

barx

Well-Known Member
Licensed User
Longtime User
thats the thing the service starts at boot before the activity. but on the other hand when first installed or run on the device the activity starts first :S. in fact the service ONLY gets started at boot, then dies until next boot.
 
Upvote 0

JonPM

Well-Known Member
Licensed User
Longtime User
Create a file on first launch of app and write the variable there? Then both can read from it afterwards.
 
Upvote 0

barx

Well-Known Member
Licensed User
Longtime User
Hi jon, I have a settings file. It is the name of said settings file that I wish to store. Guess I will have to just hard code it in each place I use it. Trying to make my code modular so I can copy the code to another project, set the file name in one place I wish to use for that project and voila it is used throughout the project.

Thanks

Sent from my HTC Desire Z
 
Upvote 0
Top