Coder Social home page Coder Social logo

nolenfelten / yardsale Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zaffra/yardsale

0.0 2.0 0.0 654 KB

An Android app that demonstrates scanning QR Codes with ZXing and performing in-app payments with PayPal's Android Mobile Payments Library

Java 100.00%

yardsale's Introduction

YardSale

This example application illustrates how to use the ZXing library to scan a QR Code, fetch JSON data from a server and convert it into a Java object using Gson, and perform an in-app payment as part of a yard sale workflow. It is highly recommended that you review highlights from the Android Fundamentals document before attempting to adapt this source code.

In a little more detail:

  • You assemble and manage an inventory for your yard sale in a web application. (Note: The YardSale project does not include a web application for managing inventory and instead opts to use a static file to simulate a server response. See the Inquire or Donate projects for extensive examples of implementing Python-powered GAE projects that are easily adaptable for the purpose of managing an inventory.) The web application serves up items using a simple JSON format that provides pertinent item details accessible via a simple URL such as http://example.com/yardsale/123.json to access an item with id 123
  • You use Google's Chart APIs to create QR codes for each of the item URLs so that you can print out labels and attach them to items in the same way that ordinary store fronts operate. For example, the sample data.json file provided with this project is accessible as a QR Code via http://chart.apis.google.com/chart?cht=qr&chs=300x300&chl=http%3A//github.com/zaffra/YardSale/raw/master/item.json&chld=H|0 -- see the official docs for more details on the Google Chart APIs.
  • Potential buyers scan the QR Codes with their Android capable smartphone to view details and potentially purchase the item using PayPal

Building and running the project =

There are only a couple of dependencies that you'll need to add to your proejct's build path in Eclipse to build the project:

  • PayPal's Android MPL - Used to perform in-app purchases with PayPal
  • Gson - Used to convert JSON data from remote servers to Java objects
  • ZXing - Provides barcode scanner functionality that your app can use via an Android Intent. You actually don't have to add this dependency, because it is implemented to install the Barcode Scanner app on-demand so that it can use ZXing via Android's Intent mechanisms. However, it would be trivial to modify the app and package ZXing if you'd prefer to packageit.

The application code makes no particular assumption about specific hardware or screen real estate and was tested on a Motorola Xoom using Android 3.0.1. Note that it must be run on physical hardware to invoke scanning functionality since the Android emulator does not support camera functionality. You could, however, minimally modify the source code to run on the emulator by simulating that a scan takes place in the Scanner.java source file.

Extending the app

Fun ways to extend this app to a realworld point-of-sale system and compete in PayPal's Android Developer Challenge might include:

  • Implementing a server app to log inventory as opposed to using the mock JSON data source. You might try writing a separate Android client using ZXing to scan barcodes on items and pass them to a server application as part of a web services workflow as opposed to manually typing them in. Amazon's ItemLookup operation may be useful in resolving ISBNs to relevant details that you'd want to store and provide reasonable suggestions for item prices
  • Assuming you implement a web server, try using IPNs to remove items from your inventory when items are purchased to keep a realtime inventory that you don't have to update when items are sold.

Provided by: Zaffra, LLC

yardsale's People

Contributors

zaffra avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.