The Non-Time Glitch Method
The last Kingdom building is unlocked at level 40. You need about 28,700 exp to get to level 40. If you're like me you'll have finished all the other achievements at around level 36-38 with between 20,000 and 25,000 exp. Since there's very few quests coming in the amount of exp you gain slows to a trickle. Here's some tips to earn more exp.
*Visit your friends and help them out. You get 5 exp for speeding up their production each day. If you have 50 friends to visit that's 250 exp each day. Plus you can gift them 3 energy each day, which they can return to you for free, as well. Check the forums for a list of people to add to your friends list. (Don't forget to accept help from your friends, too! It is free!)
*Use all your energy whenever you can. Each action you take in your kingdom gets you at least 1 exp. When you get into the upper level 30s you'll have 40 energy available. That energy will replenish every 2 hours. You can visit your kingdom multiple times each day, and that will net you at least
40 exp each time, but likely more from random energy drops.
*Focus on the resource production buildings (not farms), and only build the biggest amount of resource (the one that takes 24 hours to produce). This will net you 7xp each day (most bang for the buck... I mean energy). If you can manage to build 100 production sites (construction gets you 2xp, too), you'll be making 700 exp each day.
*Kingdom buildings also reward you with more than 1 exp. Be sure to collect from them as often as you can.
*Have you spent all the stars you earned from helping your friends? Extra energy can be purchased from the Black Market at a rate of 3 stars per energy. At the end of the game I had several hundred stars, which can be converted into exp by performing actions with purchased energy.
In essence, here's your priorities each time you visit your kingdom:
1. Harvest Fabric, Ore, and Lumber, and collect from Kingdom buildings.
2. Queue 24-hour Fabric, Ore, and Lumber
3. Build Fabric, Ore, and Lumber production sites.
4. Collect money from housing if you're out of cash (windmills first)
5. Visit and help all friends once daily.
6. And remember to spend all your energy each time.
-You could get well over 1000 exp each day, making the last bit of grinding take about a week or so, checking a couple times a day.
Here's a screenshot of what my kingdom looks like for massive exp generation (You don't need to separate them in to rows like I did; I just found it a bit easier to click all of them when harvesting):
You could also invade and repel invasions to earn 5-30 exp each time (I'm not sure how they calculate the invasion rewards; it seems a little random), plus the exp for critical hits and kills. However, I found invasions rather time-consuming and boring, and sometimes frustrating. After doing 100 repels and 100 invasions already, I really didn't feel like doing any more.
If you happen to reach your max storage limit for a resource of 9,999 you may buy some extra units, or better yet, put a large stack of it for sale on the marketplace. Goods on the marketplace do not count in your storage totals.