Android Chat App in Python

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] what is going on guys welcome back in today's video we're going to build a fully functioning tcp chat app in python and this is what it's going to look like in the end this is going to be the android app and since it's written in kivy we're also going to be able to run it on the computer this is what it looks like on the desktop and all of this is going to connect to a server which is hosted on the internet so it's not locally it's hosted on the internet we can connect with the phone we can connect with a laptop we can connect with the phone from somewhere else to the same server and we're going to chat and i'm going to demonstrate to you how this works i'm now connected to the server via ssh so i can run the server you can see server is running and now what i do is first of all i'm going to connect with the computer so that you see what i'm doing i need to first enter the ip address that's the ip address so i'm going to copy it and i'm going to paste it here then i'm going to choose a nickname i'm going to call myself neural connect and there you see neural joint chat connected to the server now i'm going to do the same thing on my phone now i just need to look at the ip address again so it's going to be 31.170.165.142 and i'm going to pick the nickname 9 and now i'm going to connect there you go you can see in the background here nine joined chatted now i can chat from my phone i can write hey what's up and i can send that message to the chat and you can see on my computer i also get that message i can write back not much how about you question mark then send this and even though you're probably not gonna see this uh by me holding it in the camera maybe i'm gonna add some screen recording of the phone i also get these messages on the app so this is what we're going to build today we're going to build a tcp chat server which is going to be running on the internet and we're going to build a respective desktop and android application as well so let's get right into it now before we get into the actual tutorial i would like to mention that this video is sponsored by hostinger and don't skip that part because this part is going to be relevant to the video we're not just going to talk about the sponsor and then forget about it we're going to use hostinger for today's video because what we want to do is we want to run the server on the internet now of course if you want to you can also run it locally on your laptop on your raspberry pi at home in your local area network but if you want the script to be ran on the internet you got to have a dedicated server for that you need to have some hosting provider that provides you with a dedicated server and hostinger can do that for you and they're sponsoring that video uh they have provided me with a vps2 hosting plan for this video today this is what we're going to use here we have two cores we have two gigabytes of ram we have 40 gigabytes of ssd storage and so on you can look at the details here and this is what we're going to do this is what we're going to use in today's video so if you want to follow along and if you also want to put your server onto the internet out there you're going to need some vps hosting plan and i can recommend hosting it for that however if you're not interested in building a python application that you run on the internet maybe you want to have a shared web hosting plan as well because hostinger also offers you these shared web hosting plans where you can use basic php and mysql you can build a wordpress website i have a tutorial on this channel here uh where i explain to you how you can build your own first website uh you can take a look at these prices here they're fair prices and you can also get some uh percent off with my coupon code that you will find in the description down below and i'm also going to show it somewhere here so you can get cheaper prices here and uh you can build your own first block your own first website your own first um i don't know portfolio of applications where you can showcase your projects and uh for this you can use the shared web hosting plans and for today's video you can use the vps hosting plans of hostinger the process of setting up a vps server on hostinger is quite simple you only need to choose a server name a location a root password and an operating system that you want to use for this tutorial we are going to use ubuntu once your vps has been created successfully you can proceed to the control panel there you can find your server as well as see all the information that you need for some reason i had to set my root password again so just scroll down and choose a root password with a minimum of 12 characters now once we're done with the basic setup we're going to connect to the server via ssh so we're going to look at the ssh details here the important thing is the ip address and the username and we also need some ssh client now you can use putty if you want to if that's how it's pronounced or you can just use the windows command line so you can open up cmd and say ssh and then root add ip address i'm going to use the windows subsystem for linux so i'm just going to open this windows terminal here and same goes by the way for linux and mac as well so you just say ssh and then root at the ip address that is written up here and once we have that it's going to ask for a password or for our password mine is a bit long there you go and once you're locked in it's going to say welcome to ubuntu in my case and now we can go ahead and just say ls to look for the different directories in my case i have two directories here already so i have my server python server in your case probably you're not going to find anything so you can create a new directory by just saying mk directory here make directory and then we're going to choose a name for example app server like that and then we can navigate to that directory and in here you can just create new files you can either use vim by saying vi you can use nano if you want to or you can just use sudo apt install and then whatever application you like to edit code in the command line in my case i have set up neovim with the whole config i have a video on that on my channel my neovim config and basically you can just use nan i think nano should be pre-installed as well so let's just see server.py this should be possible there you go you can also use nano if you're more comfortable with that i'm going to use neovim so server.py and here we're going to start to develop the server first and then we're going to develop the client all right so let's start with the server implementation we're going to start by importing socket and by importing threading those are two core python modules that we're going to need so we're not going to have to install anything here and we're going to first need the host and the port that the server is going to be running on and for this we're going to dynamically determine the ip address and this is going to be done by socket dot get host by name socket.gethostname like that and the port is just going to be something that is not really used by anything so 99999 for example and we can go ahead and create the server socket so server equals socket.socket socket.af underscore inet for internet socket and socket dot sock underscore stream for tcp then we're going to bind the server to the tuple of host and port and then we're going to start listening for incoming connections so we're also going to need is an empty list of all the clients in an empty list of all the nicknames and whenever a client connects we're going to add nickname and client to these lists so we're going to say clients equals empty list and nicknames equals empty list as well and what we're going to do then is we're going to say we're going to define individual functions so we're going to have one main function that is constant listening and accepting incoming connections whenever an incoming connection is accepted we're going to have a handle connection function that is going to handle that specific connection in a separate fret and then we're going to have a broadcast function to communicate to all the connected clients so let's start with the broadcast function we're going to say def broadcast a certain message is going to be done by saying for client in clients client dot sent message like that and we're not going to encode that message because we're going to expect that this message is already encoded when we pass it to broadcast so we're also not going to decode messages that we get from clients to be broadcasted but that's a very simple function then we're going to have the handle connection function handle connection we're going to pass a client to this one and basically the main function is going to get declined by the accept method it's going to pass it to the handle connection function and here we're just going to say stop equals false and while not stop uh is this right yes while not stop we're going to say try to get the message from the client so message equals client dot receive 1024 bytes and if possible if we get a message we're going to broadcast that message here if we get something some exception here for some reason we're just gonna say okay the index of the current client um is going to be clients dot index client so it's going to give us the position of this particular client in the clients list and then we're going to just say clients dot remove this client from the list and we're also going to say uh nicknames or actually nickname equals nicknames at that position [Music] index and then nicknames dot remove nickname like that this should work out and then we're just gonna broadcast a little f string that says nickname left the chat like that and we're going to encode this of course using utf-8 there you go so that's a basic uh handle sorry handle connection function the only thing that's missing here is we need to say uh first of all we need to close the brackets here and then we need to say stop equals true so that the loop doesn't continue uh yeah and now the only thing that we need in the server is the main function that is accepting the connection so we have this main function that we're going to run and we're going to basically just say uh print server is running so that we know that at least the script is working and running and then we're going to say wow true we're going to accept incoming connections so client and address is going to be server.accept this returns two values declined in the ip address and then we're just going to say print connect it to and then address and of course we need to make this an f string otherwise it won't work and once we have that we're going to ask for a nickname so we want to send to the client something that requests a nickname so we're just going to say client.send not an f string we're gonna send the string nick with capital letters uh we're going to encode this of course with utf minus eight there you go and the idea is the following the client is going to see that this is the nik keyword and then it's going to know okay the server wants to know my nickname it's going to send the information we're going to store that in the nicknames list and as you can see we're communicating via the client object we're not using the server socket the service socket is only used for accepting incoming connections and when we accept the connection we get a new socket to communicate with that particular client so once we have that we're just gonna say okay we send that request and then we're going to get the nickname which is going to be client.receive 1024 bytes we're going to decode what we receive utf-8 here there you go and then we're going to say nicknames dot append nickname [Music] clients dot append client and then we're going to also print nickname is nickname of course make this an f string as well and then we're going to broadcast to all the connected clients that the nickname joined the chat there you go and now we need to just say client.send you are now connected or anything that you want to send don't forget to encode it utf -8 and there you go i think here we also need to encode it because the broadcast yes of course we need to encode it so encode this one here as well utf -8 because we need to send send bytes uh and last but not least all we're going to do is we're going to just say a new threat is going to be threat with a target of handle connection [Music] and the arguments is going to be client like that and we're going to start that threat and then we're going to say if underscore underscore name underscore underscore equals main underscore underscore then we're just going to call the main function so that is the server i'm not sure if i made any mistakes we can just see if it's running or not so [Music] let's just say python3 server.py at least it's running i'm not sure that it's going to be without any errors but i'm going to try with the app that i already have if it works and if it works then we can continue with the actual app so i'm going to connect to the server 31.170.165.1 and we're gonna connect with some nickname here connect uh threat is not defined oh there you go we have a mistake the problem is of course that threat is part of threading so we need to say threading dot threat but besides that everything seems to work fine so let's just close the app again because the app um got an exception as well i'm gonna run the server address already in use do i have some jobs running why is the address already in use okay let me fix that mistake we're going to go uh i'm going to come back to you in a second all right so the mistake actually just fixed itself uh we just had to wait for half a minute or something so now let me run the server again and if i connect now as you can see it works nickname is neural nine and if i send something uh you're not gonna see it on the computer but i see that it works so the server is the same as uh the complete server so we're done with the server side all we need to do now is we need to create the application which is running on the desktop and on the mobile phone all right now let's start with the client implementation and for this we're going to use kivy because we want to have it on android you want to have it on windows and if you want you can even compile it for ios but i think for that you need a mac so i don't have a mac i'm only going to show you how to do it for android and desktop windows desktop uh so what we're going to do first is we're going to install kivy by opening up a command line cmd for example and saying pip install kivy like that so i'm not going to run that because i already have it you just run that install kibi and then what we're going to do is we're going to put the design the whole user interface into a separate kv file now i have a video on this channel on how to create an android app in python where i explain all the basics and i'm not going to skip the basics here but i'm not going to start slowly with the structure of a qv project what you need to know is you have a python file with all the functionality with all the kivy logic you could say and we're going to have a separate kv file with all the uh ui elements so we're going to create a new file and we're going to call it uh android or let's call it neural chat neural that's called neural web chat dot kv and this is going to be the design file as you can see we already have the kibi logo here so we're just going to design the ui using this kivy file and what we're going to have first is we're going to have this element that we're going to call let's call it my root and inside of my root we're going to have a bunch of different elements first of all we're going to have a basic grid layout maybe i'm going to show you first and paint uh how i plan to do this i mean we already saw the app in the in the preview but what we want to have is we want to basically have the server ip here we want to have the nickname here we want to have a basic oh no make this black please um i want to have a basic button that says connect down here and we want to have some labels so we want to have uh the label ip here the label nickname here we want to have connect here we want to have these two text boxes here and once we click on connect those shall disappear so those shall disappear and then down here we have uh the chat history with a label of course up here and we want to have our own message box and a send button down here so this is the graphical user interface and because of that what we're going to do is we're going to choose a vertical layout from top to bottom but inside of that vertical layout we're going to have a grid layout for these elements up here so this is how i plan on doing it or at least for for these elements whatever i'm not the best designer however i want to also mention that the gui is not the focus here so you can make the user interface however you like the important thing is that the boxes are there and that the buttons are there you don't have to care about the design at all you don't have to care about the colors about the layouts anything you can also just stack everything on top of each other i'm not going to care about the design too much the focus is on the functionality you want to have an android app that can connect to the server and can send some messages so this is what we're going to do and for that we're going to have a grid layout and this grid layout is going to also have an id because we're going to need that later on to make it disappear uh we're going to have this grid layout and the id is just going to be connection grid because that's where the ui elements regarding the connection are going to be we're going to have uh one row or actually two rows let's go with one row and two columns and we're going to have um a padding of 10 and a spacing of 10 and a height of 125 so those are the basic properties of the grid and we're also going to set the size hint to 1 which means that it's going to stretch horizontally but we're going to set this to none when it comes to the height so we can set the height here manually um otherwise it would just ignore our height here and inside of that grid like a layout would want to haves want to have two box layouts and inside of those box layouts we want to have the individual ui elements so we're going to say box layout and inside the first box layout we want to have the orientation to be orientation want it to be vertical and we're going to say when i have a label in here this label is going to have the id or actually do we need the id for that if we're going to make this appear we're going to make the whole grid layout disappear so i'm not sure if we even need an id for this label so i'm just going to skip that for now we're going to have the text which is just going to say server ip then we're going to say font size of that label is going to be 42 [Music] and the color of the label is going to be something i'm just gonna pick some orange here 0.92 0.45 0 those are the rgb values normalized and then we have the opacity which is going to be 1. all right so that's the label then we're going to also add a text input for the actual ip address and here we're going to have the id ip underscore text and we're going to have the size hint again set to one and none so that we can manipulate the height of the box we're going to set the height to 50 and we're going to set the font size to 36. there you go now if you want to have these ids you also have to define them up here again so what we need to do here is we need to say that if we're talking about iptext in the code we mean iptext in a design file so every time you use an id you want to specify it up here as a pair as well so what we're going to do now is we're going to copy that because this is just the left side we also want to have come on we also want to have the right side so come on can i please just insert this normally okay seems like i can't so let's just indent this two times there you go and here we're going to say nickname nickname i'm gonna leave the rest the same just this is going to be nickname text and of course we need to also say nickname text here and nickname text here there you go so uh this is the basic grid layout we have one row with two columns first column is this box layout second column is this box layout and below those we want to have a button for the connection so we're going to say below the grid layout so you want to have it on this level of indentation here we're going to have a button and this button is going to have the id connect btn and it's going to have the text connect and it's going to have the font size of 32. by the way feel free to skip that part if you want to make your own layout so you don't have to copy my layout it's a pretty boring part of the project so you don't need to follow along with this this is just some basic ui stuff i'm going to set the size to 150 i'm going to set the size hint to one and none again so that we can manipulate the height and i set the height to 70. and actually is this redundant i'm not sure to be honest i i made this layout and i'm not even sure that it's optimal or that it is how you should be doing it i'm really not a ui guy so i'm just copying what i already did so maybe height and size 50 is contradictory but it works so i'm going to leave it like that you can play around with it if you want to and we're going to add an on-press event later on so we're going or actually we can add it right now so we can say on press we're going to call a certain function this function has then to be defined in the code later on but we're going to just call it root.connect to server like that so when we click that button this function is going to be called alright so after that we want to have a label again for the chat history then we want to have a text input for the chat history i want to have another label and another text input for our message and then a button for sending so we're going to say label and we're going to say text chat history um we're gonna say font size equals 42 we're going to set height 250 gonna set size hint to one none again and what else do we need the color obviously 0.92 0.45 0 and 1. there you go now a text input a simple text input maybe i can even copy or actually no this is quite different so i'm going to just write it myself again so this is going to be the id chat underscore text um we're going to also say size hint here is going to be one none but this time we're going to go over the size over the height so we're going to say height is going to be 450 we're going to set this to multi-line uh true and we're going to say font size equals 36. and we're going to make this read only because obviously we don't want anyone to be able to write something directly into the chat history so read only true and disabled is also going to be true because we don't want to write manually into the chat history we want the program to write into the chat history and now i can copy that and paste this down here change this to your message and then i can i think i could copy that as well and we're going to call this what did i call this here message text and the font size is going to be 36 but we don't need that we don't need that we don't need that we don't need that in that and last but not least we want to have a button and this button is going to have the id sent btn and we're going to have the text sent gonna have the font size 32 gonna have the size 150 gonna have on press is going to be root dot send underscore message another function that we're going to implement and we're going to disable it in the beginning because we want to enable it once we connect now don't forget to add all these ids to the top so one two three i think that's it or connect button as well okay so we're going to say connect button it's going to be connect button and then chat text is going to be chat text nickname text is going to be nickname text actually we do have nickname text already uh what was the other one did i call it message text yeah message text is going to be message text and finally we had the sent button which is going to be the sent button so that is the whole ui all right so now we get into the interesting part which is the python scripting just keep in mind that if you want this to work the ki file has to be in the same directory as the script when we're going to create the class name because otherwise it's not going to associate the class name with the qivi file so we're going to start by importing kivy we're going to start by importing from kivy dot uh what was it app import app from [Music] u i kibi.euix dot box layout we're going to import box layout and then we're also going to import socket and we're going to import threading there you go we're going to require kv version um kiwi version 1.9.0 because in my case 2.0 does work on my computer it does not work on my smartphone i'm using the samsung galaxy s7 so if you're using a similar phone maybe you're going to have the same problem uh but this version works fine so you can look into the documentation if you need some special features of the latest version but we're going to use 1.9 and we're also going to create a client socket right away so client equals socket socket socket dot afinet for the internet socket and socket.sockstream for tcp and then we can start with the class definition we're going to call this class my root and it's going to extend from the box layout and we're going to define it in a second uh what does this mean this means that my root is basically a box layout and you need to keep in mind that this name here has to be the same as this name here so my route here is going to be linked to my route here which basically means that this here is a box layout and inside of that box layout we have a grid layout and we have buttons and labels and so on which basically means that we're just going to stack these elements uh vertically again so inside of that my root we're going to have a basic constructor uh self and we're going to call the super constructor here so we're going to pass my route and self and then call dot init like that and uh then we're just going to implement the basic functionality so we want to have a sent message function and we want to have a connect to server function i want to have a receive function and all that but the basic app is going to be running down below and the app is called neural web chat like that and it's going to extend from app and all we're going to do here is we're going to define the function or the method built and this is just going to return my root like that and then all we need to do is neural web chat equals neural web chat and then neural web chat dot run so the idea is that this is a ui element with all the functionalities this is the definition of the ui and this down here is the app which returns the ui once it's being built it's important that this name here neural web chat is the exact same name as the kb file and it's important that the kv file is in lower uh lowercase uh doesn't matter what the class name is like it has to be in lowercase otherwise it's not going to work on your phone all right so in here we're going to now define all the functions that are important to us remember we had this button being connected to connect to server and this button being connected to send message so now we need to implement these functions and let's start with the connection so let's start with connect to server once the button is clicked this function is going to trigger and this function is basically just going to say if self dot and now we can access even though it's not going to show in python we can access all of these uh elements here by using their name so we want to know okay is the nickname provided was the nickname provided and if not we're not going to proceed with uh with the connection so we're going to say if self dot nickname underscored text is not equal to an empty string then we can connect otherwise we're not going to connect so if this is the case if we have a nickname we're just going to send client dot connect we're going to connect uh to the text of the ip so we're going to take uh the tuple of self.ip text and i think the attribute is text dot text and the port is going to be 9999 there you go so we're going to connect to that server on that port and we're going to get the basic message from the server so we're going to say client.receive 1024 bytes and we're going to decode this actually i'm not sure even that we need to do this because the first message is just going to be or actually we need to do this because we need to know that the first message is the nic message because otherwise we don't have to send our nickname so we're going to decode the message and we're going to say okay if this message is asking for the nickname so if the message content is nick then we're going to say client.send self.nicknametext.txt utf -8 so we're going to send the nickname to the server and we're going to disable all the connection buttons and we're going to enable all the other buttons so we're going to say self dot send button dot disabled it's going to be false and we're going to do the same thing with the message text we're going to do the same thing with or actually we're going to do the opposite thing with the connect button because once we're connected we don't want the connect button to be available anymore so we're going to say this is true and we're going to do the same thing with the ip text i'm going to set this to true there you go so this is the basic connection and what we're also going to do is we're going to make the whole ui elements invisible so the whole grid layout and the button are going to be invisible and in order to do that we're going to write a simple helper function we're going to call this make invisible and we're going to pass to that function the widget that we want to make invisible so the widget and all we want to do is want to say okay the widget is going to be set to uh invisible but we don't do it with invisible equals true but but with visible equals false and then we say widget dot size hint size underscore hint underscore x equals zero or actually do we set it to none or zero set it to none there you go y um then we set the height the width to zero and the text to empty so we say widget dot dot height equals zero widget dot width equals zero and widget dot text is empty if it has one and then widget dot opacity equals zero so we make this element disappear basically uh and what we can do here is we can just say make invisible and then self dot uh what was the grid layout called connection grid we didn't include it up here connection grid like that and we can now refer to it connection underscore grid we make this invisible and we also make invisible self dot connect underscore btn and of course to access the function we need to include self in the beginning there you go so this should work and once this is done we can start a thread for receiving so we can say threat equals threading dot threat like that target is going to be self dot receive and we don't have that function yet so we need to implement it and we're just going to start this threat and the receive function is going to be implemented down here we're going to say receive self um and in this function we're just going to wait for new messages and once we get a message we're going to add it to the chat history so i'm going to say stop equals false while not stop we're going to ask for new messages we're going to try to get new messages so message equals client receive 1024 decode utf -8 and then we're just going to say self.jet text dot text is going to be plus equals message plus backslash and for a line break there you go what's the problem here accept or find oh yeah of course we need to also have an accept here and if there is some arrow we're just going to print error it doesn't really matter and we're going to close the connection and we're going to say stop equals true there you go so do we have something missing here yes of course the send message function is missing but this is a one-liner so send message send underscore message it's going to be quite simple we're just going to say client dot send and then self dot actually maybe we should use an f string we're going to say self dot nickname text dot text and then colon self dot message text dot text and we're going to encode that using utf-8 there you go so i think that should be it did i forget something i don't think so now chances are it's not going to run first try so let's see if it runs first try i don't believe it but maybe we have a problem property name invalid property name size hint of course because which line is this there you go here we need to add a colon and a space do you have a problem besides that oh boy what is that we messed up the graphical user interface um let me just compare well real quick what we have different from the prepared code oh i think we need to have the orientation vertical here as well does it work now there you go doesn't look too bad yes looks fine so we have server ip nickname we have the text boxes we can connect uh but i can already write a message this is not what i wanted so i have to set this to disabled by default do i set this to enabled again in the code there you go i do it anyway so let's see and let's maximize this we're now gonna run the script and see if it works i just need to go to the server real quick and run the server i gotta say python let me show you what i'm doing python3 server dot py so the server is running and now what was the ip address this was the ip address so i copy that i go to the python app i paste it in here and i choose a nickname hello and i connect does it work hello join the chat connected to server hello world sent okay it seems to work so now the only thing left is to get this uh and make this into an android app now in order to turn this application into an android app we're going to need a linux system now you don't need to have a full linux desktop system you can also use the windows subsystem for linux you just need a linux terminal then you go to builddozer.read the docs io and you can just follow the instructions here so you can install pip using pip you can install the build dozer you can install all the packages that you need on your linux system and then you're ready to go first of all if you don't know how to install the windows subsystem for linux i have a video on this channel also if you're a little bit uh confused about this process i also have a beginner android app development tutorial with python on this channel check out both of them if you are not able to follow along without help of those all you need to do is you need to install builddozer on a linux system and you need to install these things to run build dozer so once you have that you can run your linux system and you have to navigate to the directory where your files are at in my case this is my neural nine development directory i have a shortcut for it uh and i'm going to navigate to my app and here i have the python file and the kivy file all i need to do now is i need to say builddozer init like that build dozer init when i do that you can see a file builddozer.spec was created ready to customize so i can now open this with any editor you can use the windows notepad you can use vim you can use nano whatever you want i'm going to use neovim and in here i can specify everything that is important for my application first of all i can choose a title neural web chat for example the package name can be neural web chat the package domain can be i don't know org dot neural or something choose whatever you want then you can choose which files to include what's important here is the permission you need to have the internet permission if you don't have the internet permission you're not going to be able to communicate using sockets so what you need to do is you need to look for permissions and here you have android permissions come on permissions there you go android permissions equals internet so i'm gonna uncomment that this is what you need to do in order to be able to use sockets and what you can also do is let me just see where it is the pre-splash uh pre-splash file name if you want to change a custom if you want to have a custom pre-splash and a custom icon for your app you can provide the file path here you just need to make sure that you can include it uh when you when you do the compilation process i'm not gonna do this for this video however in my android app development video i have also shown you how to do this so if you for some reason have difficulties with the icon and the pre splash you can watch that video as well but it's not a complicated process you just remove the comment here and you choose a file path to a png file which you want to use as a loading screen and as an icon so once you have all that you can save it and then you just just type build dozer android or actually build dozer dash v android debug and that's it now you have to wait for about 10 minutes 20 minutes i don't know depending on your computer this takes quite some time time but this is now compiling your program into an android application and i'm going to get back to you once this process is done all right so it took quite some time but we're now done you can see the build was successful in 26 seconds so the whole process took like 40 minutes but the build itself was done in 26 seconds and if we now go to pycharm you can see that we have a bin directory and inside of that bin directory we have a dot apk file now the only thing that you need to do is you need to get that apk file onto your android phone you can do it with a cable with a usb cable you can upload it to drive and download it you can use an ftp server it doesn't really matter you want to get that file onto your phone open it install it and then once it's done once this is done you're going to be able to run the app so i'm going to show you what this looks like here with the screen recording you just click onto the app you open it it's loading and then you have the graphical user interface that we just designed we can also open it on windows so that we have a chat partner so we're going to load the project here as well so we're now running it on windows and on the phone and we're going to start the server now so i'm connected to the server i'm going to run the server.py server is running and now i'm going to connect i just need to know the ip address uh where is it i think it's somewhere up here there you go 31.170.165.142 [Music] and neural nine is going to be the nickname connect there you go you're now connected you can see down here that the nickname is neural nine and i'm going to now copy this ip address here and also paste it in here and choose the nickname florian connect now i joined the chat you can also see in the phone i joined the chat so i can now type hello and send the message and on the computer i get hello then what's up question mark sent there you go as you can see this works on the desktop on the phone and it also works on the server side so that's it for today's video enjoy hope you learned something if so let me know by hitting the like button leaving a comment in the comment section down below of course don't forget to check out hostinger and the coupon code in description down below and other than that thank you much for watching see you next video and bye [Music] you
Info
Channel: NeuralNine
Views: 7,539
Rating: 4.9585919 out of 5
Keywords: android app, android, app development, development, apps, app, chat, chat app, android chat app, python, python app development, python android app, tcp chat, python android chat app, python tcp android chat, python chat app, kivy, kivy chat app, kivy tcp chat, online chat app, internet chat python, python internet chat, python android internet chat
Id: pGolbRsvgnA
Channel Id: undefined
Length: 47min 8sec (2828 seconds)
Published: Tue Sep 07 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.