The wearable devices market has been growing exponentially in the last few years and it is expected to count up to 930 million devices by the end of 2021. A common application of wearable devices is Human Activity Recognition (HAR), i.e., the ability of using the sensing capabilities of these devices to monitor and infer human activities. However, Animal Activity Recognition (AAR) has received significantly less attention, and most works on AAR are generally based on invasive specialized devices carried by or implanted on animals. Conversely, in this work we exploit the potential of portable and unobtrusive devices, namely smartwatches, for AAR and specifically for horse gaits recognition. This application finds natural use in horse riding, to improve the structure and balance of the horse work and training. We develop a framework that can be used in a fog computing system composed by a smartphone and a smartwatch for the recognition of horse gaits. The framework performs classification by means of a machine learning approach trained on ad-hoc features based on accelerometer data. The framework allows an offline and an online modes of operation. In the offline mode, the smartwatch is used to collect the accelerometer data and transfer it to the smartphone at the end of the riding session. The feature extraction and classification can be processed directly on the smartphone or offloaded to the cloud. Conversely, in the online mode, the smartwatch is responsible to collect and process the data, thus being able to provide real-time feedback to the rider. This modality also allows to reduce computation, storage, and energy burden on the smartwatch through an adaptive setting of the sampling frequency. We implement our approach on a system composed by a Fitbit Ionic smartwatch and a Samsung Galaxy S10. We use two horses to evaluate the performance, versus recently proposed AAR approaches. Results show that our framework achieves significantly higher classification accuracy. Furthermore, the online scheme enables flexible real-time feedback, at the expense of a small loss in the classification accuracy.