Author Topic: Wifi android device synching  (Read 428608 times)

BoringName

  • Sr. Member
  • ****
  • Posts: 916
I've never posted an app on the play store so I have no experience on the matter but I think it would be crazy if google are forcing you to only support android 14.

Only 25% of all Android users are on Android 14 so you're missing out on 3/4 of the market.

You should be able to specify something like the following.
minSdkVersion 31
targetSdkVersion 34

That sets your target version to 34 (android 14) which should keep google happy and the minimum your app supports to 31 (Android 12) so people using android 12 can still install it from the play store. If you set both those flags to 34, only people running Android 14 will see the app and be able to install it.

If you go to pretty much any app on the play store and click the "About this app" button, it will list the Required OS and it will be an earlier version than Android 14. Even googles own apps like Google Messages supports Android 8.0 and up.

Again, I have no personal experience in the matter and maybe google is being a bunch of pricks because you are new developer but it doesn't make a lot of sense for them to do that.

Either way, I hope you can get passed all of google's silliness and get the app back on the play store regardless of what version it supports. I don't think I would have the patience to jump through all their hoops.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
I spent some time with the latest update (v2.6.1 dated July 10) and I'm still getting popups asking for permission to delete each of the 17,000+ files that need to be deleted. And I can't cancel it by any of the "regular" methods. No response from the back or home buttons. I have to power off the phone to get it to stop.

My next test may be to manually delete all the files and try a sync just to get my current music on the phone. That should eliminate the popups.

Will report back when I take the next step.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

hiccup

  • Hero Member
  • *****
  • Posts: 9111
So I chose to release the app as an application that is compatible only with Android 14.
Makes sense to me, and I applaud your persistence with all of this.
But still, if you get fed-up with google making you jump through all sorts of their hoops, would you consider publishing it on a site such as F.Droid?

Forum users probably wouldn't mind one way or the other?
Maybe on the contrary? Since–if I have been reading you well–it seems that the number of forum members that have been willing to create or use a google account to help bringing this to a next stage has been a bit disappointing?
(let me speak for myself, I haven't either for simply that reason)

Last Edit: July 13, 2024, 05:10:48 PM by hiccup

BoringName

  • Sr. Member
  • ****
  • Posts: 916
If it helps I got poweramp to reverse sync in the app. I had to add a line to the manifests file. Apparently it's a requirement since SDK 30 when accessing content providers.

I added
Code
<uses-permission android:name="android.permission.QUERY_ALL_PACKAGES"
        tools:ignore="QueryAllPackagesPermission" />

Google doesn't like you doing that though which is why it has the "ignore" bit there. You're supposed to add a queries section instead but this didn't work for me
Code
<queries>
        <provider android:authorities="com.maxmpz.audioplayer" />
    </queries>

Maybe you can figure out what I did wrong there and do it properly instead of the query_all_packages workaround.

Edit: Actually it probably needs to be "com.maxmpz.audioplayer.data".

I'll test it out later.
Last Edit: July 14, 2024, 06:48:29 AM by BoringName

BoringName

  • Sr. Member
  • ****
  • Posts: 916
So after some testing, you just need to add this to the manifest file. With that in place you don't need the query_all_packages permission.
Code
<queries>
        <package android:name="com.maxmpz.audioplayer" />
    </queries>

Note that it's "package android:name" and not "provider android:authority" that was listed in the previous post.

I had a few issues with Poweramp not updating playcounts when testing. Seems to be related to the stupid issue posted here.
https://forum.powerampapp.com/topic/21911-play-count-of-tracks-is-not-being-updated/

Basically Poweramp only records a play count if it shifts to playing another song when the current one ends. If you just play one song and it stops playing, the playcount is not recorded but the last played time is. Even if you have the "Count As Played" threshold set to something low like 50%.

A partial solution is listed in that thread. In the main window on Poweramp when playing a song, hold your finger down on the repeat button (second icon from the right under the song title and select "advance category". It should change the icon to an arrow pointing right. The thread above says that is the default setting but it wasn't for me.

Just keep in mind if you set a playlist to play through. If poweramp finishes the playlist and stops playing, the last song in the playlist won't get a play count. I assume the "advance category" setting above just makes it start playing the playlist again so it will record the playcount but it means your device will just keep playing until you stop it manually.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
I manually deleted all 17000+ music files and 25 playlists from the device. I then started a WiFi sync of roughly the same number of tracks and playlists. After five hours, it was a 91% completed. The next time I looked it had failed. It appears that just about all tracks (if in fact -all- tracks) had been synced, but no playlists. I shut everything down and restarted and the WiFi app kept showing that it couldn't find the server (exact words forgotten at this point.) I connected a USB cable between the device and the PC and the playlists transferred.

I have now deleted one playlist containing 88 tracks from MB. When trying to preview the app, I continually get "A non-recoverable error occurred during the synchronization process. Restart the app and try again." Restarting the app doesn't solve the issue. Force Stopping doesn't solve the issue. I restated the device and again attempted a preview to no avail. It's showing the same error. The error log shows references to "/storage/emulated/0" which is the internal storage of the device. The app is set to use the SD card. (I also don't think the log's "Copy to Clipboard" option is working as when I try to paste what was supposed to be copied there is no "paste" option. I've tried pasting to an email and a text editor on the device and there appears to be nothing in the clipboard. Here's a screen shot of most of the error log.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
I manually deleted all 17000+ music files and 25 playlists from the device. I then started a WiFi sync of roughly the same number of tracks and playlists. After five hours, it was a 91% completed. The next time I looked it had failed. It appears that just about all tracks (if in fact -all- tracks) had been synced, but no playlists. I shut everything down and restarted and the WiFi app kept showing that it couldn't find the server (exact words forgotten at this point.) I connected a USB cable between the device and the PC and the playlists transferred.

I have now deleted one playlist containing 88 tracks from MB. When trying to preview the app, I continually get "A non-recoverable error occurred during the synchronization process. Restart the app and try again." Restarting the app doesn't solve the issue. Force Stopping doesn't solve the issue. I restated the device and again attempted a preview to no avail. It's showing the same error. The error log shows references to "/storage/emulated/0" which is the internal storage of the device. The app is set to use the SD card. (I also don't think the log's "Copy to Clipboard" option is working as when I try to paste what was supposed to be copied there is no "paste" option. I've tried pasting to an email and a text editor on the device and there appears to be nothing in the clipboard. Here's a screen shot of most of the error log.
Thanks for the detailed report.

First of all, regarding the error message "A non-recoverable error occurred during the synchronization process. Restart the app and try again. This should be fixed in the latest test release, Version 2.6.4, which was just approved by Google.

As for not being able to copy to the clipboard, that was unconfirmed, as I have not touched that area at all since the original. I will check it out.

As for the other errors, I will investigate where I can think of them. I do not have an immediate answer.

BoringName

  • Sr. Member
  • ****
  • Posts: 916
This should probably be in the stickied post about 2 way syncing but this thread seems to get the most eyes on it so I will post it here and link to it from the stickied thread.

The link below is a working version of the wifi api that allows 2 way syncing with both of the supported music players, GoneMad and PowerAmp.
MB Wifi PowerAmp Sync enabled

This was tested on an Android 14 device with the trial version of PowerAmp.
My partner has been using it with GoneMad for a long time now, although that device is Android 12 I'm confident it will also work on Android 14 devices.

When you first launch the app it will ask for file permissions. It will not work without them. You need to click allow then select the MusicBee app and enable the toggle for allow access to all files. Then click the back arrow a couple of times to get back to the app.

There are a few issues listed below.
1. GoneMad needs to be unlocked for the reverse syncing of playcounts and ratings to work. You can reverse sync playlists without unlocking it, more on that further down. PowerAmp does not seem to have any restrictions in the trial version other than it runs out after 15 days.
2. This uses the all file access permission so google will not accept it in the play store. It has to be installed manually. Hopefully kimt1688 will be able to provide a play store version in the near future.
3. PowerAmp has a very silly issue with playcounts. It will only record a playcount if it shifts to playing another song. eg) if it's playing Song A and when that ends it starts playing Song B, Song A will get a play count recorded. If it's playing Song A and stops playing when it ends, Song A will not get a play count recorded but it does update the last played time (its pretty dumb and has been an issue for years). if you set a playlist to play through and it stops playing after the last song in the playlist has played, the last song in that playlist will not get a play count.
On the main player window, under the song name there is a repeat button (second from the right) if you hold your finger on this and select Advance Category this will make PowerAmp always start playing another song when the current playing song ends, this should mitigate the problem most of the time. If you are playing a playlist, advance category will make it start playing the next playlist. If it's the last playlist on the device it will go back to playing the first playlist.
4. Ratings in PowerAmp default to thumbs up/down, these do not sync back. You need to change the PowerAmp settings "Rating Type" to "5 stars". They sync back fine after that. You can test by changing a rating and doing a sync preview, even if the play count or last played hasn't changed it will register the rating change.

Playlists

PowerAmp
Reverse syncing of playlists can't be done with PowerAmp as any playlists created in the app are not saved into a separate folder. They are just stored in the PowerAmp database, this can be queried but I wouldn't know where to start to have this work correctly. PowerAmp does monitor the music folder for Playlists and adds them as a playlist file. These can be added and deleted during the sync, you just can't add a playlist in PowerAmp and have it appear in MusicBee. You can remove a song from an existing playlist in Poweramp but when you do that it changes the layout and Musicbee thinks the playlist file is now empty. So reverse syncing of playlists for PowerAmp will remain disabled.

GoneMad
There are 2 versions of GoneMad on the play store. Classic and Standard. Both are trial versions and need to be unlocked to reverse sync ratings and play counts.
GoneMad saves playlists in a default folder. In standard this can't be changed but it can be changed in the Classic Version.
For standard you need to set the "Playlists Path" in MusicBee's device settings for your device to gmmp\playlists
For Classic you can set it the same or you can specify your own, like Music\playlists\ but you need to make sure you set GoneMad Classic to the same folder.

In the GoneMad app go to Settings->Playlists->Playlist Storage Path
Unfortunately it doesn't have a folder selection dialog so you have to enter the path manually and it has to be the full path like this -
storage/emulated/0/Music/Playlists

Reverse syncing for playlists in GoneMad seems to work fine. I was able to alter playlists by removing songs or create brand new playlists and they all synced back to Musicbee ok.

Other Issues

Because playcounts are not actually stored in the file in Musicbee, the music players do not receive the initial play count. When you first load the app all songs have a play count of zero. I can't find the play count listing in GoneMad but you can see the play count for each song in PowerAmp. The playcount listed in the apps will only be the number of times the song has been played through the app. The wifi sync just appends this playcount to the play count in Musicbee whenever a song has been played. I don't know how Musicbee keeps track of what are new playcounts, I guess it must compare last played timestamps and work out the difference.
The way it works can cause a problem though. I noticed if I had a song in PowerAmp with a play count that had already been updated in Musicbee, that play count would get duplicated if I uninstalled the Musicbee wifi app and reinstalled it and did a sync. So if you reinstall the Musicbee wifi app for any reason, make sure you reset the music player database otherwise you will get a lot of duplicated play counts.

There is a bug with "delete files that are not on the auto-sync list from device". if you have this option ticked for your device in Musicbee and delete a playlist from Musicbee. When you do a preview sync in the Wifi App that playlist will get deleted. It only seems to be an issue with playlists, any songs that need deleting will display in the preview window and will not be deleted until you do a full sync. But playlists will get deleted even with just a preview.
I believe this is a bug on Musicbee's end and not the app as Musicbee sends it commands on what to delete etc...I will check with Steven.


The above issue has been fixed with the patched version listed here - https://getmusicbee.com/forum/index.php?topic=41468.msg225443#msg225443
Last Edit: July 16, 2024, 04:05:19 AM by BoringName

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
First of all, regarding the error message "A non-recoverable error occurred during the synchronization process. Restart the app and try again. This should be fixed in the latest test release, Version 2.6.4, which was just approved by Google.
Using 2.6.4 I am still getting the non-recoverable error" and the error log shows it's still trying to sync with internal storage, despite that it's set to use the SD card.

I (we) can worry about the clipboard issue later as long as you can accept screenshots when (if) I need to show you something new in the error log.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
The sync has now failed four times and I'm giving up. The most recent sync failed at 80%. But each time I start it again, it asks if I want to delete 17,285 files. So what is it doing during that 80%? It's not deleting files even though it says it is. And and if it's waiting for me to tap "allow," that's not going to happen 17,285 times.

I have reproduced the phenomenon where I am asked to confirm every time I delete this file.
This occurred during testing on an Android 12 device in the process of trying to revert to Android 12-14 support.
I don't know the cause yet, but since it occurred at my end, I may be able to do some research.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
I don't know the cause yet, but since it occurred at my end, I may be able to do some research.
Good to hear. Do not feel rushed to get this fixed for me. The problem occurs for me on my tablet, which it not my primary portable listening device. It's not even my secondary listening device. But at some point I would like to be able to get my current music on it via WiFi.

Thanks.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
I don't know the cause yet, but since it occurred at my end, I may be able to do some research.
Good to hear. Do not feel rushed to get this fixed for me. The problem occurs for me on my tablet, which it not my primary portable listening device. It's not even my secondary listening device. But at some point I would like to be able to get my current music on it via WiFi.

Thanks.

Since changing the target OS to Android 12-14, there have been no major error reports, although there are some pending errors, so I have been concentrating on Android 12 support.
In the process, I've been looking into how the delete and edit confirmation dialogs in Scoped Storage appear and how to turn them off, and I've implemented them.
I have only tested it on my Android 12 device, but the extra processing for Android 12 does not affect Android 13 and 14, and the suppression of the confirmation dialog is effective regardless of the version, so I hope you will try it.

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
Thanks for the update. I'll give it a try tomorrow and report back.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

phred

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 10268
New version still gives me "A non-recoverable error occurred during the synchronization process. Restart the app and try again.
This happens on a preview and with sync now. I have restated the device (Samsung tablet) closed MB and restarted the PC. Can't get past it.
Download the latest MusicBee v3.6 patch from here.
Unzip into your MusicBee directory and overwrite existing files.

----------
The FAQ
The Wiki
Custom Forum Search
Posting screenshots is here

kimt1688

  • Jr. Member
  • **
  • Posts: 109
Having met the closed test termination requirements, at least 20 people and 14 days, I submitted a request to Google to terminate the test and move on to the next step.
The application was approved and the official version can now be released or open testing can be performed.
Currently, there are still some issues to investigate and resolve, such as "A non-recoverable error occurred during the synchronization process. Restart the app and try again.” Poweramp link implementation remains to be done.
The implementation of the Poweramp link has been finished building the library, and the test app is enumerating filenames with a play count of 1 or more, so I expect to be able to complete it in the near future once I get the necessary information together.
I would like to do a little more open testing to work out the bugs and then release it as an official version once the Poweramp link implementation is finished.