freshollie / monkeyboard-radio-android

Monkeyboard - FM & DAB/DAB+ radio for android
GNU General Public License v3.0
38 stars 18 forks source link

Error running latest codebase on API below 23 #2

Closed thnilsen closed 7 years ago

thnilsen commented 7 years ago

With the latest version of your code - the error "Unfortunately, Monkeyboard Dab Radio has stopped" is still produced on devices running API level below 23 when the application is launched.

Running with API level 22 (5.1) the error is triggered by the .setForeground method. I believe this is caused by the usage of the certain View methods that are missing in API below 23. Ref: https://code.google.com/p/android/issues/detail?id=186273

Running with API level 17 (4.2) the error is somewhat different. See log files for details.

20170217-API_17-4.2.2-log.txt

20170217-API_22-5.1.1-log.txt

freshollie commented 7 years ago

Try again with this latest change, I missed another instance where I had used set foreground.

freshollie commented 7 years ago

As for the 4.2 error, hardly any information is provided by the error code. I know that it can't find a resource somewhere in the layouts but I'm not sure which. Without an android device of 4.2 I cannot test it.

thnilsen commented 7 years ago

Latest code now loads on 5.1.

I'll play around with the code on a 4.2 device and see if I can figure it out.

Thanks for all your effort so far.

freshollie commented 7 years ago

Any update on this? If you find a fix, fork the repo and submit a pull request.

thnilsen commented 7 years ago

I've managed to get the code running on my 4.2.x devices. For my head unit I had to lower the API level to 16 to get it to install. Most of the issues relate to changes in API. I have produced a patch file that you can review. If you still think its worth me forking your repo I can do so.

The changes to the layout files should be reviewed. I've dropped the android:background statements as this is not compatible with API below 21, but I have not analysed what that statement actually does so it might be needed for a reason?

patch-support-APIv16.txt

The patch does not resolve all issues. Two things that still needs to be resolved are:

  1. RadioPlayerNotofication:buildNotification - the setSmallIcon and setLargeIcon code is disabled as I've not been able to get this to work on the 4.x code. You can probably see a quick fix for this?
  2. On API 16 devices the screen layout is somewhat strange as some of the icons are misplaced/missing as you can see from the screenshot. From API 17 and on the layout is as expected. The code still runs fine on API 16. device-2017-02-19-133243
freshollie commented 7 years ago

Managed to get the emulator working on my system, working on fixes now

freshollie commented 7 years ago

Fixes were as followed:

If you want to view these fixes in detail please see the next commit changes.

freshollie commented 7 years ago

Another fix for builds lower than 17:

freshollie commented 7 years ago

Give that a go, I have fixed many things

thnilsen commented 7 years ago

Thanks for the update. Nearly there. It now only fails in StationListAdapter.java with NoSuchMethodError: android.content.res.Resources.getColor

        stationCard.stationItemBackground.setAlpha(1f);
        if (position == currentStationIndex) {
            stationCard.stationItemBackground.setBackgroundColor(
                    stationCard.stationItemBackground.getResources()
                            **.getColor(**R.color.colorPrimaryDark, null)

Would it not be fixable with calling ContextCompat.getColor(...)

Otherwise it looks good!

freshollie commented 7 years ago

Yes, you are correct. Try again.

thnilsen commented 7 years ago

All looks well on devices with API 17 and above.

On my head unit with API 16 I get managed to start the app once, then after it had copied the channels from the board it started producing the "Unfortunately, Monkeyboard Dab Radio has stopped" error. The widget in the pulldown menu is still visible and works, so I can listen and change the stations from there.

I will try and get a laptop set up with Android studio so that I can debug this from the car. Give me a day or two to get this done.

-Thomas

freshollie commented 7 years ago

Brilliant, thanks for the testing. You might be able to find an app to send a log file to an email address. This is all I would need to fix the bug, the fact that everything is working other than the playing activity suggests something is going wrong with the station list on <=API 16.

Please open a new issue with updates on this as we have solved the concern this issue was raised for.

freshollie commented 7 years ago

Any update on this?

thnilsen commented 7 years ago

I can confirm that the latest version has fixed this issue on my test tablet. I'm pretty certain I tested this function before with the monkeyboard connected, without the volume in the app reacting to hardware volume buttons. But it now works so no need to spend more time on it.

On my head unit it is a completely different issue as the rotary volume dial is not actually sending any KEYCODE_x_y events at all. I have not spent any time on researching this issue yet. For some strange reason the unit is sending KEYCODE_MEDIA_NEXT/PREVIOUS when using the other available rotary dial. But for now I'm happy that your application runs and works I can pick up the radio stations.

Thanks for all you hard work on this app.

On 22. feb. 2017 22:50, Oliver Bell wrote:

Any update on this?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/freshollie/MonkeyboardAndroidRadioApp/issues/2#issuecomment-281815798, or mute the thread https://github.com/notifications/unsubscribe-auth/AKIJiHuvUyb8TxTgw3GLAkEOay_wa5SPks5rfK2ygaJpZM4MEwQ1.

Jesey158 commented 7 years ago

Hallo Olliver,

ich habe den Link von Walter Zengel bekommen, da ich bisher die App von ihm genutzt habe. Habe jetzt deine aktuelle App auf mein Nexus 7 (2013) mit Timurt´s Kernel installiert. Funktioniert soweit ganz gut. Das Tablet ist im Audi verbaut und mit einem Joycon.exc mit dem Can-Bus verbunden. Somit kann ich das Tablet über die Lenkradfernbedienung steuern. Auch deine App reagiert sehr gut um die Sender mit next Track- previus Track zu wählen. Doch wenn ich die Back Taste drücke schließt zwar die App, aber die Audioausgabe läuft leider weiter. Ist es möglich den Exit Button mit einer Hardwaretaste zu belegen? Und die App ist blau als Hintergrund. Wie könnte ich den in rot ändern (weil im Audi)

Gruß Silvio Gesendet von Mailhttps://go.microsoft.com/fwlink/?LinkId=550986 für Windows 10

Von: Oliver Bellmailto:notifications@github.com Gesendet: Mittwoch, 22. Februar 2017 22:50 An: freshollie/MonkeyboardAndroidRadioAppmailto:MonkeyboardAndroidRadioApp@noreply.github.com Cc: Subscribedmailto:subscribed@noreply.github.com Betreff: Re: [freshollie/MonkeyboardAndroidRadioApp] Error running latest codebase on API below 23 (#2)

Any update on this?

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHubhttps://github.com/freshollie/MonkeyboardAndroidRadioApp/issues/2#issuecomment-281815798, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYtPjJOCCKolfpJXtkuAomoJiUvT8Mxcks5rfK2ygaJpZM4MEwQ1.

freshollie commented 7 years ago

Hi Jesey,

I don't speak German so I could use google translate on your comment but it probably won't be very good.

If this is not an issue related to this topic, please create a new issue and write in English if you can.

Thanks

Jesey158 commented 7 years ago

[Hier klicken!]http://www.incredimail.com/app/?tag=display_picture_click_me_re&lang=7&version=6605302&setup_id=7000002&aff_id=1&addon=IncrediMail&upn=377E32EC-CAEF-418A-B3AB-478A3F020441&app_test_id=0

Hello Olliver,

I got the link from Walter Zengel, because I have used the app of him so far. Have now your current app on my Nexus 7 (2013) with Timurt's kernel installed. Works so far quite well. The tablet is installed in the Audi and connected with a Joycon.exc to the Can bus. So I can control the tablet via the steering wheel remote control. Your app also reacts very well to select the stations with the next track previus track. But when I press the back button closes the app, but the audio output continues unfortunately. Is it possible to use the exit button with a hardware key? And the app is blue as a background. How could I change the red (because in the Audi)

Greeting Silvio

-------Originalmeldung-------

Von: Oliver Bellmailto:notifications@github.com Datum: 02/24/17 10:50:16 An: freshollie/MonkeyboardAndroidRadioAppmailto:MonkeyboardAndroidRadioApp@noreply.github.com Cc: Jesey158mailto:silvio.hermann@live.de; Commentmailto:comment@noreply.github.com Betreff: Re: [freshollie/MonkeyboardAndroidRadioApp] Error running latest codebase on API below 23 (#2)

Hi Jesey,

I don't speak German so I could use google translate on your comment but it probably won't be very good.

If this is not an issue related to this topic, please create a new issue and write in English if you can.

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHubhttps://github.com/freshollie/MonkeyboardAndroidRadioApp/issues/2#issuecomment-282249892, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AYtPjCIenIAiJstdFQTn_RnDrlXYywOgks5rfqe-gaJpZM4MEwQ1.

[cid:9B318DB7-CDE3-4DF4-BD5E-57DA117479F7] http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226

Tierisch gut! KOSTENLOSE E-Mail-Animationenhttp://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 Hier Klicken! http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226 http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226

[cid:8249D388-BD91-47F8-94F2-E8A6A6DCB040] http://www.incredimail.com/?id=621160&did=10501&ppd=2838,201206281823,7,1,1953943818882383871&rui=160850310&app_test_id=0&sd=20170226