Giter Club home page Giter Club logo

android-advanced's People

Contributors

geneandgoogle 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

android-advanced's Issues

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Lesson 3][Step 1.3][Sensor based orientation values never updated on some Incompatible Android Device]

Describe the problem
Some Device does'nt have a Sensor Magnetic like Example Samsung Tab 5.

**Lesson and Step of the codelab can this issue be found :
TiltSpot Project Lesson 3, Step 1.3

How to reproduce?
Install the Demo Application on Device Tablet Samsung Tab 5 which does'nt have a Sensor Magnetic , so the accelormeter values never updated

Versions

  • version of Android Studio: 3.5.2
  • API level target : Android 21

Additional information
To fix this issue, just add else branch when SensorManager not found (NULL) and display incompatibilty sensor device message.

codelab: advanced-android
Advanced Android 03.2: Sensor-based orientation

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.
it seem to be written in Java and when you copy it in android studio, it converts it in Kotlin , with more or less success

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3) : Advanced Android 03.1: Getting sensor data

How to reproduce?
What are the exact steps to reproduce the problem? just copy your code

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

The best code I add is :
class MainActivity : AppCompatActivity() {
private var mSensorManager: SensorManager? = null

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
    mSensorManager = this.getSystemService(Context.SENSOR_SERVICE) as SensorManager?
    val sensorList: List<Sensor> = mSensorManager.getSensorList(Sensor.TYPE_ALL)

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Lesson 13.1][Step 1.5] `mVideoView.getCurrentPosition()` always return 0

Describe the problem
mVideoView.getCurrentPosition() always return 0, so I can't preserve playback position.
I was doing this codelab in kotlin rather than Java, I am not sure whether the language causes this problem.

In which lesson and step of the codelab can this issue be found?
Lesson 13.1, Step 1.5.

How to reproduce?
I just follow the tutorial, copy and paste the code provided in each step and let Android Studio translate them into kotlin, and then run the app. The video will still restarts from the beginning even thought I have complete Step 1.5.

Versions

  1. What version of Android Studio are you using?
    • AndroidStudio 4.1, run on Ubuntu 16.04
  2. What API level are you targeting?
    • API 19: Android 4.4 (KitKat)

Additional information No.

codelab: advanced-android

Advanced Android: [Lesson 07.1][Step 3.2][A different parameter name in the code]

Describe the problem
A different parameter name in the code.

In which lesson and step of the codelab can this issue be found?
Lesson 07.1, Step 3.2.

How to reproduce?
Follow the instructions of the codelab of this step and the step before it.

Versions
1.Android Studio 4.0
2. API level 26

Additional information
In Step 3.1 the function doInBackground(Location... locations)
uses locations as parameter, while in Step 3.2 uses params instead of locations.
Location location = params[0];

codelab: advanced-android

Advanced Android: [Lesson 13.1][Step 1.5][save current position]

Describe the problem
The example says to save current position like this:

@Override
protected void onSaveInstanceState(Bundle outState) {
   super.onSaveInstanceState(outState);

   outState.putInt(PLAYBACK_TIME, mVideoView.getCurrentPosition());
}

but onSaveInstanceState call comes after onPause, so mVideoView.getCurrentPosition() is 0.
I think it will be better:

@Override
    protected void onPause() {
        super.onPause();
        currentPosition = videoView.getCurrentPosition();
        if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) {
            videoView.pause();
        }
    }

@Override
    protected void onSaveInstanceState(@NonNull Bundle outState) {
        super.onSaveInstanceState(outState);
        outState.putInt(PLAYBACK_TIME, currentPosition);
    }

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 13.1, Step 1.5)

Versions
Android Studio Dolphin | 2021.3.1 Patch 1
problem found on API 28

codelab: advanced-android

Why startActivityForResult?

Please help me understand why you send the new word back to the MainActivity, rather than getting a handle to the ViewModel directly in the NewWordActivity and inserting it there? What's the reasoning?

Advanced Android: [Lesson 8.01][Step 2][Places API]

Describe the problem
HyperLink is broken in step 2 Error 404

Lesson 08.1+ step 2.
Link "place-picker UI" in step 2 go no where Error 404

Versions

  1. What version of Android Studio are you using? N/A

codelab: advanced-android

Advanced Android: [Lesson 03.1][Step 2.1][ToptoBottom Constraint on Textview is wrong]

Describe the problem
On Lesson 03.1(SensorListeners), step 2.1, we are asked to delete the previously added ScrollView and TextViews, and add a TextView in its place. One of the constraints on this new textView is:
app:layout_constraintTop_toBottomOf | "parent"

This causes the textView to align to the bottom of the Constraint Layout causing it to go off the layout screen.
Instead, this constraints should be:
app:layout_constraintTop_toTopOf="parent"

In which lesson and step of the codelab can this issue be found?
Lesson 03.1, Step 2.1

How to reproduce?
Just follow the steps of the exercise.

Versions

  1. What version of Android Studio are you using?
    Android Studio ChipMunk | 2021.2.1 Patch 2

  2. What API level are you targeting?
    minSdk 26
    targetSdk 32

codelab: advanced-android

Advanced Android: [Lesson 07.1][Step 5][wrong variable reference]

There is a reference to an argument wrongly named.

Lesson number 7.1 step number 5, Task 3.2

The argument is defined as locations in Task 3.1

       @Override
       protected String doInBackground(Location... locations) {
           return null;
       }

But is referenced as params in Task 3.2

      Location location = params[0];

codelab: advanced-android 07.1: Device location

MySpringButton is Unsafed

D:\AndroidStudioProjects\ExperienceProjects\app\src\main\java\com\example\sample\experienceprojects\MySpringButton.java:
uses unchecked or unsafe operations.
Recompile with -Xlint:unchecked for details.

I copied your code only. I want to execute that but it is showing the above error. What is the solution for that?

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Advanced Android 01.2: Fragment communication][Step 4]

If you reproduce this codelab in some table emulators (for example Pixel C), the selected song doesn't work well in the fragment although all the code is correct.

In which lesson and step of the codelab can this issue be found?
Advanced Android 01.2: Fragment communication, Step 4

How to reproduce?
Run the app in Pixel C tablet.

Versions

  1. Android Studio 4.1.1
  2. API 26

Additional information
I ran the app on WXGA tablet and it worked correct but it took me some time to find the error. From the beginning it looked like an emulator error.

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.
The text reads: "Open java/values/NewAppWidget.java.". There is no "values"-subdirectory there.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)
Advanced Android 2.2: App widgets

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Lesson #01.1][Step #6][Typo and Misplaced Link]

Describe the problem
There is a typo "onaFragmentTransaction" and the "o" in "on" has a link attached to it.

In which lesson and step of the codelab can this issue be found?
Advanced Android 01.1: Fragments
Step #6 "Summary".

How to reproduce?
Scroll 75% of the way down the summary page and inspect the line that starts with "To start a series of Fragment transactions".

Versions
N/A

Additional information
N/A

codelab: advanced-android

Advanced Android: [Lesson #][Step #][description]

There is no Language Icon on Simulator (Android Studio 3.1.2)

Lesson 05.1 + Step 1.4

How to reproduce?
Image on step 1.4

Versions

  1. What version of Android Studio are you using? (Android Studio 3.1.2)
  2. What API level are you targeting? N/A

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: Advanced Android 03.1: Getting sensor data / taks 2/ 2.3 Listen for new sensor data

Describe the problem
A clear and concise description of what the problem is.
The version has changed and the code does not at all run and puts the rest of the code in bad situation !

it is impossible to do the step :

At the top of the class, modify the class signature to implement the SensorEventListener interface.

public class MainActivity
extends AppCompatActivity implements SensorEventListener {

Advanced Android: [Lesson 8][Step 2] library deprecated

Describe the problem
All the steps to configure the Places API are deprecated and the library is completely different.

In which lesson and step of the codelab can this issue be found?
Lesson 8+ step 1

How to reproduce?
Implement the library, and Android Studio informs is deprecated

Versions

  1. What version of Android Studio are you using? 4.1.1
  2. What API level are you targeting? Places API

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Lesson #Advanced Android 03.1: Getting sensor data][Step # 5-6][missprint]

Describe the problem
In the light of the previous code lines the code snippets
int sensorType = event.sensor.getType();
and
float currentValue = event.values[0];
should be clearly written as
int sensorType = sensorEvent.sensor.getType();
and
float currentValue = sensorEvent.values[0];
To allow comfortable copy-pasting without looking for the source of the error message :)

In which lesson and step of the codelab can this issue be found?
https://developer.android.com/codelabs/advanced-android-training-sensor-data#3
Advanced Android 03.1: Getting sensor data
steps 5 and 6

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
    4.1.1
  2. What API level are you targeting?
    starting from 16th I guess…

Additional information
probably just an educational missprint :))

codelab: advanced-android

Advanced Android: [Advanced Android 03.1: Getting sensor data Task 1

Describe the problem
A clear and concise description of what the problem is. the code has change with new 1.4 version of Kotlin

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android
The code is 👍
package com.productivix.sensorsurvey

import android.R.layout
import android.hardware.Sensor
import android.hardware.SensorManager
import android.os.Bundle
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity

class MainActivity : AppCompatActivity() {
private var mSensorManager: SensorManager? = null

// Individual light and proximity sensors.
private var mSensorProximity: Sensor? = null
private var mSensorLight: Sensor? = null

// TextViews to display current sensor values
private var mTextSensorLight: TextView? = null
private var mTextSensorProximity: TextView? = null

override fun onCreate(savedInstanceState: Bundle?) {
    super.onCreate(savedInstanceState)
    setContentView(R.layout.activity_main)
  /*  mSensorManager = this.getSystemService(SENSOR_SERVICE) as SensorManager?
    val sensorList = mSensorManager?.getSensorList(Sensor.TYPE_ALL)
    val sensorText = StringBuilder()
    if (sensorList != null) {
        for (currentSensor in sensorList) {
            sensorText.append(currentSensor.name).append(
                    System.getProperty("line.separator"))
        }
    }
    val sensorTextView = findViewById<View>(R.id.sensor_list) as TextView
    sensorTextView.text = sensorText */

    mTextSensorLight = findViewById(R.id.label_light)
    mTextSensorProximity = findViewById(R.id.label_proximity)

    mSensorProximity =
            mSensorManager?.getDefaultSensor(Sensor.TYPE_PROXIMITY)
    mSensorLight = mSensorManager?.getDefaultSensor(Sensor.TYPE_LIGHT)

    val sensor_error = resources.getString(R.string.error_no_sensor)
    if (mSensorLight == null) {
        mTextSensorLight?.setText(sensor_error);
    }
    if (mSensorProximity == null) {
        mTextSensorProximity?.setText(sensor_error);
    }

}

}

Advanced Android: [Lesson #][Step #][description]

Describe the problem
preserving the playback does not work with the code given in the codelab.

In which lesson and step of the codelab can this issue be found?
Lesson 13.1, Step 1.5

How to reproduce?
follow the steps given in codelab.

Versions

  1. Android Studio 3.6.2
  2. API Level 21 and above

Additional information
CurrentPosition needs to be preserved in the onPause() method. preserving it in the onSavedInstanceState defeats the purpose. this thread describes the solution :
https://stackoverflow.com/questions/12617209/playing-video-from-the-pause-state-in-videoview/12617573#12617573

codelab: advanced-android

Some "missing" comments and typos

In https://github.com/google-developer-training/android-advanced/blob/master/SensorListeners/app/src/main/java/com/example/android/sensorlisteners/MainActivity.java

switch (sensorType) {
            // Event came from the light sensor.
            case Sensor.TYPE_LIGHT:
                // Set the light sensor text view to the light sensor string
                // from the resources, with the placeholder filled in.
                mTextSensorLight.setText(getResources().getString(
                    R.string.label_light, currentValue));
                break;
            // Event came from the proximity sensor. <-- this comment is "missing" 
            case Sensor.TYPE_PROXIMITY:
                // Set the proximity sensor text view to the light sensor <-- typo here, should be proximity instead of light
                // string from the resources, with the placeholder filled in.
                mTextSensorProximity.setText(getResources().getString(
                    R.string.label_proximity, currentValue));
                break;
            default:
                // do nothing
        }

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android 13.1: Step 4 Task 2. Play Video on the Internet

Describe the problem
My project throws a filenotfoundexeption when it runs. The file is an mp4 file stored at Google Storage. It's stored in a bucket marked public to internet.

2020-08-19 00:09:48.064 8519-8519/com.example.simplevideoview W/MediaPlayer: Couldn't open https://storage.googleapis.com/...
java.io.FileNotFoundException: No content provider: https://storage.googleapis.com/appvideo_bucket/cuttingoutstencils.mp4

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)
Advanced Android 13.1, Step 4

How to reproduce?
What are the exact steps to reproduce the problem?
I run the app. The app runs, the video view runs, the "buffering..." text shows for 30 seconds. Then the app stops. The video never plays.

Versions

  1. What version of Android Studio are you using?
    Android Studio 4.0.1

  2. What API level are you targeting?
    29

Additional information
Add any other context about the problem here.

codelab: advanced-android

Bug in CustomEditText Touch Listener

if (getLayoutDirection() == LAYOUT_DIRECTION_RTL) {
// If RTL, get the end of the button on the left side.
clearButtonEnd = mClearButtonImage
.getIntrinsicWidth() + getPaddingStart();

This line comes from the implementation of touch listener in EditTextWithClear file. If the layout direction is RTL, the getPaddingEnd() should be used instead of getPaddingStart(). In RTL, getPaddingStart will give padding on the right side and getPaddingEnd will give padding on the left side.

Advanced Android: [Lesson #][Step #][description]

Describe the problem
wrong argument of attributes in constraintLayout

app:layout_constraintTop_toBottomOf = "parent" of "@+id/label_light"

In which lesson and step of the codelab can this issue be found?
4. Task 2. Get sensor data

How to reproduce?
read the article

Versions

  1. version of Android Studio : 4.0.1
  2. API level : 29

Additional information

codelab: advanced-android

Advanced Android: [Lesson #][Step #][description]

Describe the problem
A clear and concise description of what the problem is.

This API IS DEPRECATED, BUT "Last updated Mar 30, 2021" !!! Are you kidding ?????

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

Advanced Android 08.1: Places API

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using? 4.1.3
  2. What API level are you targeting? 17

Additional information
Add any other context about the problem here.

codelab: advanced-android

Advanced Android: [Advanced Android 03.1: Getting sensor data][4.5]

The issue I found in codelab on the mentioned topic is at this line
"int sensorType = event.sensor.getType();" here "event" keyword get's out of scope.

I founded these issue in Lesson 03.1, Step 4.5

How to reproduce?
Do same as given in codelab and would reproduce the error.

Versions
Version 29
API 29

Solution to the problem:
instead of word "Event" it can changed to "sensorEvent" as in method will resolve error.

codelab: advanced-android

Advanced Android: [Lesson #][Step #][description]

https://codelabs.developers.google.com/codelabs/advanced-android-training-google-maps/index.html?index=..%2F..advanced-android-training#3

  1. Task 2. Add map types and markers

2.4 Add POI listener

public void onPoiClick(PointOfInterest poi) {
Marker poiMarker = mMap.addMarker(new MarkerOptions()
.position(poi.latLng)
.title(poi.name);
}

// ) is missing after poi.name. Correct code should be as follow:

public void onPoiClick(PointOfInterest poi) {
Marker poiMarker = mMap.addMarker(new MarkerOptions()
.position(poi.latLng)
.title(poi.name));
}

Advanced Android: [Lesson 02.1: App widgets][Step 4][Typo in article]

Describe the problem
In the section 2.1 Add the widget layout, these is a typo in Attribute form of LinearLayout: android:style, it should be style.

In which lesson and step of the codelab can this issue be found?
Lesson 02.1: App widgets : Step 4

How to reproduce?
Read the article

Versions
N/A

Additional information
None

codelab: advanced-android

Bug in code

IN solution code for: WalkMyAndroidPlaces-Solution there is invalid constant in
method MainActivity.java:

private static final int REQUEST_PICK_PLACE = 2;

has to be changed to:
private static final int PLACE_PICKER_REQUEST = 1;

othervise when SELECT place button is pressed there is NO place information.

Enjoy.

Advanced Android: [03.2: Sensor-based orientation][Step4][Section2.1.4]

Describe the problem
In activity_layout.xml, add an ImageView after the inner ConstraintLayout, and before the outer one. Use these attributes:

to

In activity_main.xml, add an ImageView after the inner ConstraintLayout, and before the outer one. Use these attributes:

In which lesson and step of the codelab can this issue be found?
Advanced Android 03.2: Sensor-based orientation

  1. Task2, Section 2.1 #4

codelab: advanced-android

Android 9

Describe the problem
A clear and concise description of what the problem is.

In which lesson and step of the codelab can this issue be found?
Lesson number + step number. (e.g., Lesson 1.1, Step 1.3)

How to reproduce?
What are the exact steps to reproduce the problem?

Versions

  1. What version of Android Studio are you using?
  2. What API level are you targeting?

Additional information
Add any other context about the problem here.

codelab: advanced-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.