Turning your phone into a virtual-joystick

Image
Update: I kept working on this and I have released it as a package for Windows, Linux and macOS. Check it out: https://github.com/zenineasa/joystick/releases/tag/v1.0.0 -- During the days when I was pursying my master's programme, my friends and I used to occasionally go to a classroom in the university, turn on a projector, connect devices like Nintento Switch or Gaming computers and loads of joysticks, and play different simple multiplayer games; MarioKart was my favourite. From time-to-time, when I get together with people, I ponder that it would be a good idea if I bought such devices. Indeed, I do have a laptop, which could easily run such games; SuperTuxKart is similar enough to MarioKart and it can run on Linux, Windows and Mac. However, I do not have joysticks with me at the moment. Therefore, I think it would be a good idea if I simply worked on a project that would enable using our phones as joysticks. From a high-level, the plan is to host APIs on a NodeJS server that wo

Transferring Files between Computers and Phones using Wi-Fi

Phones are essentially miniaturized computers. If you connect your phone to a monitor, keyboard and mouse, it essentially becomes a computer. In this article, let us discuss about how to use an Android phone or a computer as a server and transfer the data into another phone or computer.

Doing this procedure on an Android device, you just need to install the app named Termux, which provides you with a Linux Terminal on Android.

If you don't have python installed already, install it using apt-get or apt using the respective commands listed below on your Linux Terminal or Termux. Note that admin privileges may be required to do so.
apt install python
apt-get install python
After you are done installing, before you create the server, you need to know what your IP address is so that other devices can access it. To obtain the IP address, simply type in the following command:
ifconfig 


In this case, the highlighted portion in the image above is the IP Address, 192.168.43.182. Now let us create the server and access it. The following command helps with the same:
python -m SimpleHTTPServer
or
python -m http.server 

The server would be available at http://192.168.43.182:8000. You can open that using your browser on your phone or computer connected to the same network as the server. If you wish to share a different directory, use cd command to move into a different folder and use the command above to host the server. If you want to share everything on your phone, perhaps running cd ../../../ and then running the command above would help.

Interesting use case:

Once upon a time, I did not have any application installed on my phone that could be used for sharing files. I had a file which I needed to transfer with a few of my friends. So, I went ahead with setting up a hotspot and asked everyone to connect to the hotspot. This ensured that we were in the same network. After that I went ahead to create a server using the method suggested above. And everyone could download the file that I wanted to share.

Comments

Popular posts from this blog

First impression of Lugano - Mindblowing

Thinking about developing an opensource P2P social network

From Correlation to Causation through stories and math