I would suggest creating a sort of splash screen where you load all of your data and populate your data structure. Once this task completes, I would spawn a new activity that contains your UI controls. Java and subsequently Android are event driven in nature. Once you have your UI set up, you will need to register a listener with your button object that will be fired automatically when it is clicked. Inside this listener, you will need to spawn off a new thread that will perform the network related code. When the code completes, you will need to use a Handler object to notify the UI thread that it has completed and to display the result. Rather than using a Thread and Handler object, you can simplify things by using Android's built-in AsyncTask which handles all of the threading issues for you.
My blog, Inverted Keystrokes
, is looking for aspiring developers (not necessarily with Android) to post articles. If you have any development experience and are interested in participating, please PM me. =)