I have a question regarding Android's architecture. I am starting out in Android and after a few static apps, I'd like to build a dynamic sort of app like a chat app. My questions are:
This is my understanding of the Basic architecture of a chat app.
Am I correct in assuming that a chat conversation always passes through a server to and fro?
Thats up to you. If you want to implement a P2P-Communication, feel free to do it ;) But I would recommened to use a server between clients (what if you want to implement a group chat? -> more complex in p2p). Beside this: How do you know the ip-address of the other clients? With a server you can easily "login" or "logout" and see who else is currently available and so.
I understand that natively Android uses sqlite. Is it possible that I could use some other DB on the server or should I stick with sqlite?
Also up to you. The database of the server doesn't have to be the same as used in Android. I've never used sqlite on server-side. Choose it by yourselve!
Does the server-side code need to be in Java so that it plays well with Android or could I code it in, maybe something that I am more proficient in - like maybe Python?
I would suggest you communicate via HTTP with the server. So you can use any programming language you like to use.
Lastly, if a message need to be transformed in some way, does that take place on the user's device before sending or does that happen on the server?
What do you mean exactly? Your server would provide an interface like "sendMessage(messageObject, target,....") - You decide what a messageObject should look like. In addition the server can modify the object and send it to the clients.
I strongly recommened you to have a look at:
With GCM you can send/receive messages as soon as the server is reaching them.
And I also have a tutorial for you for implementing a chat with GCM:
Create an Instant Messaging app using Google Cloud Messaging (GCM).
Otherwise, if you don't wanna use a push-service you can have a look at this tutorial:
In this example they're using sockets for the communication between client and server.