Is it possible from an Android App within Android Runtime to enter text in a texfield of a website and trigger a button click on that site programmatically? This little App has a Button, after clicking that Button chrome is opened with a website.
import android.content.Intent;
import android.net.Uri;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
public class MainActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Button mybutton = (Button) findViewById(R.id.button);
mybutton.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
String url = "https://www.bahn.de/p/view/index.shtml";
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
}
});
}
}
This website has textfields to enter text. But how can they be accessed?