|
|
|
Android FTP Connection
Android Source Code
Java program for surveillance using an Android smartphone. Webcam with FTP access to the photo storage.
After connecting to the server via FTP protocol, you can start downloading the file. Downloading a file via LTE mobile Internet can take 350 seconds or more. If the connection is lost during this time, you will be able to see a picture on the web page, part of which will be dark.
If the connection is made via Wi-Fi, the download speed will be much higher. The connection type is configured in the smartphone settings.
After the download of the file to the webserver is finished, the disconnect from the server is performed.
//==============================================
// Disconnect from ftp server
//==============================================
public boolean ftpDisconnect() {
try {
mFTPClient.logout();
mFTPClient.disconnect();
Log.d(TAG, "== == Disconnect from ftp server == ==");
return true;
} catch (Exception e) {
Log.d(TAG, "== == Error disconnecting == ==");
}
return false;
}
Everything is done here as standard. Nothing out of the ordinary. The disconnection may not be completed if the cellular connection is lost.
This is not a problem for the application to work.
Even if the disconnect procedure is not performed, the webserver will close the connection after a while. This is configured by hosting specialists. When the next image needs to be loaded, the Rescue PHOTO app will automatically connect to the webserver again.
Android Safety SYSTEM >>
You can use the web page with HTML and Java Script code. Such a web page can be hosted on any hosting. Or use the PHP web page and get more information. But then your free or paid hosting must support PHP.
Android Source Code >>
The application has complex Java code. The source code spans several pages. Source codes of application modules are available on GitHub.
|
|
|
|