I can do it assuming this is the only task,as the task is only :
1_generate key for the result.
2_there are 2 cases(you choose one way):2.1 &2.2
2.1_user login with the key
3.1_program checksin my database if everything is ok then continue,,,else we generate one or whatever you want
2.2_first time using we ask for the key,so get one or put your one then we write into a file stored somewhere a sign(i prefer something in hexa with a wirde extention)
_and this is only_ wanna use JDBC connectors in my code.
I didn't experienced python for android ,only for win, but according to the task it seems i won't need more to know.(Used java for android before)so in few words:the task is to just write some functions.
The DataBase Table is provided for free from tested-before site