vendredi 25 novembre 2016

Reading a text file from internet, choosing random line and converting into uri value

how can I

1) Read text file from internet 2) choosing random line 3) Then converting it in uri value

Here are my answers. Are they correct? Are there better alternatives?

1&2)

Uri testUri = Uri.parse(random.choice(open((new URL("http://example.com")).openStream())').readlines()))

Thank you a lot <3




Aucun commentaire:

Enregistrer un commentaire