Giter VIP home page Giter VIP logo

andfun-kotlin-dev-bytes's Introduction

Behind the Scenes - DevByte Viewer App

This is the toy app for Lesson 9 of the Android App Development in Kotlin course on Udacity.

DevByte

DevByte Viewer is an example app that showcases using Room and a Repository to create an offline cache.

In addition, it also covers how to use WorkManager for scheduling periodic work. In this app it's used to setup a daily background data sync.

Screenshots

Screenshot1

How to use this repo while taking the course

Each code repository in this class has a chain of commits that looks like this:

listofcommits

These commits show every step you'll take to create the app. Each commit contains instructions for completing the that step.

Each commit also has a branch associated with it of the same name as the commit message, as seen below:

branches Access all branches from this tab.

listofbranches

branchesdropdown

The branches are also accessible from the drop-down in the "Code" tab.

Requirements

  1. Android Studio (Jellyfish or above)
  2. JDK 21 with JAVA_HOME environment variable set. If you don't have JDK 21 installed or JAVA_HOME is not set, consider using a tool like sdkman to simplify the process. Refer to the sdkman documentation for installation instructions: sdkman installation

Working with the Course Code

Here are the basic steps for working with and completing exercises in the repo.

The basic steps are:

  1. Clone the repo.
  2. Check out the branch corresponding to the step you want to attempt.
  3. Find and complete the TODOs.
  4. Optionally commit your code changes.
  5. Compare your code with the solution.
  6. Repeat steps 2-5 until you've gone trough all the steps to complete the toy app.

Step 1: Clone the repo

As you go through the course, you'll be instructed to clone the different exercise repositories, so you don't need to set these up now. You can clone a repository from github in a folder of your choice with the command:

git clone https://github.com/udacity/REPOSITORY_NAME.git

Step 2: Check out the step branch

As you go through different steps in the code, you'll be told which step you're on, as well as a link to the corresponding branch.

You'll want to check out the branch associated with that step. The command to check out a branch would be:

git checkout BRANCH_NAME

Step 3: Find and complete the TODOs

Once you've checked out the branch, you'll have the code in the exact state you need. You'll even have TODOs, which are special comments that tell you all the steps you need to complete the exercise. You can easily navigate to all the TODOs using Android Studio's TODO tool. To open the TODO tool, click the button at the bottom of the screen that says TODO. This will display a list of all comments with TODO in the project.

We've numbered the TODO steps so you can do them in order: todos

Step 4: Commit your code changes

After You've completed the TODOs, you can optionally commit your changes. This will allow you to see the code you wrote whenever you return to the branch. The following git code will add and save all your changes.

git add .
git commit -m "Your commit message"

Step 5: Compare with the solution

Most exercises will have a list of steps for you to check off in the classroom. Once you've checked these off, you'll see a pop up window with a link to the solution code. Note the Diff link:

solutionwindow

The Diff link will take you to a Github diff as seen below: diff

All of the code that was added in the solution is in green, and the removed code (which will usually be the TODO comments) is in red.

You can also compare your code locally with the branch of the following step.

Report Issues

Notice any issues with a repository? Please file a github issue in the repository.

andfun-kotlin-dev-bytes's People

Contributors

amanaggarwal1 avatar dirajhs avatar koladem avatar mido055 avatar nikhilsutar123 avatar objcode 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

andfun-kotlin-dev-bytes's Issues

app crashing

After installing the app, when iopen it is crashing and the logcat shows the folloing message:
"java.net.SocketTimeoutException: failed to connect to devbytes.udacity.com".
how to resolve his issue?

Missing class "Payload" in RefreshDataWork.kt

I'm assuming this is something that comes from an external library, but I have checked the solution and my build.gradle has all the proper dependencies specified. Does anyone know where this Payload class is supposed to be and how to fix the error I'm having?

Build failed.

What I see is below. Thanks in advance for any help!

FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

  • What went wrong:
    Some problems were found with the configuration of task ':app:generateSafeArgsDebug' (type 'ArgumentsGenerationTask').

    • In plugin 'androidx.navigation.safeargs' type 'androidx.navigation.safeargs.gradle.ArgumentsGenerationTask' property 'applicationId' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

      Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#missing_annotation for more details about this problem.

    • In plugin 'androidx.navigation.safeargs' type 'androidx.navigation.safeargs.gradle.ArgumentsGenerationTask' property 'applicationIdResource' is missing an input or output annotation.

      Reason: A property without annotation isn't considered during up-to-date checking.

      Possible solutions:

      1. Add an input or output annotation.
      2. Mark it as @internal.

      Please refer to https://docs.gradle.org/7.1/userguide/validation_problems.html#missing_annotation for more details about this problem.

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================

2: Task failed with an exception.

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

Failed to calculate the value of task ':app:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'.
Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, E:\AndroidStudioProjects\andfun-kotlin-dev-bytes-starter-code\app\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@25db10d1) before task ':app:compileDebugJavaWithJavac' has completed is not supported

  • Try:
    Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
    ==============================================================================

  • Get more help at https://help.gradle.org

Gradle sync failed: error in opening zip file

i have tried loading the starter code severally but it doesn't build , to keeps showing
3:13 AM Gradle sync failed: error in opening zip file
Consult IDE log for more details (Help | Show Log) (134 ms)

Crash when in offline mode and launch the app

When we are in offline mode, and I launch the app ( create a new instance of application ), app is crashing and this is what I receive in Logcat :

HTTP FAILED: java.net.UnknownHostException: Unable to resolve host "host": No address associated with hostname
2019-05-09 15:32:51.531 32728-32728/com.example.android.devbyteviewer E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.example.android.devbyteviewer, PID: 32728

Project fails to build with Android Studio Electric Eel 2022.1.1 Patch 1

  • In plugin 'androidx.navigation.safeargs' type 'androidx.navigation.safeargs.gradle.ArgumentsGenerationTask' property 'applicationId' is missing an input or output annotation.

  • Execution failed for task ':app:compileDebugJavaWithJavac'. \> Failed to calculate the value of task ':app:compileDebugJavaWithJavac' property 'options.generatedSourceOutputDirectory'. \> Querying the mapped value of map(java.io.File property(org.gradle.api.file.Directory, fixed(class org.gradle.api.internal.file.DefaultFilePropertyFactory$FixedDirectory, C:\Users\Genesis-Intel\Documents\projects\Android\Udacity\DevBytes-s1\app\build\generated\ap_generated_sources\debug\out)) org.gradle.api.internal.file.DefaultFilePropertyFactory$ToFileTransformer@124f9241) before task ':app:compileDebugJavaWithJavac' has completed is not supported

I don't why is app crashing when the network is off. Please help me out, as crashing of this app totally negates the concept of database caching

W/Glide: Failed to find GeneratedAppGlideModule. You should include an annotationProcessor compile dependency on com.github.bumptech.glide:compiler in your application and a @GlideModule annotated AppGlideModule implementation or LibraryGlideModules will be silently ignored
E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.ankur.databasecache, PID: 31373
I/Process: Sending signal. PID: 31373 SIG: 9

TODO #3 suggests the wrong class name

In DataTransferObjects.kt, TODO #3 tells the student to add an extension function to the non-existent NetworkVideoHolder class, instead of the NetworkVideoContainer class.

Gradle sync failed: Cause: org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;Consult IDE log for more details

Hi,

I download the starter code but every time the Gradle sync fails with following message -
Gradle sync failed: Cause: org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;
Consult IDE log for more details

The build window shows -
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

I am using Android Studio 4.0.

Any idea why this is happening?

Thanks!

ProgressBar is not shown

When I launch the application, I expect to see the ProgressBar, but it does not show up. It seems that following method does not work as expected :

/**
 * Binding adapter used to hide the spinner once data is available
 */
@BindingAdapter("goneIfNotNull")
fun goneIfNotNull(view: View, it: Any?) {
    view.visibility = if (it != null) View.GONE else View.VISIBLE
}

Failed to compile

Re-download dependencies and sync project (requires network)
The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.

Stop Gradle build processes (requires restart)
Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.```

Failed to compile error, please update the files to the correct configurations.

Does not build with the latest android gradle plugin

Hi

I get the following error when building the project. I didn't have any issues with other projects from the same course. Thanks

Unable to find method 'org.gradle.api.file.ProjectLayout.directoryProperty(Lorg/gradle/api/provider/Provider;)Lorg/gradle/api/file/DirectoryProperty;'.
Possible causes for this unexpected error include:
Gradle's dependency cache may be corrupt (this sometimes occurs after a network connection timeout.)
Re-download dependencies and sync project (requires network)

The state of a Gradle build process (daemon) may be corrupt. Stopping all Gradle daemons may solve this problem.
Stop Gradle build processes (requires restart)

Your project may be using a third-party plugin which is not compatible with the other plugins in the project or the version of Gradle requested by the project.

In the case of corrupt Gradle processes, you can also try closing the IDE and then killing all Java processes.

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.