GithubHelp home page GithubHelp logo

mytwitter's Introduction

Project 3 - MyTwitter

MyTwitter is an android app that allows a user to view his Twitter timeline and post a new tweet. The app utilizes Twitter REST API.

Time spent: 10 hours spent in total

User Stories

The following required functionality is completed:

  • User can sign in to Twitter using OAuth login
  • User can view tweets from their home timeline
  • User can compose and post a new tweet
    • User can click a “Compose” icon in the Action Bar on the top right
    • User can then enter a new tweet and post this to twitter
    • User is taken back to home timeline with new tweet visible in timeline

The following optional features are implemented:

  • User can see a counter with total number of characters left for tweet on compose tweet page
  • User can click a link within a tweet body on tweet details view. The click will launch the web browser with relevant page opened.
  • User can pull down to refresh tweets timeline
  • User can open the twitter app offline and see last loaded tweets. Persisted in SQLite tweets are refreshed on every application launch. While "live data" is displayed when app can get it from Twitter API, it is also saved for use in offline mode.
  • User can tap a tweet to open a detailed tweet view
  • User can select "reply" from detail view to respond to a tweet
  • Improve the user interface and theme the app to feel "twitter branded"

The following bonus features are implemented:

  • User can see embedded image media within the tweet detail view
  • User can watch embedded video within the tweet
  • Compose tweet functionality is build using modal overlay
  • Use Parcelable instead of Serializable using the popular Parceler library.
  • Leverage RecyclerView as a replacement for the ListView and ArrayAdapter for all lists of tweets.
  • Move the "Compose" action to a FloatingActionButton instead of on the AppBar.
  • On the Twitter timeline, leverage the CoordinatorLayout to apply scrolling behavior that hides / shows the toolbar.
  • Replace all icon drawables and other static image assets with vector drawables where appropriate.
  • Leverages the data binding support module to bind data into layout templates.
  • Replace Picasso with Glide for more efficient image rendering.
  • Enable your app to receive implicit intents from other apps. When a link is shared from a web browser, it should pre-fill the text and title of the web page when composing a tweet.
  • When a user leaves the compose view without publishing and there is existing text, prompt to save or delete the draft. The draft can be resumed from the compose view.

The following additional features are implemented:

  • Include replies?
  • Fetch user's info/profile, and show it somewhere.
  • Rxjava as event bus, to de-couple cross fragment communication.

Video Walkthrough

Here's a walkthrough of implemented user stories:

Video walkthrough

Notes

Describe any challenges encountered while building the app.

Open-source libraries used

  • Android Async HTTP - Simple asynchronous HTTP requests with JSON parsing
  • Picasso - Image loading and caching library for Android

License

Copyright [2016] [Shawn Duan]

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

mytwitter's People

Contributors

shawnduan avatar

Watchers

 avatar

mytwitter's Issues

Required feature incorrect

@ShawnDuan it seems from your code that you do not immediately add the newly composed tweet to the timeline, on successfully posting it to Twitter, but instead rely on timeline refresh which might not always be reliable.

See the below hint which can be found here https://courses.codepath.com/courses/intro_to_android/unit/3#!hints
Note #1: Make sure that after you compose a tweet that the new tweet shows up in the timeline. To do this, refreshing the timeline may not be enough because of the lag before the new tweet shows up in the timeline API call. Instead, after the tweet is successfully posted to twitter from within the compose screen, we can pass the Tweet back to the TimelineActivity through the intent result system to the parent activity and inject the created tweet directly into the adapter for the timeline from within onActivityResult. See the intents cliffnotes for how to return the result back to the timeline activity.

Fix accordingly and resubmit

Assignment Feedback

👍 nice work. A few notes after checking out the code:

  • Nice to see you successfully used OAuth login. OAuth is widely used and it's important to understand OAuth v1 and v2 properly.
  • Good to see you were able to format the timestamp cleanly.
  • Nice to see you used the SwipeRefreshLayout for easy timeline refreshes.
  • Good to see you added the new tweet directly to the home timeline after it was successfully posted to Twitter.
  • Nice touch with the character count being displayed while the user composes a tweet.
  • Good to see you used RxJava. Use of RxJava for any type of pub/sub such as field changes, API calls, etc. is considered good practice.
  • Good to see you used DialogFragment. Fragment is an important component and its use is good practice.
  • Consider using GSON to conveniently serialize and deserialize API responses into objects.
  • Consider adding local persistence of tweets by using DBFlow in the Tweet and User. See the persistence guide and this other guide for more details.

Here's a detailed Project 3 Feedback Guide here which covers the most common issues with this submitted project. Read through the feedback guide point-by-point to determine how you could improve your submission.

Let us know if you have any other thoughts or questions about this assignment. Hopefully by now you feel pretty comfortable with all the major pieces to basic Android apps (Views, Controllers, ActionBar, Navigation, Models, Authentication, API Communication, Persistence, et al) and see how they all fit together. We are close now to a turning point in the course where you should be hitting a "critical mass" towards your knowledge of Android.

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.