Class Index | File Index

Classes


Built-In Namespace _global_

Field Summary
Field Attributes Field Name and Description
 
Boolean to check that it is the first run
if it is the first run load the image
and if not --> don't load it
 
Hold the path of the image
Method Summary
Method Attributes Method Name and Description
 
called in case of error in capturing photo.
 
Capture image using native camera application.
 
captureSuccess(mediaFiles)
Called in success of capturing photo.
 
fail(e)
called in case of error.
 
gotFile(file)
read the path of the image and show it in HTML.
 
gotFileEntry(fileEntry)
Called when succeeded in opening file system.
 
gotFileWriter(writer)
Write the path of the image to the text file named save.txt.
 
gotFS(fileSystem)
request to open the file named save.txt on sd card.
 
Used to load image after the page load.
 
Called when the device become ready to work with GPS.
 
uploadFile(mediaFiles)
upload file to server and show the image in HTML.
Field Detail
first_run
Boolean to check that it is the first run
if it is the first run load the image
and if not --> don't load it
Defined in: javascript.js.

path
Hold the path of the image
Defined in: javascript.js.
Method Detail
{void} captureError(e)
called in case of error in capturing photo.
Description
printing the error code and the type of it
Defined in: javascript.js.
Parameters:
{Object} e
error code and type
Returns:
{void}

{void} captureImage()
Capture image using native camera application.
Description
Use the camera of the device to capture photo
if it successed in capturing it call captureSuccess else call captureError
Defined in: javascript.js.
Returns:
{void}

{void} captureSuccess(mediaFiles)
Called in success of capturing photo.
Description
if there are many captures upload them on device memory using function uploadFile
Defined in: javascript.js.
Parameters:
{Object} mediaFiles
Encapsulates properties of a media capture file
hold properties like name of the file, fullPath, lastModifiedDate and size
Returns:
{void}

{void} fail(e)
called in case of error.
Description
printing the error code and the type of it
Defined in: javascript.js.
Parameters:
{Object} e
error code and type
Returns:
{void}

{void} gotFile(file)
read the path of the image and show it in HTML.
Description
used in two situation
1. when the application load and viewing the last captured image 2. when successfully capture the image and viewing it
Defined in: javascript.js.
Parameters:
{Object} file
reference to text file that contains the path of the image
Returns:
{void}

{void} gotFileEntry(fileEntry)
Called when succeeded in opening file system.
Description
if it is the first time to run the application it will load the last image else then get permission to write the new path and call gotFileWriter
Defined in: javascript.js.
Parameters:
{Object} fileEntry
reference to text file that contains the path of the image
Returns:
{void}

{void} gotFileWriter(writer)
Write the path of the image to the text file named save.txt.

Defined in: javascript.js.
Parameters:
{Object} writer
reference to the writer that will write to save.txt
Returns:
{void}

{void} gotFS(fileSystem)
request to open the file named save.txt on sd card.
Description
create the file if it is not found and open it if it is found
if succeeded in open the file system then call gotFileEntry if not call fail
Defined in: javascript.js.
Parameters:
{Object} fileSystem
reference to the root of the file system
Returns:
{void}

{void} loadImg()
Used to load image after the page load.
Description
It make request to open the file system If it is successed in opening the file system call gotFS
If not call fail
Defined in: javascript.js.
Returns:
{void}

{void} onDeviceReady()
Called when the device become ready to work with GPS.
Description
if it is the first time to run the application so load the last image
Defined in: javascript.js.
Returns:
{void}

{void} uploadFile(mediaFiles)
upload file to server and show the image in HTML.
Description
get the path of the photo and view it using div with id=IMG_1 then request write to file system to write the new path of the image in the file
if succeeded in open the file system then call gotFS if not call fail
Defined in: javascript.js.
Parameters:
{Object} mediaFiles
Encapsulates properties of a media capture file
hold properties like name of the file, fullPath, lastModifiedDate and size
Returns:
{void}

Documentation generated by JsDoc Toolkit 2.4.0 on Tue Jul 24 2012 16:03:04 GMT+0200 (GMT+02:00)