You may have planned a hiking trip, but you may not know until the day before that the rain is likely to ruin the party. So the question becomes: how are you going to save the weekend?

People facing this scenario can now use The Weather Channel app to get recommendations for things to do and places to see that are compatible with the weather forecast. The new functionality works thanks to a collaboration between The Weather Company and Needham-based TripAdvisor, which announced the partnership on Wednesday.

The new feature, which currently works only for the Samsung version of The Weather Channel app, uses machine learning to synchronize calendar events, weather forecasts and more than 830,000 TripAdvisor attractions. The system is trained to help users avoid the risk of getting wet during an outdoor activity, as well as missing the sunshine because of a scheduled trip to museums.

A screenshot of how TripAdvisor will integrate its recommendations within The Weather Channel Made for Samsung App. Photo courtesy of TripAdvisor.

According to The Weather Company, if it’s expected to rain and users had planned to go biking, they may see a TripAdvisor recommendation within their calendar to visit a museum. However, if it’s expected to be warm and sunny, rather than go to a movie, they may see a recommendation for a boating or walking tour.

The algorithms recommend relevant activities within a 25-mile radius. If users tap on the recommended activity, they will be redirected to TripAdvisor’s website for additional details including reviews, photos and tour booking options.

“While consumers may be in control of their travel plans, they aren’t in control of the weather they encounter on vacation,” Nicole Brown, senior director of TripAdvisor brand partnerships, said in a statement. “Through our collaboration with The Weather Company, we aim to provide Made for Samsung App users with quick and easy recommendations for great things to do – rain or shine – based on millions of reviews and opinions on TripAdvisor.”

The Weather Channel app, which is specifically designed for Samsung smartphones (including the Galaxy Note8, Galaxy S8 and Galaxy S8+), is accessible within the Galaxy Apps store. The new TripAdvisor feature is now available for app users globally, The Weather Company said.