This is not possible from the MainThread. I tried it yesterday and got a NetworkOnMainThread exception.