Giter Club home page Giter Club logo

eti-app's Introduction

eti-app

eti android app

eti-app's People

Contributors

sonicmax avatar

Watchers

 avatar

eti-app's Issues

Improve error handling

Some errors are unavoidable (eg 500 internal server errors causing null String input to Jsoup.parse() method) - these can be handled by notifying user and repeating the network request.

eg return null from scraper if string input is null, check for null in onLoadFinished , display notification and retry request after certain amount of time. Need to think of sensible way to handle retries

Remove BoardList, create BookmarkManager

Should replace board list with a bookmark manager which allows user to choose default bookmark to load on startup (scraped from ETI) and create/remove new custom bookmarks. BookmarkManager should only load after login if user hasn't already chosen a default bookmark.

Occasional crash caused by quickpost window (?)

E/AndroidRuntime: FATAL EXCEPTION: main
                  Process: com.sonicmax.etiapp, PID: 8222
                  android.view.WindowManager$BadTokenException: Unable to add window -- token android.view.ViewRootImpl$W@1a30dd2 is not valid; is your activity running?
                      at android.view.ViewRootImpl.setView(ViewRootImpl.java:678)
                      at android.view.WindowManagerGlobal.addView(WindowManagerGlobal.java:342)
                      at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:93)
                      at android.widget.PopupWindow.invokePopup(PopupWindow.java:1380)
                      at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1156)
                      at android.widget.PopupWindow.showAtLocation(PopupWindow.java:1119)
                      at android.widget.Editor$PinnedPopupWindow.updatePosition(Editor.java:3084)
                      at android.widget.Editor$PinnedPopupWindow.show(Editor.java:3040)
                      at android.widget.Editor$SuggestionsPopupWindow.show(Editor.java:3484)
                      at android.widget.Editor.replace(Editor.java:359)
                      at android.widget.Editor$3.run(Editor.java:2129)
                      at android.os.Handler.handleCallback(Handler.java:751)
                      at android.os.Handler.dispatchMessage(Handler.java:95)
                      at android.os.Looper.loop(Looper.java:154)
                      at android.app.ActivityThread.main(ActivityThread.java:6077)
                      at java.lang.reflect.Method.invoke(Native Method)
                      at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:865)
                      at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:755)

Skimming through Google results seems to suggest this can be caused by trying to show a dialog while the activity is being destroyed - seems unlikely to be the case here

Implement private messages

Would probably use the topic list fragment to display inbox threads, and then use a new fragment to display the threads themselves. Would look good with an instant message style UI where the messages are displayed in speech bubbles, sender/recipient usernames and avatars are aligned to left/right side of screen, etc

Refactor PostMessageHandler/PostTopicHandler

They are practically identical and it would take little work to combine the two classes.

Ideally the scraping logic would be separated out into its own class, and the rest of the code could be moved to PostMessageFragment/PostTopicFragment respectively. This would enable us to use AsyncTaskLoader to handle the GET/POST requests instead of AsyncTask.

Cache bookmarks

At the moment the app scrapes bookmarks from home.php each time you log in - this is slow for the user, and not really necessary. Instead, we should store the bookmarks after first load (possibly in a SQLite db) and display bookmarks from cache on consequent loads. To keep bookmarks up-to-date, we should check home.php for changes in background & append/remove bookmarks if necessary.

Queue ImageLoader requests

Currently it attempts to load them all at once and updates UI whenever the request finishes - would be better to load them in order.

Improve page navigation

  • Need to provide orientation information to user
  • User should be able to navigate easily to any given page in a topic list/message list

Change behaviour on login

Instead of loading bookmarks, we can jump straight to topic list (as bookmarks can easily be viewed in navigation drawer). For now I will just jump to the first saved bookmark, but in future this should be customisable via options menu

Unparsable date error in MessageListAdapter

E/MessageListAdapter: Error parsing date for getView method
                      java.text.ParseException: Unparseable date: ")" (at offset 0)
                          at java.text.DateFormat.parse(DateFormat.java:626)
                          at com.sonicmax.etiapp.adapters.MessageListAdapter.getFuzzyTimestamp(MessageListAdapter.java:162)
                          at com.sonicmax.etiapp.adapters.MessageListAdapter.getView(MessageListAdapter.java:148)

I think this is caused by existence of "(Formerly known as: old username)" in message-top elements, need to add a separate check for them. Probably need to check for money bags too

Cards UI

CardViews are neat and cool and we should use them

Improve message list performance

Would probably be a good idea to keep the SpannableStringBuilders generated by MessageBuilder/SupportMessageBuilder in an LruCache object. (Not sure if that would cause problems with async loading of images)

Also the message layouts should be generated in a background thread - leads to a weird experience on devices with poor performance

Themes

Eventually this will be customisable, but for now we should copy some of ETI's popular themes and include a dark theme for amoled screens

Add unit tests

Need to test Scraper classes, LivelinksHandler, and probably other stuff

Improve handling of images

The current implementation seems to block the UI thread with large numbers of images being loaded, and it's kind of slow

Quickpost/quickreply feature

Enable user to post messages/replies to messages without starting a new activity. We can restart loader to view new post, or let LivelinksHandler deal with it (once it has been implemented)

HTTPSUrlConnection response code always equals -1 on Samsung Galaxy Fame S6810

Works fine in emulator (at any API level) and on newer phones, but gives a response code of -1 on Samsung Galaxy Fame S6810.

-1 is the default value for response code, so it seems as if something is interupting HTTPSUrlConnection and preventing it from getting a response. Doesn't throw any uncaught exceptions. Needs further testing.

Should also note that this wasn't a problem while app was using AsyncTasks to handle web requests (instead of AsyncTaskLoaders)

Replace all AsyncTasks with AsyncTaskLoaders (or equivalent)

AsyncTaskLoaders make sense in most cases (and are already used for majority of requests). Not sure that AsyncTaskLoaders are appropriate for making POST requests, but we need to use something that won't break on screen orientation change/etc.

  • PostMessageHandler/PostTopicHandler (#6)
  • AccountManager uses AsyncTask for the logout request

Remove LoginActivity/Fragment from stack once user is logged in

Should modify back button behaviour so that pressing it twice quits the app, instead of going back to LoginActivity (which is pointless if user has already logged in & we have a working cookie). User should have to explicitly choose to logout in order to get back to LoginActivity.

HTTPSUrlConnection returns responseCode of -1 when using quickpost feature

Example log:

V/WebRequest: headerFields: {null=[], =[0], X-Android-Received-Millis=[1486564615173], X-Android-Sent-Millis=[1486564615173]}

V/WebRequest: responseCode: -1

The response headers are fine with other types of POST but for some reason the postmsg.php response is totally messed up. Need to test in different versions of Android. Might be worth looking into using asyncpost.php endpoint instead of postmsg.php

We can work around the error by just not showing "Message posted"/"Post failed" snackbars after quickposting if -1 response is detected, but ideally we should fix this.

Improve performance on older phones

(specific performance problems that led to creation of this issue were resolved by restarting phone)

Performance is generally okay, but app feels a bit janky sometimes. Need to profile app and find bottlenecks.

Implement livelinks

Pulls new posts in from ETI server using http long polling (already implemented on the server- we just need to listen)

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.