I am trying to create a simple android chat application for a school project, however as i am new to android programming, i am not sure where to start with and are there any guides to explain how could i do it? I get the idea of when someone sends a message the message will be stored in a database, then it will be send to the other person, so that the other person can receive it. However, as i am new to android programming i am not sure how would i be able to do it.
If someone could give an example of guide of what I should do, I would really appreciate it.
Thank you for your time.
if you want to create server based chat:
- create your simple client app (android)
- Create server on any machine. you can write simple java application that implements Server Socket and waits for clients. just open and any IDE, write and run. and wait for clients to connect.
- in you client(android) start socket connection to server
- after connection send your meesage to server.
- in your server keep list of all connected clients (probably you will keep list of client sockets)
- send all incoming data to clients, regardless of where it come from.
This implementation does not check for any session. it works like public chat. you will see your message will echo back to you and others will see your messages too. like group message.
I tried to be simple for you. but if you are too new to android and java you are going to need to learn
- create simple android app
- create simple User Interface
- set proper permission for network access (on application manifest file)
- simple java client - server communication.
links : for socket programming: https://docs.oracle.com/javase/tutorial/networking/sockets/
for simple android app: http://www.tutorialspoint.com/android/android_hello_world_example.htm
example chat app: http://www.coders-hub.com/2013/07/download-android-application-source-code.html#.VYE4Hrzhl0w (not tested but seems to have same idea. example is zipped file. just search "Chat" on the page.)
NOT: i am not so sure about other app examples on internet is simple as you need. so i did not put too many of them here. But if you understand basic technologies. you can figure it out i believe.
if android implementation becomes hard, you can simple implement your clients in simple java app and send statically predefined text messages to test if server can delivered to other clients. this will be easy test.
Firstly this is not the way to question. Follow
You will need a server side and a android client side for this. Since you are a beginner you can use SocketIO with android which has a tutorial there. Their source code