|
|
|
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 timer is essential for the application to function Rescue PHOTO. The timer starts the camera, connects to the FTP server, copies the file, disconnects the server, and waits for the next picture.
Minimum procedure for working with a timer:
//==== Timer operation ===================
timer = new Timer();
mTimerTask = new MyTimerTask();
// Timer start
timer.schedule(mTimerTask, 1000, 1000); // We perform the action with a delay of 1 second
// delay - how much to start
// period - how many times to repeat
//==========================================
Nothing prevents you from using multiple timers in the application.
In Android, many important actions are performed using callbacks. For example, when using a camera. They can be used when various events occur.
When a photo is copied to the FTP server, the end of copying also triggers an event. This can be handled.
However, if you are using mobile internet, you need to take into account that traffic is limited and you cannot upload photos to the server too often.
And here it is already necessary to check two conditions. If the photo is uploaded to the FTP server, you need to wait until the next operation of the camera starts. If the photo is taken and it takes a very long time to upload to the FTP server, then the timer should be increased. But here you need to use a second timer, so that the waiting period for the upload of a photo does not become eternal.
TimerTask mTimerTask; - Announce timer
Stop timer
timer.cancel();
timer = null;
Log.i(TAG, "==== Timer STOPED ===="); // Writing a message to LOG
Android Handler
|
|
|
|
|
|
|
Application Rescue PHOTO has significant commercial potential. A huge number of old and damaged smartphones are sent to a distant box, landfill or recycling, without creating any cashback for you. Having zero cost, such smartphones can be used for photographic observation of objects via the Internet. Those. can be used to create low-cost commercial products. A company that creates such software can have positive dynamics in the market. Using the basic software product Rescue PHOTO in Java, you can create software for any needs of your customers.
Many useful functions can be added to the basic Java code based on additional agreements with clients. This allows you to monetize the free Rescue PHOTO remote surveillance app.
|
|
|
|