PDA

View Full Version : Random Generator for Androidx86 in Qt5



alexo
7th September 2014, 22:17
hi,
I made a prog which uses a random generator like srand(time(0)); and rand().
This works fine under win7 but the target-system is android but it doesn't work on it.
The app starts but there are no random numbers.
It seems to return '0' (zero) all the time!

Does anyone know how I can create random numbers under android?
It's a simple app, so it don't have to the best/complex generator.

P.S.
This is my first Qwidget-prog and my first useable c++ prog.
So please explain complex syntax.

anda_skoa
8th September 2014, 06:30
You could check if qsrand() and qrand() have the necessary adaptions for work on Android.

Cheers,
_