|
|
|
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 >>
When you make a surveillance application, you assume that it will run for a long period of time and you need to save energy and screen resources.
To do this, you need to create a program code that will control the brightness of the screen.
When the application is just launched and when you need to make settings, the screen has the brightness level set in Android.
When the application starts a photo session, you need to make the screen as dark as possible.
We will provide a special button in the application to turn on the minimum brightness and normal screen brightness. Let's write some simple Java code for this button:
//==========================================================
// Make DARK / LIGHT screen
//==========================================================
public void onButton4eClick(View view) {
if (Dark == 1) {
Dark = 0; // Make a dark screen
} else {
Dark = 1; // Make a light screen
}
//// Screen brightness control while the app is running
Intent brightnessIntent = this.getIntent();
float brightness = brightnessIntent.getFloatExtra("brightness value", Dark); // = 0 - dark screen, = 1 - light screen <- 1-225
WindowManager.LayoutParams lp = getWindow().getAttributes();
lp.screenBrightness = brightness;
getWindow().setAttributes(lp);
}
The first part of the procedure is just a trigger
if (Dark == 1) {
Dark = 0; // Make a dark screen
} else {
Dark = 1; // Make a light screen
}
The value brightness = 0 is the darkest screen. But this is not a completely dark screen. When the ambient light level is very low, the buttons and images will be visible on the screen.
getWindow().setAttributes(lp); - Apply the specified screen parameters
At minimum screen brightness, all application buttons work. You can press the brightness control button and everything will be visible again as usual.
This is not very convenient, but you will not have to switch between screen brightness modes often.
dnl0004.htm - Office desktop control
dnl0005.htm - source code ftpConnect
dnl0006.htm - source code ftpDisconnect
dnl0007.htm - source code Upload file to FTP server
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
|
|
|
|