Hi there, i haven't played Clash Of Clans/Kingdoms but it sounds like Travian. A server based game.
Well in that case you need a server to store all player data inside a DB, access (asp) or mysql(php). It's like making a global ranking system for a game, you store all player scores using mysql into a server(host).
But the problem from an async game using a mobile device is the internet, not everyone have access, so you can't play the game freely, some how you will have to block every possible move or action from the player until he have internet connection and update the stats from every user. Maybe if you save all the moves offline and then send it to the server when the user have access.
It's hard, because a browser game have internet access all the time. Other idea it's a 1 vs 1 game, so then you block the users moves waiting only for the other enemy and not the entire server/world.
Remember that apple do block apps that only use internet and don't advice about it.