emericg / WatchFlower

A plant monitoring application that reads and plots data from compatible Bluetooth sensors and thermometers like Xiaomi 'Flower Care' or Parrot 'Flower Power'
https://emeric.io/WatchFlower
GNU General Public License v3.0
192 stars 27 forks source link

support for androidx #23

Closed awesomeerictech closed 3 years ago

awesomeerictech commented 3 years ago

Hello emericg i love the project but it would be better if you moved to androidx and abandon v4

implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core:1.1.0' implementation 'androidx.annotation:annotation:1.1.0'

awesomeerictech commented 3 years ago

Ahaa i made it work

in class QShareUtils change

import android.support.v4.content.FileProvider; import android.support.v4.app.ShareCompat;

To

import androidx.core.content.FileProvider; import androidx.core.app.ShareCompat;

Then in build.gradle add

implementation 'androidx.appcompat:appcompat:1.1.0' implementation 'androidx.core:core:1.1.0' implementation 'androidx.annotation:annotation:1.1.0'

Finally in Android Manifest change

    <provider android:name="android.support.v4.content.FileProvider"
              android:authorities="com.emeric.watchflower.fileprovider"
              android:grantUriPermissions="true" android:exported="false">
        <meta-data android:name="android.support.FILE_PROVIDER_PATHS" android:resource="@xml/filepaths"/>
    </provider>

to

emericg commented 3 years ago

Hi. This is very interesting, I had not much knowledge about this "new" appcompat from androidx. I'll try to use it in my builds and see if the actual feature is still working (I believe you only tested the compilation). This part of the code is only used to send the CSV export file to another app (instead of saving it to the SD card). But I have other apps that are making extensive use of the FileProvider, so it might be very useful.

Regarding the actual problem, you're probably just not using the same Android SDK than me (25.3.1) right?

awesomeerictech commented 3 years ago

Hi ,I normally use androidx as a replacement for app compat libraries wherever I am calling Java Code from Qt, all your projects including mini infos use V4, I have converted all of them to androidx and it's rather fast modern and supported by Android . I normally use component based software engineering so I only use Themed Engine from your project rather than creating it from scratch, I am using build tool 30 NDK 21 and API Level 30 , Android.

On Fri, Jan 29, 2021, 21:55 Emeric notifications@github.com wrote:

Hi. This is very interesting, I had not much knowledge about this "new" appcompat from androidx. I'll try to use it in my builds and see if the actual feature is still working (I believe you only tested the compilation). This part of the code is only used to send the CSV export file to another app (instead of saving it to the SD card). But I have other apps that are making extensive use of the FileProvider, so it might be very useful.

Regarding the actual problem, you're probably just not using the same Android SDK than me (25.3.1) right?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/emericg/WatchFlower/issues/23#issuecomment-769985930, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIS452YRHSOKDTDQIEN6X3S4MABRANCNFSM4WYK623Q .

emericg commented 3 years ago

That's pretty cool, I'm not aware of anyone else building my projects on Android. The appcompat library seems to be in the SDK not the NDK, out of curiosity do you know what version you are using? Also, same question with Qt. I'm using 5.15 everywhere except on Android where I use 5.13, where more recent versions are just not working the same way... (I have problem with Qt Creator detecting Qt version and Android package creation)

I'll give androidx a try tomorrow then!

awesomeerictech commented 3 years ago

I am using Qt 5.15.2 and I will be moving to Qt 6 very very soon, please try androidx it is the one being developed and supported by android as we speak and future versions of android will only be supporting androidx , again I also found it necessary to create custom build.gradle in your projects please consider that too, thanks much for your big projects.

On Fri, Jan 29, 2021, 22:22 Emeric notifications@github.com wrote:

That's pretty cool, I'm not aware of anyone else building my projects on Android. The appcompat library seems to be in the SDK not the NDK, out of curiosity do you know what version you are using? Also, same question with Qt. I'm using 5.15 everywhere except on Android where I use 5.13, where more recent versions are just not working the same way... (I have problem with Qt Creator detecting Qt version and Android package creation)

I'll give androidx a try tomorrow then!

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/emericg/WatchFlower/issues/23#issuecomment-769999763, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIS4533P6NPDAEYANH3HFTS4MDGPANCNFSM4WYK623Q .

emericg commented 3 years ago

OK I've tested it with MiniVideo Infos and it seems to work exactly the same. I've also updated the manifest, added a build.gradle and other stuff to work with Qt 5.15. I'll do the same for the next version of WatchFlower tomorrow.

However Qt 6 will not be supported any time soon for most of my projects. They have removed many things that I use, like Qt Bluetooth, Qt Multimedia and also QtGraphicalEffects (?).

awesomeerictech commented 3 years ago

Hi Qt 6 is not yet mature , you know Qt 5.15 is LTS, I think 3 years since the first release, so I don't know what Qt company thought but I am hoping they will be supporting those features too after LTS, yeeeah Android is working fine , I am also thinking about adding a service to watchflower for background information , myself too most of my projects are utilizing Qt 5.15.2 Qt 5.15.0 has several bugs please move to 5.15.2 which has fixed most of them, I will be checking on updated minivideo and watchflower,thanks.

On Sun, Jan 31, 2021, 22:13 Emeric notifications@github.com wrote:

OK I've tested it with MiniVideo Infos and it seems to work exactly the same. I've also updated the manifest, added a build.gradle and other stuff to work with Qt 5.15. I'll do the same for the next version of WatchFlower tomorrow.

However Qt 6 will not be supported any time soon for most of my projects. They have removed many things that I use, like Qt Bluetooth, Qt Multimedia and also QtGraphicalEffects (?).

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/emericg/WatchFlower/issues/23#issuecomment-770433703, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIS454AQJQXKUOITNWNX7TS4WTVBANCNFSM4WYK623Q .

emericg commented 3 years ago

please move to 5.15.2

OK I've pushed the changes to WatchFlower, it should be allright now.

you know Qt 5.15 is LTS

Unfortunately Qt 5.15 LTS support is already over, unless you pay a commercial license... That sucks hard.

I am also thinking about adding a service to watchflower for background information

If you plan to work on that please let me know so we can sync up. At the moment I want to :

awesomeerictech commented 3 years ago

Let me try to find the right way of doing it using Qt remote objects and android services and where it is relevant

On Mon, Feb 1, 2021, 23:17 Emeric notifications@github.com wrote:

please move to 5.15.2

OK I've pushed the changes to WatchFlower, it should be allright now.

you know Qt 5.15 is LTS

Unfortunately Qt 5.15 LTS support is already over, unless you pay a commercial license... That sucks hard.

I am also thinking about adding a service to watchflower for background information

If you plan to work on that please let me know so we can sync up. At the moment I want to :

  • Finish the device history synchronization first for WatchFlower version 1.0 (that's mostly done)
  • Then move to fix Android notifications for recent Android version (NotificationManager::updateAndroidNotification() was able to send notifications, but I think it needs an overhaul to work with API 26+, related to that https://codereview.qt-project.org/c/qt/qtandroidextras/+/292936)
  • Then work on an Android background service. I have no idea how that would work, but you can already start WatchFlower in "daemon" mode without UI, so I guess that's where I would start.

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/emericg/WatchFlower/issues/23#issuecomment-771129914, or unsubscribe https://github.com/notifications/unsubscribe-auth/APIS45ZVULWWYAYEXHEAADDS44D7LANCNFSM4WYK623Q .