We develop an object recognition app and deploy the app
onto Android platform. The IDE to code the app is Eclipse and
the programming language is Java.
The app’s architecture has five main classes, including
HomeInterface, CameraView, AndroidExplorer, Inquiry and
IQEngine classes. HomeInterface defines home interface of the
app. CameraView is responsible for creating device’s camera
interface. The CameraView can be considered as a client for
the camera service, which manages the camera stream released
from camera hardware. AndroidExplorer helps users select the
available image file to upload to IQEngine server. Inquiry
initiates an API object using API key and secret, queries the
image, retrieves the result in JSON format and decode JSON
object into String object. IQEngine creates the package (e.g.
the timestamp, image, API key and API signature) and sends
the request to IQEngine server.
Android SDK provides developers with
android.hardware.Camera to access the device’s camera and
Android.view.SurfaceHolder and Android.view.SurfaceView to
build camera preview. The preview must be started before we
capture a picture and closed after the picture is taken.
Developers also have to write the code in
Camera.picture.callback to encode camera stream and store the
image onto device’s storage as soon as the image is captured.