The convenience and effectiveness of smart phones has allowed them to be integrated into our daily lives. Providing an array of functionalities such as alarm clocks and calendars, smart phones have replaced several gadgets common to non-smart phone users. From email notifications, social networking to music and much more, the amount of interaction between the user and smart phones has drastically increased over the years. Downloading and uploading of data and media have become readily accessible due to the constant expansion of the internet. Consequently, this invokes a strain on network data usage particularly in African countries where data usage is capped. This limitation restricts users from being able to effectively and freely exchange data. Due to the increased capabilities of smart phones, it is proposed that alternate methods can be used to send data across multiple smart phones. In particular, Bluetooth and Wi-Fi technologies were explored to facilitate the creation of ad hoc networks amongst smart phones.
The project aimed to refine a Bluetooth data transfer protocol that is suitable for smart phones as well as evaluate the protocol under these criteria: Data transfer rate, Power consumption and Latency. Due to hardware and software restrictions, Wi-Fi data transfers were facilitated using access points rather than being programmed in Android. The success of a data transfer protocol was largely dependent on the rate in which data is transferred from one device to another. Finally, since the smart phone battery is limited in size and therefore also limited in capacity, the protocol needs to minimize battery usage.
In particular, several iterative implementations took place in Android to answer the following research questions:
In order to refine data transfer between smart phones, the Bluetooth library for Android was used. Specifically, data transfer is facilitated by the use of a BluetoothSocket class, whereby the InputStream and OutputStream could be obtained. The sender of data would write to the OutputStream and the corresponding receiver would read data from the InputStream. In order to obtain the BluetoothSocket mentioned above, one device acts as the server waiting for a connection request, while the other acts as a client requesting a connection.
Refinements towards the final data transfer protocol firstly involved the changing of read and write buffer sizes. This provided insight into the time tradeoff between reading and writing many small data blocks to the BluetoothSocket and reading and writing fewer larger data blocks. Thereafter, three algorithms were implemented to notify the receiver when the end of the file had been reached. This halts the process of the receiver attempting to read from the InputStream which may cause unnecessary overhead. Lastly, mobile ad hoc networks require multiple connections between multiple devices and as a result, tests were conducted to evaluate the transfer speeds and power consumption of a device managing two simultaneous connections.
The following simple interface was used to start data transfers between devices:
The research in this component of GROUT confirms the feasibility of Wi-Fi and Bluetooth as viable wireless technologies for establishing a mobile ad hoc network. Each candidate provided higher data transfer speeds while maintaining a lower power consumption rate compared to using network data. While Bluetooth provided a more energy efficient method of transferring data, Wi-Fi provided higher bandwidths which compensates for the amount of time that Wi-Fi requires transferring the same data volume. Connections between multiple devices are available through different RFCOMM channels. Bluetooth utilizes these channels by assigning a unique UUID to separate simultaneous connections while being able to listen for more incoming connection requests using different UUIDs. Experimental results show that Bluetooth data transfer speeds are halved if two simultaneous connections are being handled. In terms of power consumption, Bluetooth does not use significantly more power while handling two connections.
Due to Wi-Fi’s superior data transfer speed capabilities and energy efficiency for larger files, it is recommended that files greater than 16 megabytes are transferred using Wi-Fi. Smaller files should be transferred using Bluetooth despite lower data transfer speeds due to Wi-Fi’s significant initial overhead. Since Wi-Fi uses considerably more power compared to Bluetooth, it is recommended that all connections are established using Bluetooth where possible. Thereafter a choice should be made between Bluetooth and Wi-Fi to facilitate the data transfer. Idle connections in particular should always be handled using Bluetooth due to its significantly lower power usage compared to Wi-Fi.
The table summarizes the details of the wireless technologies: