Вы находитесь на странице: 1из 9

O.P.I.S.

Receiving Android Application


Develop an Android application for Amazon Kindle Fire to be used by personnel in the

Receiving area to process incoming raw materials and RGA returns from the customers. The

application requires the ability to read barcodes, take pictures of products and submit information

to central Data Base Server over RESTfull API.

Phase 1: Implement cURL class to call RESTfull API

Interface cURLIO

Define an interface cURLIO.

public JSONObject getURL( String parameters ) - accept some parameters for the GET call

to the remote REST API, retrieve response as a JSON Object

public JSONObject postURL ( String parameters, JSONObject payload) – accept payload

and parameters to be posted to remote REST API endpoint

Class cURL

Class cURL extends AsyncTask class so our API calls could be performed in the background of

the application

DATA

• private static URL url – base URI of the remote REST API endpoint
• Private static String parameters - parameters for the POST or GET call, depends on

the remote REST API endpoint specifications.

• Private static String APIKey – string containing Remote REST API authentification

key

METHODS

• Constructors

o Default Constructor – does absolutely nothing

o cURL(URL url, String apiKey) – sets Base URI and API key for the calls to

REST API

• Public static JSONObject getURL (String parameters ) – accepts parameters to be

used for the GET call to remote REST API endpoint

• Public static JSONObject postURL (String parameters, JSONObject payload) –

takes parameters and payload to be POSTed to the remote API endpoint

Phase 2: Implement BarCode Reader class

Interface BarCodeReaderIO

• Public boolean scan() – capture image

• Public boolean translateImageToText() – translate image to text

• Public String returnText() – return text string

Class BarCodereader
Uses ML Kit from FireBase google API

DATA

• Private static FirebaseVisionImage image - FireBase image instance

• Private static String imgText – text retrieved after decoding image

METHODS

• Public static boolean scan() – a method that calls FireBase ML Kit to capture barcode

image, return true if the image captured successfully and it contains a readable barcode

• Public static boolean translateImageToText() – retrieves text from the barcode image

• Public static String returnText() – returns decoded barcode image text

Phase 3: Implement Main OPIS class

Main Action class of the application

DATA

• Private String APIKey - authentification key for REST API

• Private String employeeID – employee ID string

• Private URL dbURI – URI of REST API endpoint

METHODS

• Public void mainActivity() – main activity method

• Public void goToFG() – on Finish Goods button press go to Finished Goods screen

• Public void goToRM() – on Raw Materials button press go to Raw Materials screen
• Public boolean onAPIKeysubmit() – sets up APIkey, returns true if API key is valid

• Public boolean onEmployeeIDSubmit() – sets employeeID returns true if valid

EmployeeID

Phase 4: Implement Inventory abstract class

Abstract inventory class to be used by FinishGoods and RawMaterial classes

DATA

• Private String partNumber – inventory part number

• Private String partUUID – inventory part unique Identifier

• Private int qty – quantity of inventory part

• Private int inventoryQty- qty in inventory

• Private JSONObject partJSON – part JSON object

METHODS

• Public boolean addInventory() – adds inventory quantity, returns true if the valid

operation

• Public Boolean subInventory() – subtracts inventory quantity returns true if the valid

operation

• Private void setPartUUID() – sets part UUID

• Private Boolean isValidPart() - makes a call via REST API and sets JSONObject part

if exists returns false if JSONObject is empty


Phase 6: Implement RawMaterial class

DATA

• Private String PONumber – PO number

• Private int qtyonPO – qty of the part on the PO

METHODS

• Public boolean setPONumber() – set PO number, make a REST call to check if valid

PO retrieve PO quantity.

• Private boolean setPOqty() – sets qty on PO

• Public boolean setQty() - sets part qty if it does not exceds qty on PO

Phase 7: Implement FinishGoods class

DATA

• Private String rgaNumber – authorized return number

• Private String serialNumber – part serial number

METHODS

• Public Boolean setRGA(String RGA number) – sets RGA number if it exists in the

database, Makes a call via REST API to check RGA number, part quantity and serial

number, returns true if matches to stored values of RGA number

• Public Boolean setSerialNumber(String serialNumber) – sets the serial number of

received part, returns true if serial number matches number from RGA
Phase 8: Implement FG_Activity class

DATA

• Private FinishGoods part – Finish Goods Object

METHODS

• Public void onUPCScan() – on button press utilizes BarCodeREaderIO interface to

make a call to ML Kit

• Public void onSerialNumberScan() – on button press utilizes BarCodeREaderIO

interface to create a call to ML Kit to scan the serial number

• Public void onRGAEnter() – process RGA number entry, perform part number

validation

• Public void onFGSubmit() - process Finish Good part submit. Add the part to

inventory.

Phase 9: Implement RM_Activity class

DATA
• Private RawMaterials part – Raw Materials Object

METHODS
• Public void onPartNumberEnter() – on part number entry create RawMaterial Object

• Public void onPONumberEnter() – on PO entry validate part quantity

• Public void onRMSubmit() – Add the part to the inventory


Phase 10: Testing Application

As we have no access to the REST API endpoint or example data, we need to make sure that
program works with generic API endpoints. As customer give us access to more detailed
information and resources, we will be able to expend test scenarios and more features to the
application.
Model

OPIS

- APIKey: String
- employeeID: String
- dbURI: URL

+ mainActivity():void
+ goToFG(): void
+ goToRM(): void
Controller + onAPIKeysubmit(): boolean View
+ onEmployeeIDSubmit(): boolean

Inventory
FG_Activity RM_Activity
- partNumber: String
- partUUID: String
- qty : int - part: FinishGoods -part: RawMaterials
- inventoryQty: int
- partJSON: JSONObject

+ addInventory(): boolean + onUPCScan(): void + onPartNumberEnter(): void


+ subInventory(): boolean + onSerialNumberScan(): void + onPONumberEnter(): void
- setPartUUID(): void + onRGAEnter(): void + onRMSubmit(): void
- isValidPart(): boolean + onFGSubmit(): void

FinishGoods RawMaterial

- rgaNumber: String - poNumber: String


- serialNumber: String - qtyonPO: int

+FinishGoods(): constructor
+ RawMaterial(): constructor
+FinishGoods(String partNumber):
+ RawMaterial(String partNumber): constructor
constructor
+ setPONumber(String PONumber): boolean
+setRGA(String rgaNumber): boolean
- setPOqty(): boolean
+setSerialNumbe(String serialNumbe):
+ setQty(int qty) : boolean
boolean

cURLIO Interface BarCodeReaderIO Interface

+ scan(): boolean
+ getURL(String parameters): JSONObject
+ postURL(String parameters ,JSONObject payload): JSONObject + translateImageToText() : boolean
+ returnText(): String
cURL BarCodeReader

- image:FirebaseVisionImage
- url : URL
- imgText:String
- parametrs :Strimg
- payload: JSONObject
- APIKey: String + scan(): boolean
+ boolean translateImageToText(): boolean
+ string returnText()
+ cURL(): constructor
+ cURL(URL url, String apiKey): constructor
+ getURL(String parameters): JSONObject
+ postURL(String parameters ,JSONObject payload): JSONObject
Firebase

FirebaseVisionBarcode
AsyncTask FirebaseVisionImage

Вам также может понравиться