A starting point for user to get started with android development using IonDTN (A DTN provider application for Android)
A starting point for user to get started with android development using IonDTN (A DTN provider application for Android)
Android Studio -> Preferences… -> Appearance & Behavior -> System Settings -> Android SDK -> Android SDK Location field near the top of the panel.
Go to that location and there will be a folder called “ndk-bundle”. Replace the contents of this folder with the extracted content of the older version of NDK which you just downloaded.
The following changes are required in android_node.rc and pc_node.rc respectively. Make the changes as instructed below and save android_node.rc in android device and pc_node.rc in your machine.
Here,
# FIXME the IP address has to be changed to your network structure
a induct tcp <android_node_ip>:4556 tcpcli
# FIXME the IP address has to be changed to your network structure
a outduct tcp <android_node_ip>:4556 tcpclo
# FIXME the IP address has to be changed to your network structure
a outduct tcp <pc_node_ip>:4556 tcpclo
s
## end bpadmin
## begin ipnadmin
# FIXME the IP address has to be changed to your network structure
a plan 1 tcp/<android_node_ip>:4556
# FIXME the IP address has to be changed to your network structure
a plan 2 tcp/<pc_node_ip>:4556
## end ipnadmin
# FIXME the IP address has to be changed to your network structure
a induct tcp <pc_node_ip>:4556 tcpcli
# FIXME the IP address has to be changed to your network structure
a outduct tcp <pc_node_ip>:4556 tcpclo
# FIXME the IP address has to be changed to your network structure
a outduct tcp <android_node_ip>:4556 tcpclo
s
## end bpadmin
## begin ipnadmin
# FIXME the IP address has to be changed to your network structure
a plan 1 tcp/<android_node_ip>:4556
# FIXME the IP address has to be changed to your network structure
a plan 2 tcp/<pc_node_ip>:4556
Now we have to configure the app and the underlying ION-DTN instance.
First, we have to select a node number:
Just choose “1” in order to ensure compatibility with the configuration file used in all subsequent steps.
After pressing the arrow button, you have to select one of the two setup options:
For our project, please choose “Setup configuration based on file” and proceed by taping on the arrow button.
Depending on the Android version of your device and your security settings, you might be asked to give IonDTN the permission to access the devices external memory (which is the the memory that is accessible by the user and all other applications). Grant the permission and tap the arrow button to proceed.
In the upcoming dialog you have to select an appropriate configuration file. For the purpose of our project, select the modified android_node.rc.
If the setup succeeded (i.e. the configuration file was consistent), you will see the following screen:
IonDTN Setup is now complete. Click on the button to leave setup and you will be redirected to the main status screen of the application.
The topology for our test is as follows:
To form the test topology as described above:
Run an Ion instance on the machine using the modified pc_node.rc. Run this command:
ionstart -I <path to the modified pc_node.rc>
Look for the log message like below in log output of IonDTN provider application and ion.log file at the path where you started Ion instance in machine. Only this will ensure that toplogy has been successfully constructed.
- IonDTN provider application log:
Ion instance ion.log:
In this context 192.168.1.2 is machine ip and 192.168.1.26 is the ip of the android device.
Please make sure to start the IonDTN before continuing in order to use it with IonDTNSimpleAndroidApp.
Coming to this section means you have succesfully deployed the testing topology.
bpsink ipn:2.2
on the terminal. Your PC (node 2) will begin listening on the sink-EID with the endpoint_number 2 on service_number 2.ipn:2.2
as you did in terminal. Press send. You should be able to see the timestamp of android device (node 1) on the terminal like this:Note: You have an option to use
ipn:2.1
oripn:2.2
as a sink-EID but it needs to be same on both PC and android device for sucessfull data transmission.
Go to the running application, in the section Receiving at, type in ipn:1.2
. Your PC (node 1) will begin listening on the sink-EID with the endpoint_number 1 on service_number 2.
Open another terminal and run echo `date` | bpsource ipn:1.2
. You should be able to see the timestamp of PC (node 2) on the terminal like this:
Note: You have an option to use
ipn:1.1
oripn:1.2
as a sink-EID but it needs to be same on both PC and android device for sucessfull data transmission.