Obviously, I could level up faster as a trainer by playing all day long; but that is hardly feasible. There are various activities that give XP, some of them are controllable (like winning in gym battles) and others are somewhat random (getting a new pokemon).
Other than normal gameplay like capturing all the Pokemon I see, what actions lead to more efficient xp gain? Esp. when it comes to using limited resources - e.g. I will run low on potions if I battle often, should I focus on friendly challenges or gym takeovers to efficiently use my potions?