Hello,
I'm currently trying the ibr-dtn for android app. It works fine and I can ping the phone from a computer connected on the same network using WiFi.
I would now like to build my own DTN application in order to send bundles from the phone and receive them on a computer connected on the same network.
I have looked at the code from DTNExampleApp and ShareBox.
When I use the DTNExampleApp, I keep getting the following messages in the logs (from DTNClient) : - registration successful - Session not available, need to register.
I tried to build my own app nevertheless but it is stuck on the DTNClient.getSession() blocking call.
This is what I did :
DTNClient client = new DTNClient(); Registration registration = new Registration("dtnsendapp"); client.initialize(this, registration);
EID destination = new SingletonEndpoint("dtn://receiver.dtn/dtnrecvapp"); Bundle b = new Bundle(); b.setDestination(destination); b.setLifetime(3600L); b.setReportto(SingletonEndpoint.ME);
Session s = client.getSession(); <-- program hangs here
String payload = "Hello World"; BundleID ret = s.send(b, payload.getBytes());
NB : I removed the Try, Catch to make the example as readable as possible.
My question is : How do I send a bundle using the provided API?
Thank you, Jawad