About your first question, it depends. Some people can eat a meal 30 minutes before training and do ok, others might feel burden in stomach if they eat 90 minutes prior to activity.
If you are having cramps, try eat little bit earlier. Maybe, you can even schedule your meals in the way you don't need dedicated pre-workout meal (high carb intake during the day).
Point is to have adequate level of glucoses (sugar) in you muscles. If you have replenished it during the day, you don't need pre-workout meal (unless, and it is big unless, you feel hungry - never do anything hungry).
What is the best food to eat before training? Carbs. Simple or complex? If you eat 0-30 minutes before activity, I would suggest simple carbs combined with some kind of complex carbs (e.g. two or more slices of bread with jam / chocolate bar with banana). Otherwise, complex (e.g. oats / maize). However, please do note that some people feel crashed or fatigue if they eat simple carbs before activity. Problem with them is they can't provide sustained energy (that's the job of complex carbs) and if you didn't back them up with more reliable source of energy, it just won't work (in some cases, people said simple carbs before training gave them cramps, so...)
Other approach might be to eat during the training. You can buy dextrose powder and mix it in your water (or with water and proteins if you're using them). Alternative could be to eat small amounts of raisins during training session.