Android implementation doubts
Hello,
I'm coding a application for android based on the DTN Ping example, however, I don't quite understand the use of some classes. For instance, I am trying to get the neighbour list from the DTN app and send a bundle to each neighbour but I don't know how to get their addresses (something like dtn://example). I've managed to get the neighbour list using the getDtnService() getNeighbors() methods from the client, but there was no method to get their addresses.
Could someone explain me the best way to do it? Also, is there any document that may help me understand the dtn api classes?
Thanks in advance, Guilherme rolim
Hello Guilherme,
with the call to getNeighbors() you already were you want to be. The last missing step is to get the "endpoint" of the Nodes you got as list. The endpoint is a SingletonEndpoint object and contains the address you are looking for.
Kind regards, Johannes Morgenroth
Am 12.07.2013 01:39, schrieb Guilherme Rolim:
Hello,
I'm coding a application for android based on the DTN Ping example, however, I don't quite understand the use of some classes. For instance, I am trying to get the neighbour list from the DTN app and send a bundle to each neighbour but I don't know how to get their addresses (something like dtn://example). I've managed to get the neighbour list using the getDtnService() getNeighbors() methods from the client, but there was no method to get their addresses.
Could someone explain me the best way to do it? Also, is there any document that may help me understand the dtn api classes?
Thanks in advance, Guilherme rolim
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
Hello Johannes,
I did as you said, however, I didn't find a method to get the endpoint name. For example, i have a list of neighbours called "neighbours" (List<Node> neighbours = mClient.getDTNService().getNeighbors();), I was hoping there would be something like "neighbours.get(0).endpoint.getAddress()" returning a String. What is the proper way of getting this String that contains the address?
Thanks for the help, Guilherme Rolim
On Fri, Jul 12, 2013 at 11:38 AM, Johannes Morgenroth < morgenroth@ibr.cs.tu-bs.de> wrote:
Hello Guilherme,
with the call to getNeighbors() you already were you want to be. The last missing step is to get the "endpoint" of the Nodes you got as list. The endpoint is a SingletonEndpoint object and contains the address you are looking for.
Kind regards, Johannes Morgenroth
Am 12.07.2013 01:39, schrieb Guilherme Rolim:
Hello,
I'm coding a application for android based on the DTN Ping example, however, I don't quite understand the use of some classes. For instance, I am trying to get the neighbour list from the DTN app and send a bundle to each neighbour but I don't know how to get their addresses (something like dtn://example). I've managed to get the neighbour list using the getDtnService() getNeighbors() methods from the client, but there was no method to get their addresses.
Could someone explain me the best way to do it? Also, is there any document that may help me understand the dtn api classes?
Thanks in advance, Guilherme rolim
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
-- !! This message is brought to you via the `ibr-dtn' mailing list. !! Please do not reply to this message to unsubscribe. To unsubscribe or adjust !! your settings, send a mail message to ibr-dtn-request@ibr.cs.tu-bs.de !! or look at https://www.ibr.cs.tu-bs.de/mailman/listinfo/ibr-dtn.
Hello Guilherme,
if I remember right, you'll just need to call the toString() method of the endpoint object to get the Endpoint ID as String.
neighbours.get(0).endpoint.toString()
Kind regards, Johannes Morgenroth
Am 12.07.2013 20:18, schrieb Guilherme Rolim:
Hello Johannes,
I did as you said, however, I didn't find a method to get the endpoint name. For example, i have a list of neighbours called "neighbours" (List<Node> neighbours = mClient.getDTNService().getNeighbors();), I was hoping there would be something like "neighbours.get(0).endpoint.getAddress()" returning a String. What is the proper way of getting this String that contains the address?
Thanks for the help, Guilherme Rolim
Hello Johannes,
I made some modifications on the code, trying to display the bundle payload content on the main activity, but it didn't work as I expected. The idea is to send a bundle from the first mobile to a second, and the second gets this bundle, open it's payload and display it. I thought I needed only to call a method inside the public void payload(byte[] data) method, sending it's content to the interface. But the fact is, it was displaying the echoed bundle. For example, the first mobile sent a bundle to a second with echo, the second sent it back, and then on the first mobile, it entered the payload method and displayed. When I removed the /echo, this stopped working and the second mobile continued without displaying it. What exactly do I need to change, to make the second mobile receive a bundle and extract the payload information?
Really thanks! Guilherme Rolim
On Sat, Jul 13, 2013 at 6:26 AM, Johannes Morgenroth < morgenroth@ibr.cs.tu-bs.de> wrote:
Hello Guilherme,
if I remember right, you'll just need to call the toString() method of the endpoint object to get the Endpoint ID as String.
neighbours.get(0).endpoint.toString()
Kind regards, Johannes Morgenroth
Am 12.07.2013 20:18, schrieb Guilherme Rolim:
Hello Johannes,
I did as you said, however, I didn't find a method to get the endpoint name. For example, i have a list of neighbours called "neighbours" (List<Node> neighbours = mClient.getDTNService().getNeighbors();), I was hoping there would be something like "neighbours.get(0).endpoint.getAddress()" returning a String. What is the proper way of getting this String that contains the address?
Thanks for the help, Guilherme Rolim
Forget about it. I`ve found the error =D I had the android manifest wrong.
Yours Sincerely, Guilherme Rolim
On Tue, Jul 16, 2013 at 9:07 AM, Guilherme Rolim loxorolim@gmail.comwrote:
Hello Johannes,
I made some modifications on the code, trying to display the bundle payload content on the main activity, but it didn't work as I expected. The idea is to send a bundle from the first mobile to a second, and the second gets this bundle, open it's payload and display it. I thought I needed only to call a method inside the public void payload(byte[] data) method, sending it's content to the interface. But the fact is, it was displaying the echoed bundle. For example, the first mobile sent a bundle to a second with echo, the second sent it back, and then on the first mobile, it entered the payload method and displayed. When I removed the /echo, this stopped working and the second mobile continued without displaying it. What exactly do I need to change, to make the second mobile receive a bundle and extract the payload information?
Really thanks! Guilherme Rolim
On Sat, Jul 13, 2013 at 6:26 AM, Johannes Morgenroth < morgenroth@ibr.cs.tu-bs.de> wrote:
Hello Guilherme,
if I remember right, you'll just need to call the toString() method of the endpoint object to get the Endpoint ID as String.
neighbours.get(0).endpoint.toString()
Kind regards, Johannes Morgenroth
Am 12.07.2013 20:18, schrieb Guilherme Rolim:
Hello Johannes,
I did as you said, however, I didn't find a method to get the endpoint name. For example, i have a list of neighbours called "neighbours" (List<Node> neighbours = mClient.getDTNService().getNeighbors();), I was hoping there would be something like "neighbours.get(0).endpoint.getAddress()" returning a String. What is the proper way of getting this String that contains the address?
Thanks for the help, Guilherme Rolim
participants (2)
-
Guilherme Rolim
-
Johannes Morgenroth