udacity / ud851-sunshine Goto Github PK
View Code? Open in Web Editor NEWLicense: Apache License 2.0
License: Apache License 2.0
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...
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.
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.
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
One Paragraph of project description goes here
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.
What things you need to install the software and how to install them
Give examples
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
Explain how to run the automated tests for this system
Explain what these tests test and why
Give an example
This project is licensed under the MIT License - see the LICENSE.md file for details
And also you can add contribute.md file which is written in markdown language.
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.
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:
Use the GitHub issue search — check if the issue has already been
reported.
Check if the issue has been fixed — try to reproduce it using the
latest master
or next
branch in the repository.
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.
- This is the first step
- This is the second step
- Further steps, etc.
<url>
- a link to the reduced test caseAny 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 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.
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.
If you never created a pull request before, welcome: tada: : smile: Here is a great tutorial
on how to send one :)
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>
If you cloned a while ago, get the latest changes from upstream:
git checkout master
git pull upstream master
Create a new topic branch (off the main project development branch) to
contain your feature, change, or fix:
git checkout -b <topic-branch-name>
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.
If you added or changed a feature, make sure to document it accordingly in
the README.md
file.
Push your topic branch up to your fork:
git push origin <topic-branch-name>
Open a Pull Request
with a clear title and description.
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>
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.
If you added or changed a feature, make sure to document it accordingly in
the README.md
file.
Push your topic branch up to our repo
git push origin <topic-branch-name>
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 :)
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.
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:
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.
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
In WeatherDbHelper, see line 112.
What is written: sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + WeatherEntry.TABLE_NAME);
What it should be: sqLiteDatabase.execSQL("DROP TABLE IF EXISTS " + WeatherEntry.TABLE_NAME + ";");
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.
Hi,
The following TODO action is incorrect or confusing -
TODO (2) Change the android:id attribute to tv_weather_data
In the solution project this id is added(not changed) to TextView. As it's written a person may understand that need to change id of FrameLayout as it has id in the exercise.
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.
Not all of the files are working. It could be my comp. Is anyone else having issues with this?
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
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")
need TODO to create bools.xml
need TODO to create "areNotificationsEnabled()" method in SunshinePreference.java
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);
Just a small thing, but content_authority is a resource string, which is currently marked as translatable. :-) Should be false.
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;
Is there any particular reason why you guys use listPreference.getEntries()[prefIndex]
instead of directly use listPreference.getEntry()
from this line?
There's an extra comma in MainActivity.java while creating the array of Strings.
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.
Compilation failed; see the compiler error output for details.`
I could not solve this problem
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.
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
it should be
inflater.inflate(R.menu.detail, menu);
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
Says "method that access a String as a parameter" should be "method that has a String as a parameter"
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" />
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;
}
...
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.
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.
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.
At opening every exercise, a popup window appears to update to version 2.3.0.
Line 52, 84.
It should be ForecastAdapter.java instead of ForecastAdapter.xml.
Hey guys can anyone help on how to import these projects in android studio
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
i import project sunshine but it cant be open untill 1 hour waiting . its only building the project but show nothing
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. 👍
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.
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.
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
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
TODO (5) Within bools.xml in the portrait specific directory, add a bool called use_today_layout and set it to false
The boolean should actually be set to true, otherwise the list_item_forecast_today
layout created will never be used.
TODO 7 to 24 should be done after TODO 25 to 35. I suggest changing the TODO numbers.
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.
Can this cause NullPointerException
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.
In the videos they are talking about removing the RelativeLayout for the Constraint Layout. And in the exercise they tell you to remove the Constraint layout. Then please update the video's. Or at least add some text at the bottom of the video's to let us know that the video's are out of date.
If I'm not mistaken this should be created when settings activity is created.
in S06.01-Exercise-LaunchSettingsActivity here
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.