android-simple/HelloWorld.java

27 lines
727 B
Java

import helloworld.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;
import java.net.HttpURLConnection;
import java.net.URL;
public class HelloWorld extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
try {
URL url = new URL("https://slcl.privatedns.org");
HttpURLConnection urlConnection = (HttpURLConnection) url.openConnection();
} catch (Exception e) {
//TODO: handle exception
}
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
TextView text = (TextView)findViewById(R.id.my_text);
text.setText("Hello, world!");
}
}