Closed jubeira closed 5 years ago
/cc @eborghi10 @ernestmc
Hello, I am not a pro, but I have tried to fix the notifications issue on oreo. I have changed some UI components, for easy ergonomics. I can put a pull request, if you say so. Here is the link to my code : https://github.com/blmhemu-rosjava/android_core
@blmhemu thanks for the heads up! The last time I tried the current code here I didn't have issues with the shutdown notification. I still need to polish the PR a bit and double check that everything is going well (e.g. update build tools; the new Gradle uses the required one anyways), but so far it seems to work well on newer Android devices.
After this PR is merged, we can update the notification functionality if there's a better way to do it in a follow-up PR. The only thing I'd recommend is keeping PRs as atomic as possible in that case.
This and https://github.com/rosjava/android_apps/pull/80 are ready.
Note that https://github.com/rosjava/rosjava_bootstrap/pull/73 is necessary for this to work; otherwise the new Android Gradle plugin will not be found.
@ernestmc to build this without merging the PR in rosjava_bootstrap
, replace the buildscript
block in the top level build.gradle
with this:
// Replace external buildscript with this
buildscript {
apply from: "https://github.com/jubeira/rosjava_bootstrap/raw/task/add_google_repo/buildscript.gradle"
dependencies {
classpath "com.android.tools.build:gradle:3.2.0"
}
}
apply plugin: 'catkin'
// Add repositories block here
allprojects {
group 'com.github.rosjava.android_apps'
version = project.catkin.pkg.version
repositories {
google()
jcenter()
}
}
After merging the PR in rosjava_bootstrap
it shouldn't be necessary to hack this file to build the project.
@jubeira I'm currently experiencing the issues related to the NotificationCompat
as you described. While waiting for the PR to be merged, would it be possible to ask you how I might be able to apply the patch to an existing ROS Android Application?
EDIT : I ended up compiling android_core
from jubeira:android_9_support
and linking the .AAR file. Let me know if there's a better way.
@yycho0108 sorry for the delay, I've been out for some weeks.
I would have suggested exactly what you did. If you are a ROS / catkin user you can place this version of android_core
in the same workspace as your application. By making your app depend on android_core[0.4, 0.5)
it will be built on top of this and you will have the latest patches and updates.
By any chance, did you encounter any problems when using this code? I'd like to get as much feedback as possible before merging it.
@jubeira It's been some time since I setup the library for the project, but I think when I tried to setup the source dependencies something about how the manifest.srcFile
was specified in sourceSets
in build.gradle
wasn't quite compatible with Android Studio. It might work fine with Eclipse or catkin-based build configuration.
While the issue was perplexing, compiling the library and linking to it wasn't that painful anyways, so I think it's fine - I haven't had a runtime/build error coming up for the project itself.
By the way, thank you for fixing the errors and upgrading android_core
to be compatible with the newer APIs -- it made development much easier, and the bug could have been a show-stopper for the project I was working on!
Update: I updated everything related to Android and I tested building android_apps
afterwards.
With the last fix in #291 everything ran smoothly.
I also added a note to the tutorials about creating Android packages (and projects) here, and updated the required build tools here.
It would be great to restore a way to create Android packages from the command line directly; I'll update the issue about that.
This is awesome! Any idea if I can get to the updated android_core_components through maven?
@swarmt the PR is open here: https://github.com/rosjava/rosjava_mvn_repo/pull/62. Could you try targeting that branch and testing it out? It would be awesome to have it tested somehow before merging.
I could be doing something wrong here but I can't get org.ros to resolve when targeting your branch. I have however compiled and used your android_core_components no problems on a couple of devices. Thanks for updating it!
This PR allows creating apps for Android 9 on top of
android_core
.Some notes:
NotificationCompat
was deleted from the support library v27. When upgrading the API target, Android Studio suggests upgrading the support library as well.Notification
class without compatibility libraries is available since API 16. Since devices up to API 15 nowadays represent less than 1% of the total devices around, I strongly suggest raising the minimum API level and stop using deprecated compatibility stuff. API 16 is still really old nowadays, and it's far more useful to be able to develop applications for current devices. Furthermore, starting on November 1, 2018, applications with target SDK < 26 won't be allowed to be released / updated to the Play Store.android_10
andandroid_15
into one Gradle project (android_core
), and bump the package version to0.4.0
.TODO list:
android
command is no longer available, so the command line cannot be used anymore to create new projects. The best approach would be to start on top of an existing application in Android Studio.Any comments regarding this are welcome! Similar upgrades will be applied to
android_apps
regarding the minimum SDK version.