advancedandroid_shushme's Issues
Updated Gradle & Dependencies
As of today, this build.gradle works for me (StarterCode):
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion "28.0.3"
defaultConfig {
applicationId "com.example.android.shushme"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
api fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
api 'com.android.support:appcompat-v7:28.0.0'
api 'com.android.support:recyclerview-v7:28.0.0'
testImplementation 'junit:junit:4.12'
api ('com.google.android.gms:play-services-places:16.0.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
api ('com.google.android.gms:play-services-location:16.0.0') {
exclude group: 'com.android.support', module: 'support-v4'
}
}
getting OVER_QUERY_LIMIT regularly. And search showing only cities.
Places Api Deprecated
Recycler view swipe to delete location
Hello,
I wonder if there is a feature in app to swipe to delete place, or I'm missing something?
Regards, Miroslav Maksimovic
GeofencingApi is deprecated
It have been replace by "GeofencingClient" but how do you integrate that in the code ?
public void registerAllGeofences(){
if (mGoogleApiClient == null || mGoogleApiClient.isConnected() || mGeofenceList == null || mGeofenceList.size() == 0) {
return;
}
try {
LocationServices.GeofencingApi.addGeofences(mGoogleApiClient, getGeofencingRequest(), getGeofencePendingIntent()).setResultCallback(this);
} catch (SecurityException securityException) {
Log.e(TAG, securityException.getMessage());
}
}
public void unRegisterAllGeofences() {
if (mGoogleApiClient == null || !mGoogleApiClient.isConnected()) {
return;
}
try {
LocationServices.GeofencingApi.removeGeofences(
mGoogleApiClient,
// This is the same pending intent that was used in registerGeofences
getGeofencePendingIntent()
).setResultCallback(this);
} catch (SecurityException securityException) {
// Catch exception generated if the app does not use ACCESS_FINE_LOCATION permission.
Log.e(TAG, securityException.getMessage());
}
}
Become ?
Cloning error
Due to some issue in github, this project was unable to be cloned.
Not able to add location because the activity closes with resultCode = 2
Steps:
- Click Add new location button
- The map is opened. Before I click anything, it returns to the main activity.
While debugging I see that the resultCode in onActivityResult is always 2.
Xperia z5 Compact (Android 7.0)
i just applied this solution but the recyclerView shows nothing on the Mainactivtiy screen. the location i in DB but it is not shown on the screen
i just applied this solution but the recyclerView shows nothing on the Mainactivtiy screen. the location i in DB but it is not shown on the screen
Originally posted by @moharidy in #20 (comment)
place.getAddress().toString on a Null Pointer Reference
In the branch T0X.03-Solution-GetPlaceById, whenever a location is selected the app crashes saying
07-01 07:32:45.813 1528-1528/com.example.android.shushme E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.android.shushme, PID: 1528 java.lang.RuntimeException: Failure delivering result ResultInfo{who=null, request=1, result=-1, data=Intent { (has extras) }} to activity {com.example.android.shushme/com.example.android.shushme.MainActivity}: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference at android.app.ActivityThread.deliverResults(ActivityThread.java:3659) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3702) at android.app.ActivityThread.access$1300(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:905) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:700) Caused by: java.lang.NullPointerException: Attempt to invoke interface method 'java.lang.String java.lang.CharSequence.toString()' on a null object reference at com.example.android.shushme.MainActivity.onActivityResult(MainActivity.java:172) at android.app.Activity.dispatchActivityResult(Activity.java:6218) at android.app.ActivityThread.deliverResults(ActivityThread.java:3655) at android.app.ActivityThread.handleSendResult(ActivityThread.java:3702) at android.app.ActivityThread.access$1300(ActivityThread.java:155) at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1366) at android.os.Handler.dispatchMessage(Handler.java:102) at android.os.Looper.loop(Looper.java:135) at android.app.ActivityThread.main(ActivityThread.java:5343) at java.lang.reflect.Method.invoke(Native Method) at java.lang.reflect.Method.invoke(Method.java:372)
Does this app run
I followed instructions for the shushme app exercise. I even took the final solution updated my key and tried to run it but I have not been able to see any notifications or any indication that is changing the ring. Does anyone have a git with a running version? that does what is required as intended?
PlaceBuffer must be released after use.
Google documentation says "NOTE: The calling application must release() this object after it is done with it to prevent a memory leak".
Without this I get this errors in log:
E/DataBuffer: Internal data leak within a DataBuffer object detected! Be sure to explicitly call release() on all DataBuffer extending objects when you are done with them. (internal object: com.google.android.gms.common.data.DataHolder@5ed0442)
To fix this I added if (mPlaces != null) mPlaces.release(); call at the beginning of PlaceListAdapter.swapPlaces().
places aren't getting search
Ringer mode issues
Hi!
When trying this solution final code on my phone (running with Android N), I ran into some issues which made the app crash:
-
Some packages in the GeofenceBroadcastReceiver file have not been imported, so that it does not let compile.
-
The permission for the ACCESS NOTIFICATION POLICY is not present in the Manifest.xml file.
- Since when we want to change the Ringer mode we want to make sure that Notification Policy Access is granted (in case our SDK is 24 or greater), I think the appropriate code should be:
if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && nm.isNotificationPolicyAccessGranted()))
...
and not
if (android.os.Build.VERSION.SDK_INT < 24 ||
(android.os.Build.VERSION.SDK_INT >= 24 && !nm.isNotificationPolicyAccessGranted()))
...
I actually removed the "!", since in the current version of the code we try to change the Ringer mode status when the permission is not granted...
Thanks for your great tutorials guys!
Kind regards,
Gaël
Steps to Upgrade Gradle Version and Plugin to Your Latest Android Studio
Manifest permission missing.
The manifest permission "android.permission.ACCESS_NOTIFICATION_POLICY" is missing, which is required in order to access the notification policy settings.
MAP ISN'T SHOWING || PlacePicker deprecated!!
Not able to open any map stuff because PlacePicker class is deprecated and have no official replacament for that. So, either we have to use some open source library(are available on github) or we have to write the whole boilerplate code for that. Checkout this CodeLab step by step tutorial for the same: https://developers.google.com/codelabs/maps-platform/location-places-android?index=..%2F..index#0
The map is not loading properly on pressing the Add new location button
Tested on Android 6 device
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.