|
|
|
Android Write Resource
Android Source Code
Java program for surveillance using an Android smartphone. Webcam with FTP access to the photo storage.
Android Safety SYSTEM >>
The Rescue PHOTO application uses many variables - FTP server address, login, password, enable and disable times, etc. You need to make sure that these parameters are saved after turning off the application or smartphone.
We will save the variables in the Application Resources. How to read the recorded data was shown on the previous page dnl0008.htm. Here is the Java source code:
Editor ed = sPref.edit(); //To edit data, you need an Editor object - we get it from sPref
ed.putString(FTP_TEXT, host); //In the putString method, we specify the name of the variable - this is the FTP_TEXT constant and the value
ed.putString(LOGIN_TEXT, username); //In the putString method, we specify the name of the variable - this is the LOGIN_TEXT constant, and the value
ed.putString(PASSWORD_TEXT, password);
ed.putString(FOLDER_TEXT, desDirectory);
ed.putString(FTIME_TEXT, ftime);
ed.putString(STIME_TEXT, stime);
ed.putString(ETIME_TEXT, etime);
ed.putString(FNAME_TEXT, desFileName);
ed.putString(INUMBER_TEXT, inumber);
ed.commit(); // Saving data in resources
Preferences. The values are stored as a pair: name, value. We set the name and then we specify the name of the variable containing the value.
To edit data, you need an Editor object - we get it from sPref.
Editor ed = sPref.edit();
In the putString method, we specify the name of the variable - this is the FTP_TEXT constant, and the value is the content of the host field. To save the data, you need to commit. And for clarity, we display a message that the data has been saved.
If you need to make sure that saving and loading occurs automatically when the application is closed and opened and there is no need to press the buttons, then for this the write or read method must be called in .
The MODE_PRIVATE constant is used to configure access and means that after saving, the data will be visible only to this application.
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 >> Sitemap >>
The application has complex Java code. The source code spans several pages. Source codes of application modules are available on GitHub.
The Wayback Machine is an initiative of the Internet Archive, a 501(c)(3) non-profit, building a digital library of Internet sites and other cultural artifacts in digital form.
Android Write Resource
|
|
|
|