430 likes | 777 Views
Software graduation project. Smart Virtual Store . Prepared by Yaman A. Salman Eman M. Masarweh . 2012. Outline . What is Virtual store. What is QR code QR Generator . QR Reader . Mobile application . Communication Between Customer and Server.
E N D
Software graduation project Smart Virtual Store Prepared by Yaman A. Salman Eman M. Masarweh 2012
Outline • What is Virtual store. • What is QR code • QR Generator . • QR Reader . • Mobile application . • Communication Between Customer and Server. • Server of Smart Virtual Store. • Smart Virtual Store Website
Motivation Today, we live in a world of fast paced. People do not have time to spare. Thus, we yearn for comfort. Most of us are too busy, and we do not have enough time even to go to the grocery store. For this reasons, we created a Smart Virtual Store to make shopping easier and faster.
Achievements • QR Generator. • Mobile application scan a QR code and form orders of products. • Server with desktop application that receive orders . • Website .
We mean by Virtual Store , there is no physical products on shelves just images of it on boards. Virtual Stores can be Found in Subways, Streets and Garages
Overview Customr 1 2 Vistor
What is QR code ?! • Qrcode (Quick Response ) is two dimensional barcode . • A QR Code stores data in both vertical and horizontal directions and hence has more storage capacity per unit area.
What is QR code • QR codes are readable from any direction and that data stored inside QR codes can be restored even if the corresponding image is partially damaged.
QR Generator • We generate the QR Code that encode a string entered text . Features of QR Generator : • Encode mode. • Version . • Error correction . • Structure of QR code symbol.
How to encode • Capacity :Capacity of a QR code is determined by version ,error correcting level and encoding mode . • Encode to data code words. • Calculating error correcting code words : this blocks of redundant data ensure that the QR code can still be read even if a portion of it is unreadable. • After step 1 , 2 , 3 : data and Ec code words converted to Binary in order to put them in the QR code.
How to encode • Data allocation :we allocate encoded data , fixed pattern ,timing pattern . • Mask pattern . • Format information :Format information includes error correcting level and mask pattern .
QR generator in our project • In our project build a C# desktop application that can take a text data as input and output QR code image of that input after make all previous operations on data to produce QR code . • Using generator in our project to produce QRcode image for each product in store .
QR Reader • The QR Code reader used to decode a QRCode image generated via the generator we made , or any generated image by other QR generators .
1010111011001111000110010101 Bitmap image Get finder pattern, alignment pattern 0’s & 1’s Grid Get rest of img as data matrix Using Reed Solomon Algo. Get data blocks only Get decoded Bytes ASCCI String
Mobile Application • With our mobile application customer can capture image of product’s QRcode he want to purchase ,select the quantity needed and time of delivery , determine his address and send order to server ,then reply message from server arrived .
Implementation • We implement this part by creating a j2me application using net beans program it contains : • Forms , Displays , Controls , lists ,radio buttons .
Implementation • Capture image with specified Resolution , using video control and player . Some Details: 1- Getting a Video Capture Player: The first step in taking pictures (officially called video capture) in a MIDlet is obtaining a Player from the Manager. A special locator(capture://video), indicates that pictures will be captured from the camera using a default image size. mPlayer = Manager.createPlayer("capture://video");
Implementation The Player needs to be realized to obtain the resources that are needed to take pictures. mPlayer.realize(); 2- Showing the Camera Video The video coming from the camera can be displayed on the screen either as an Item in a Form or as part of a Canvas. A VideoControl makes this possible. To get a VideoControl, just ask the Player for it: mVideoControl = (VideoControl) mPlayer.getControl("VideoControl");
Implementation To show the video coming from the camera in a Canvas, we initialize the VideoControl, then set the size and location of the video in the Canvas, then make the video visible. canvas = new CameraCanvas(this); // initialize video control videoControl.initDisplayMode(VideoControl.USE_DIRECT_VIDEO, canvas); videoControl.setDisplayFullScreen(true); videoControl.setVisible(true);
Implementation 3- Capturing an Image • Once the camera video is shown on the device, capturing an image is easy. All you need to do is call VideoControl'sgetSnapshot() method. You'll need to pass an image type, or null for the default type. • The getSnapshot() method returns an array of bytes, which is the image data in the format you requested. What you do at this point is up to you • byte[] raw = mVideoControl.getSnapshot(encodingBest); • Image image = Image.createImage(raw, 0, raw.length);
Implementation • using QR Decoder decode image and return the result ,QR Decoder is java class in the app QRCodeDecoder decoder = new QRCodeDecoder(); result = new String(decoder.decode(new J2MEImage(image))); • Code to send SMS to the server mobile . • Sending URL with parameters to the web site
Problems & Solutions • P: QRcode reader in mobile application faced some problems in scanning the image taken by mobile, so some times it can’t return a correct result for reading. • S: In order to avoid this problem we try capture the image in a better elimination environment.
Problems & Solutions • also we deal with the resolution of captured image in the code • String encodingString = System.getProperty("video.snapshot.encodings"); • String encodingBest= findBestEncoding(encodingString); findBestEncoding : is a user function that read the encoding type , width and height of the images that the mobile can capture, and pass this encoding to capture image method. This will improve the resolution of captured image .
We use sandbox PayPal account (virtual) so buyer and customer can pay the total price of the order , money is cashed into server PayPal account .
Communication Between Customer and Server. • We use short messages service ( SMS) as a communication tool from the customer mobile (using our j2me app) to the server mobile and vice versa. • in communication we use: • Server mobile. • AT commands
AT Command • For send message, write this code: • For read messages stored on the mobile, write this code:
Server of Virtual StoreSto. • It is C# application placed in the market machine to serve requests from customers when they send their orders via their phones. • After a message reach to the server ,this message contains the items the customer order and basic info about customer ,server will store this info in its data base and after make sure that customer ‘s order is stored .
server will send an acknowledgment message to customer mobile that tell him to wait the items.
Smart Virtual Store Website • Customers can sign up for a personal accounts, put their information needed by the application, so they be able to skip some of the data entry steps in the application. Just by sign in to the account from the mobile application then start purchasing items . • website receive order and stored it ,then continue the payment process automatically based on paypal account of user stored in his Smart Virtual Store account .
Cont • Customer can sign in to his profile , view his Purchases during a specified period of time , or since he register in the Store and edit his Information . • Anyone can register the site, website send email to this person on the membership confirmation.