ich will Web-Service mit PHP-Code, PHP-Datei mit dem Text erstellen, und ich will diesen Text android textVeiwAndroid Webservices mit PHP
I Verbindung mit URL über openconnection() zeigen, aber ich habe Fehler in der Klasse Input
public class MainActivity extends AppCompatActivity {
TextView text;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
text = (TextView) findViewById(R.id.textView4);
}
public void onClick(View view) throws Exception {
URL hellofileurl = null;
try {
hellofileurl = new URL("http://waaddev.ahosti.net/web.php");
HttpURLConnection myfirstconnection = (HttpURLConnection) hellofileurl.openConnection();
InputStream stream = new InputStream(myfirstconnection.getInputStream());//i have error in this line
BufferedReader b = new BufferedReader(stream);
String hello = b.readLine();
} catch (Exception e) {
e.printStackTrace();
}
}
}
Welche Art von Ausnahme erhalten Sie? Bitte geben Sie ein bisschen mehr Informationen ... – Fortega