It is technically possible to use a dynamo to charge your phone while riding, but it requires a special adapter and can be quite difficult to set up. Additionally, using a dynamo to charge your phone may not be very efficient and could drain your bike's battery quickly.