Giter Club home page Giter Club logo

ud851-sunshine's Introduction

Sunshine!

This is the repository for the weather app that students build during the Developing Android Apps course at Udacity.

To use this repository, fork/clone it, or download a zip using the green "Clone or download" button at the top of the file list. Each coding exercise in the course has starter code in a folder labeled like S01.01-Exercise-CreateLayout, and corresponding solution code labeled like S01.01-Solution-CreateLayout. The intended workflow is for you to open the starter code for each exercise in Android Studio, and complete each of the tasks labeled TODO. You can easily find all such tasks using the TODO pane at the bottom left of Android Studio.

When you're done, or if you run into any problems, you can open up the solution code in another Android Studio window, and compare our solution to what you've written!

Contributing

Because of the way this repository is constructed, pull requests don't really work. Issues, however, are gratefully accepted!

ud851-sunshine's People

Contributors

atif-reyaz-khan avatar sudkul avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ud851-sunshine's Issues

Mismatching ToDos in exercise and solution of S09.01

TODOs of S09.01-Exercise-ContentProviderFoundation are

// TODO (1) Create a class called SunshineSyncTask
// TODO (2) Within SunshineSyncTask, create a synchronized public static void method called syncWeather
// TODO (3) Within syncWeather, fetch new weather data
...and so on...

TODOs of S09.01-Solution-ContentProviderFoundation are
// COMPLETED (1) Declare, but don't instantiate a WeatherDbHelper object called mOpenHelper
// COMPLETED (2) Override onCreate
// COMPLETED (3) Within onCreate, instantiate our mOpenHelper
...and so on...

Add readme.md file

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and run on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

What things you need to install the software and how to install them

Give examples

Installing

A step by step series of examples that tell you to have to get a development end running

Say what the step will be

Give the example

And repeat

until finished

End with an example of getting some data out of the system or using it for a little demo

Running the tests

Explain how to run the automated tests for this system

Break down into end to end tests

Explain what these tests test and why

Give an example

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Acknowledgments

  • Hat tip to anyone who's code was used
  • Inspiration
  • etc

And also you can add contribute.md file which is written in markdown language.

Contributing to the project

Please take a moment to review this document in order to make the contribution
process easy and effective for everyone involved.

Following these guidelines helps to communicate that you respect the time of
the developers managing and developing this open source project. In return,
they should reciprocate that respect in addressing your issue, assessing
changes, and helping you finalize your pull requests.

As for everything else in the project, the contributions to this project are governed by our team.

Bug reports

A bug is a demonstrable problem that is caused by the code in the repository.
Good bug reports are extremely helpful - thank you!

Guidelines for bug reports:

  1. Use the GitHub issue search — check if the issue has already been
    reported.

  2. Check if the issue has been fixed — try to reproduce it using the
    latest master or next branch in the repository.

  3. Isolate the problem — ideally, create a reduced test case.

A good bug report shouldn't leave others needing to chase you up for more
information. Please try to be as detailed as possible in your report. What is
your environment? What steps will reproduce the issue? What OS experiences the
problem? What would you expect to be the outcome? All these details will help
people to fix any potential bugs.

Example:

Short and descriptive example bug report title

A summary of the issue and the browser/OS environment in which it occurs. If
suitable, include the steps required to reproduce the bug.

  1. This is the first step
  2. This is the second step
  3. Further steps, etc.

<url> - a link to the reduced test case

Any other information you want to share that is relevant to the issue being
reported. This might include the lines of code that you have identified as
causing the bug, and potential solutions (and your opinions on their
merits).

Feature requests

Feature requests are welcome. But take a moment to find out whether your idea
fits with the scope and aims of the project. It's up to you to make a strong
case to convince the project's developers of the merits of this feature. Please
provide as much detail and context as possible.

Pull requests

Good pull requests - patches, improvements, new features - are a fantastic
help. They should remain focused in scope and avoid containing unrelated
commits.

Please ask first before embarking on any significant pull request (e.g.
implementing features, refactoring code), otherwise you risk spending a lot of
time working on something that the project's developers might not want to merge
into the project.

For new Contributors

If you never created a pull request before, welcome: tada: : smile: Here is a great tutorial
on how to send one :)

  1. Fork the project, clone your fork,
    and configure the remotes:

    # Clone your fork of the repo into the current directory
    git clone https://github.com/<your-username>/<repo-name>
    # Navigate to the newly cloned directory
    cd <repo-name>
    # Assign the original repo to a remote called "upstream"
    git remote add upstream https://github.com/this projecthq/<repo-name>
  2. If you cloned a while ago, get the latest changes from upstream:

    git checkout master
    git pull upstream master
  3. Create a new topic branch (off the main project development branch) to
    contain your feature, change, or fix:

    git checkout -b <topic-branch-name>
  4. Make sure to update, or add to the tests when appropriate. Patches and
    features will not be accepted without tests. Run npm test to check that all
    tests pass after you've made changes. Look for a Testing section in the
    project’s README for more information.

  5. If you added or changed a feature, make sure to document it accordingly in
    the README.md file.

  6. Push your topic branch up to your fork:

    git push origin <topic-branch-name>
  7. Open a Pull Request
    with a clear title and description.

For Members of the this project Contributors Team

  1. Clone the repo and create a branch

    git clone https://github.com/this projecthq/<repo-name>
    cd <repo-name>
    git checkout -b <topic-branch-name>
  2. Make sure to update, or add to the tests when appropriate. Patches and
    features will not be accepted without tests. Run npm test to check that all tests
    pass after you've made changes. Look for a Testing section in
    the project’s README for more information.

  3. If you added or changed a feature, make sure to document it accordingly in
    the README.md file.

  4. Push your topic branch up to our repo

    git push origin <topic-branch-name>
  5. Open a Pull Request using your branch with a clear title and description.

Optionally, you can help us with these things. But don’t worry if they are too
complicated, we can help you out and teach you as we go :)

  1. Update your branch to the latest changes in the upstream master branch. You
    can do that locally with

    git pull --rebase upstream master

    Afterward, force push your changes to your remote feature branch.

  2. Once a pull request is good to go, you can tidy up your commit messages using
    Git's interactive rebase.
    Please follow our commit message conventions shown below, as they are used by
    semantic-release to automatically
    determine the new version and release to npm. In a nutshell:

Issues

Issue open :
It is not just fun.If there is really the bug or issue or suggestion the create an issue or make a pull request.

S03.01-Exercise-RecyclerView : Unclear Instruction

// TODO (46) Instead of setting the text to "", set the adapter to null before refreshing

S03.01-Exercise-RecyclerView TODO (46) : Unclear instruction 👎 .
Its instructs to set the adapter to null rather it should instruct to set the data source of the adapter to null. This would be much better instruction for a newbie.

mForecastAdapter.setWeatherData(null);

S03.02 Grade build errors- Failed to crunch file

Hello

I arrived at S03.02 but for some reason I am getting the following build error (in the solution project):

`Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :app:compileDebugSources, :app:compileDebugAndroidTestSources, :app:compileDebugUnitTestSources]
Error:Failed to crunch file C:\Users\Laurent\Sunshine\ud851-Sunshine-student\S03.02-Solution-RecyclerViewClickHandling\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png into C:\Users\Laurent\Sunshine\ud851-Sunshine-student\S03.02-Solution-RecyclerViewClickHandling\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png
Error:Execution failed for task ':app:mergeDebugResources'.

Error: Failed to crunch file C:\Users\Laurent\Sunshine\ud851-Sunshine-student\S03.02-Solution-RecyclerViewClickHandling\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\res\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png into C:\Users\Laurent\Sunshine\ud851-Sunshine-student\S03.02-Solution-RecyclerViewClickHandling\app\build\intermediates\res\merged\debug\drawable-hdpi-v4\abc_ic_menu_share_mtrl_alpha.png
Information:BUILD FAILED
Information:Total time: 1.4 secs`

I've tried following advise on StackOverflow, Clean Project and re-cloning from GitHub, but none of them seem to help.

Has anybody else come across this problem by any chance?

Thanks

Missing TODOs in S02.03

In S02.03's TODO (7) and TODO (17) we need to find the error display text view and the loading indicator progress bar by ID. However, we did not set any ID in the activity_forecast.xml (e.g. after TODO (5) & TODO (15)). It may be intended (we should solve this ourselves), but we have always had an explicit step for it earlier.

T10.04 Typo in a function name

Here the function name should be getElapsedTimeSinceLastNotification

public static long getEllapsedTimeSinceLastNotification(Context context) {

Not a big issue, but it can confuse somebody who start to type SunshinePr<TAB>.getElap<TAB> in the IDE. 👍

S03.01 -> TODO 46 -> Misleading TODO

Not sure if it's intended but the TODO number 46 in MainActivity reads:

// TODO (46) Instead of setting the text to "", set the adapter to null before refreshing

And I think it should refer to the adapter's data instead of the adapter itself.

As something like mForecastAdapter.setWeatherData(null); I'm assuming is the answer.

S05.01 and onwards -> Google HQ Address typo

Starting from S05.01 the Address in the MainActivity.openLocationInMap() method is written incorrectly,

1600 Ampitheatre Parkway, CA

when it should be

1600 Amphitheatre Parkway, CA

Not dramatic, yet that more symbolic

11.03 DetailActivity and Binding

There seems to be a file missing.. I'm getting 'Cannont resolve symbol ActivityDetailBinding'
Then I try to import import com.example.android.sunshine.databinding.ActivityDetailBinding; and it is unrecognized.

S10.04-Exercise-Notifications

There is missing TODO in class SunshinePreferences.java, especially in method areNotificationsEnabled(). When I move to TODO (13) Check if notifications are enabled, I just blank what this TODO asking about. Probablay define TODO areNotificationsEnabled before TODO (13) more appropriate

Typo in TODO 2, S03.02

Says "method that access a String as a parameter" should be "method that has a String as a parameter"

S09.05-Exercise-MoreDetails - Typo in TODO (26)

TODO (26) Display a readable data string

shouldn't it be

TODO (26) Display a readable date string

?
Since after i check the solution, it actually display the date and word data isn't very clear.

findViewById in ForecastAdapter returns null for recyclerview.

I followed all of the steps and I cross-checked with given source and also copy-pasted the same for verification. But the textview, imageview holds null after findViewByID. Kindly help me. Its my first android project and I can add it to my resume.

First, FakeDataUtils get called and weather db is created and random data is filled in weather table, then loader fetches data from db as a Cursor and sends to ForecastAdapter right?
I left out the job dispatcher files as I would like to complete this first.

S11.03-Exercise-DetailLayoutAndDataBinding (binding error)

When I try complete TODO's, im facing a bug.. I also get the same error on S11.03 Solution project;

Error:(250, 23) error: cannot find symbol variable primaryInfo

and Gradle console;

`C:\Android\AndroidStudioProjects\ud851-Sunshine-student\S12.01-Exercise-DimensionsColorsAndFonts\app\src\main\java\com\example\android\sunshine\DetailActivity.java:322: error: cannot find symbol
mDetailBinding.primaryInfo.lowTemperature.setContentDescription(lowA11y);
^
symbol: variable primaryInfo
location: variable mDetailBinding of type ActivityDetailBinding
9 errors

FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:compileDebugJavaWithJavac'.

Compilation failed; see the compiler error output for details.`

I could not solve this problem

[WINDOWS OS ONLY] Creating new empty activity via "New Android Activity" wizard causes Android Studio IDE errors

In Windows OS, the build folder is redirected to C:\tmp\***.

allprojects {
    String osName = System.getProperty("os.name").toLowerCase();
    if (osName.contains("windows")) {
        buildDir = "C:/tmp/${rootProject.name}/${project.name}"
    }
    repositories {
        jcenter()
    }
}

This causes an IDE error when creating new activities using "New Android Activity" wizard. The activity won't be created and the error will be caused by clicking "Finish".

Removing the lines that redirects build folder in the gradle file solves the problem.

This issue is confirmed here as well:
https://code.google.com/p/android/issues/detail?id=232076

Screenshot:
image 3

S03.01-Exercise-RecyclerView

In the SunshineWeatherUtils.java:
On the lines 339 and 378 the condition should be < 761.

...
else if (weatherId >= 701 && weatherId <= 761) {
  return R.drawable.ic_fog;
} else if (weatherId == 761 || weatherId == 781) {
  return R.drawable.ic_storm;
}
...
...
else if (weatherId >= 701 && weatherId <= 761) {
  return R.drawable.art_fog;
} else if (weatherId == 761 || weatherId == 771 || weatherId == 781) {
  return R.drawable.art_storm;
}
...

S03-02-Exercise-RecyclerViewClickHandling (TODO 3)

Create a final private ForecastAdapterOnClickHandler called mClickHandler
private final ForecastAdapterOnClickHandler mClickHandler;

Its not possible to create a private final object without being initialized it, I guess the correct TODO should be,
Create a private ForecastAdapterOnClickHandler called mClickHandler
private ForecastAdapterOnClickHandler mClickHandler;

S12.04 Sunshine shows incorrect friendly date string

At the time of writing it is 20:15, Monday the 27th of February (GMT+1) but Sunshine shows "Monday" and then "Today, 28 February" for Berlin. Instead of "Monday" it should show "Today, 27 February" followed by "Tomorrow" and "Wednesday")

11.03-Exercise-DetailLayoutAndDataBinding

Before work on TODO (3) Declare an ActivityDetailBinding field called mDetailBinding, No instruction to add tab on detail_activity.xml file first and build the project.

Importing projects

Can anyone help me how to import these projects step by step?
I did but i am not able to do. so kindly someone help me.
Thanks

Problem downloading Zip or Cloning Repo

Hi,

I have just started the course and upon performing a git clone on the repository I receive a 504 error and if I try to download the zip using either the link in githib or on udacity I receive a 500 internal server error.

Thanks - Tim

S12.01's TODO(3) is not implemented

TODO (3) Replace dimension values with @Dimen resources
is not implemented.

ProgressBar's dimen resources need to be replaced like this.

    <ProgressBar
        android:id="@+id/pb_loading_indicator"
        android:layout_width="@dimen/loading_indicator_size"
        android:layout_height="@dimen/loading_indicator_size"
        android:layout_gravity="center"
        android:visibility="invisible" />

S02.01-Exercise-Networking

Maybe the issue is sitting in front of the monitor, but for me following TODOs seem to be incomplete:
TODO (8) Create a method that will get the user's preferred location and execute your new AsyncTask and call it loadWeatherData
What should be the user's preferred location? I found it out only in your solution.

TODO (6) Override the doInBackground method to perform your network requests
The same, not really clear, what the student should do. At least not the stuff from the solution

Failed to crunch file

All the apps are showing the same error when run. "Failed to crunch file". In this error it says failed to crunch an image file from drawables in exploded-aar into drawables in res folder.

S02.02-Exercise-Menus Improper Parsing of JSON

On line 60 of OpenWeatherJsonUtils.java the OWM_DESCRIPTION variable value is improperly set to "forecast". When the JSON is parsed, it has no "forecast" element, and throws an exception, causing the weather results to be empty. The result is a blank weather screen. The correct value should probably be "description" as that matches an element from the JSON, causes the parsing to succeed, and appears to be what was intended to be used.

S06.01-Solution-LaunchSettingsActivity (onward): Might use launchMode singleTop for DetailActivity, too.

Currently, MainActivity is designated to use the attribute android:launchMode="singleTop" so that returning from DetailActivity or SettingsActivity won't create a new instance but instead reuse the already existing instance on the back stack. Which makes sense.

Using android:launchMode="singleTop" (when returning from SettingsActivity) would make sense for DetailActivity, too, wouldn't it? ;-)

(see also: launchMode)

Kind regards,
Ingo

Does not support Gradle Build System.

Hello,

This project is not supported by Gradle Build system,is there a different/updated repositiory I should be following which runs on Gradle Build System ? Please Help.

S09.04 -> TODO 18/34 -> Wrong order

This is not really a proper issue, but an ordering problem, the TODO number 18 in MainActivity reads:

// TODO (18) Call the showLoading method

While the TODO number 34 reads:

// TODO (34) Create a method called showLoading that shows the loading indicator and hides the data

Creating a minor name/order confusion. As the showLoading method doesn't have any dependency the TODO 34 can be moved to the position 18 and all the other TODO's indexes increased by 1 without problems.

Ps: Not sure if you guys prefer a pull request for such a detail, if so, let me know.

Error crunching files when importing S03.02-Exercise-RecyclerViewClickHandling

I got an error with one of the included files, while importing this project:

Error:Failed to crunch file D:\Udacity\AndroidDeveloper\Exercises\ud851-Sunshine\S03.02-Exercise-RecyclerViewClickHandling\app\build\intermediates\exploded-aar\com.android.support\appcompat-v7\25.1.0\res\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png into D:\Udacity\AndroidDeveloper\Exercises\ud851-Sunshine\S03.02-Exercise-RecyclerViewClickHandling\app\build\intermediates\res\merged\debug\drawable-xhdpi-v4\abc_textfield_search_activated_mtrl_alpha.9.png

Error:Execution failed for task ':app:mergeDebugResources'.

Apparently, it's a image file error, but I couldn't find the resource on the drawable folder.

My Android Studio version is 2.2.3.

S12.01 -> Layout issues -> list_item_forecast_today.xml

Can someone confirm that today's details are not being shown by default in S12.01?, the layout height is set to wrap_content and it has a top/bottom padding of 16dp, so it should theoretically be shown...

I checked the diferences with primary_weather_info as they are essentially the same layout and found out that removing

<!--android:paddingBottom="@dimen/today_forecast_list_item_vertical_padding"-->
<!--android:paddingTop="@dimen/today_forecast_list_item_vertical_padding"-->

will show the layout. But then we lose padding as a result, which can be solved by asigning

<!--android:paddingTop="@dimen/today_forecast_list_item_vertical_padding"-->

to date and

<!--android:paddingBottom="@dimen/today_forecast_list_item_vertical_padding"-->

to weather_description.

I'm wondering? Is this an issue with ConstraintLayout? Is it mine only?

Ps: I'm using 1.0.1 of Constraint, 25.2.0 in android support and testing with a Nexus 5X - Android 7.0.

Edit: Same issues found on 12.02, 12.03 and 12.04, same fix.

Outdated build tools

At opening every exercise, a popup window appears to update to version 2.3.0.

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.