Code Monkey home page Code Monkey logo

stockhawk's Introduction

stockhawk's People

Contributors

pajatopmr avatar

Watchers

 avatar  avatar

stockhawk's Issues

4.0 Add a price tracking feature over a date range.

From the main screen, tap to see details for each selected stock. On a tablet, show these by details by default. Use the overflow menu to select by hour, day, week, month, year or decade. Use a graph/text icon menu option to toggle the display between chart and text. Ensure that accessibility is taken into account.

6.0 Fix crash invalid symbol search crash.

Description

When adding a symbol, a crash will occur if the symbol is not valid.

Analysis

Researching the issue by observing the stack trace and JSON output when attempting to add the invalid stock symbol "asdf" reveals that the issue is a stock price value of null is passed as a Float value resulting in an InvalidNumberException, killing the StockIntentService and crashing the program.

The stack trace is:

FATAL EXCEPTION: IntentService[com.sam_chordas.android.stockhawk.service.StockIntentService]
Process: com.example.sam_chordas.stockhawk, PID: 16155
java.lang.NumberFormatException: Invalid float: "null"
        at java.lang.StringToReal.invalidReal(StringToReal.java:63)
        at java.lang.StringToReal.parseFloat(StringToReal.java:310)
        at java.lang.Float.parseFloat(Float.java:300)
        at com.sam_chordas.android.stockhawk.rest.Utils.truncateBidPrice(Utils.java:52)
        at com.sam_chordas.android.stockhawk.rest.Utils.buildBatchOperation(Utils.java:79)
        at com.sam_chordas.android.stockhawk.rest.Utils.quoteJsonToContentVals(Utils.java:33)
        at com.sam_chordas.android.stockhawk.service.StockTaskService.onRunTask(StockTaskService.java:127)
        at com.sam_chordas.android.stockhawk.service.StockIntentService.onHandleIntent(StockIntentService.java:31)
        at android.app.IntentService$ServiceHandler.handleMessage(IntentService.java:65)
        at android.os.Handler.dispatchMessage(Handler.java:102)
        at android.os.Looper.loop(Looper.java:136)
        at android.os.HandlerThread.run(HandlerThread.java:61)
   Force finishing activity com.example.sam_chordas.stockhawk/com.sam_chordas.android.stockhawk.ui.MyStocksActivity

Proposed Fix

The fix is to validate the added symbol before using it to generate a new list view. For now the behavior will be to ignore invalid symbols. Later, a Toast or SnackBar message will be provided to flag the error.

Testing (manual)

Use "asdf" and "bcov" as test symbols. "asdf" should result in a null price value and "ibm" should result in a non-null price value. In both cases the program should not crash after a fix has been applied.

8.0 Clean up warnings.

The initial code drop has some Notes and AAPT warnings.

The Notes are related to adding Lint to get more details on observed problems.

The AAPT complaints need to be triaged.

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.