Home >Backend Development >PHP Tutorial >javascript - Android connects to an existing php service, how to execute it?

javascript - Android connects to an existing php service, how to execute it?

WBOY
WBOYOriginal
2016-08-04 09:20:57830browse

Hello everyone,
I have recently started practicing writing programs.
I want to make an Android program to execute an existing network service.
That network service probably requires logging in with a user account and password, and you can enter it by clicking Press Execute to print the report and print out to pdf or excel.
How would you seniors complete this program?
Grateful

Reply content:

Hello everyone,
I have recently started practicing writing programs.
I want to make an Android program to execute an existing network service.
That network service probably requires logging in with a user account and password, and you can enter it by clicking Press Execute to print the report and print out to pdf or excel.
How would you seniors complete this program?
Grateful

If this php service is a web page and does not have any special functions, you can directly use a WebView to load the web page.

Or just roughly follow the steps below:

  1. Clear the functions, and then determine the API provided by the server

  2. Writing Android interface and business, network connection can use frameworks such as OkHttp, Retrofit, AndroidAsyncHttp.

Get the web page source code directly and use jsoup to parse it. If the web page data is obtained dynamically using js, then just grab the api called by js.

Just use webview. If you don’t mind it, just embed a browser

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn