I'm trying to understand how to use intents, both incoming and outgoing, for a practical application. There isn't much information on how to use this in CTF other than how to send the occasional thing to Facebook or via email.
We have a two part system. I have a developer working on an android service which needs to be able to send and receive data (strings and values) with the app that I'm making in CTF.
His service will be called com.(mycompanyname).atlas, and mine will be com.(mycompanyname).west. His app needs to be able to send mine coordinates from a bluetooth beacon system. All I need is the X and Y coords, and I can do the rest. He also needs to be able to send values which will be programmed by me to kill or pause the app, along with a string to alert users of why the app was shut down.
My app needs to be able to send strings and data to his service, so that it can forward information onto the "mothership". The idea is that we have 3 dozen tablets and one mothership, which can keep tabs on what the users are doing.
His service does a lot of the heavy lifting in terms of sending and receiving data around the deployment site. I just have to make my app talk to his using intent.
Right now, I'm building a test app which will do several things. (From there I should be able to figure out how to get what I need.)
- Send his app a random number when clicking on a button. (Button is pressed, set a counter to a random number. How do I use intent to send that number to com.whatever.atlas so his system can get the value?)
- Send his application a string from a field the user has typed in. (Button pressed, set string to text that was entered into field. How do I get that string's data to com.whatever.atlas?)
- Receive from him a string
- Receive from him a value called X, and a value called Y
These items need to be sent automatically and without user interaction. (EX: When the intent is sent, it does not pop up a window asking where the user should send it (like facebook, as a SMS to a contact, to clipboard, etc...) It should go automatically where it needs to go without any sort of visual notice to the user.)
What would be the best way to set this up?