Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / I have recently published my first App on the play store but Android vitals considers ANRs excessive 2.53% can anybody help me figure out why please?

Author
Message
mattyjy2k
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 24th Oct 2019 23:00
Hi Everybody
A couple of months ago I published my first App on the play store and everything was going quite well at first with downloads of about 200 per day and after some ASO work my main keywords were doing well in the top 10's
However in Android vitals my ( ANRs) application not responding is considered excessive 2.53% the Bad Behaviour threshold is just 0.47%
It seems because of this my rankings have been smashed and the downloads dropped to as low as 20 a day. I can't understand the android the Android crash reports I tried goggling to try to make some sense of what might be causing the high rate of ANR's and to try and work out how the crash report might help me find the problem in my AppGameKit tier 1 code but I have not been able to work it out or get to the bottom of it.
I wondering if anybody could possibly help or try to point me in the right direction to help solve this problem.
Most of the ANR's are: Input dispatching timed out (Waiting to send non-key event because the touched window has not finished processing certain input events that were delivered to it over 500.0ms ago. Wait queue length: 9. Wait queue head age: 6538.8ms.)
Here is information from one of the ANR reports just let me know if you need any more information.



Thanks Matt
Dybing
13
Years of Service
User Offline
Joined: 12th Sep 2011
Location: Bergen, Norway
Posted: 31st Oct 2019 00:10
I've had a few AppGameKit Apps released on Google Play by now - two of them I do not any longer have access to the Google Play Console for as it was for my former job - but the only times those crashed was when due to crappy or no internet they could not pull down media from the server.

As for my one current personal project on Google Play, it have crashed according to Google Play Console a total of zero times. And that over 5000 installs and about 1600 current users (and a 4.74 rating). Of course, this app have no external dependencies - no server to call. Just one self contained little utility. Oh and also I rolled out a new version just two days ago, so it is quite current as far as AppGameKit versions go.

So AppGameKit being essentially a little programming language and framework rolled into one - it make it easy to do the right thing, but of-course, it will give more than enough rope to hang oneself. It is not spoken too much about in the documentation, if at all - as it is more into implementation details - but there are certain models and design patterns that serve as a guide to do the right thing easier. With regards to AppGameKit, perhaps peek a bit at the game-examples to get an impression of how to organize the code.

But for the outer game-loop as it were, it should go more or less like this:

1: User Input Event
2: Other events
3: Manipulate model based on events
4: Translate model to output data
5: Output

One do not go from one step to another without it being wrapped up and done for that iteration of the loop. This is the MVC pattern on a timeline as it were - one would usually also ensure it is represented in code and file structure. In AppGameKit one can not control the access from one step to another so as to isolate the internal structures in each as there is no proper namespace/module/package/class support. But, keeping ones tongue at the correct angle and being creative with structs, one can fake it to a high degree.

Without having your source code available - I can't really say what go wrong in your project - but given the report from Google Play, it would seem you are constantly listening for input events rather than doing that in a little chunk and then moving on and in the process emptying the input buffer. Or it could be some other part of the code taking so long, it backs up the input-buffer that expect to be emptied quite often. Certainly more often than twice a second.

Again - without source code, hard to say.

It could be as simple as a sync() missing at a crucial place - but it could be quite a bit more involved than that. As in restructure the entire thing.
SFSW
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 31st Oct 2019 02:40 Edited at: 31st Oct 2019 02:45
Is there a more common device and/or Android version(s) this is occurring on? I've encountered a few instances where (as Dybing points out) there seemed to be significant delays during startup and loading media for the first time. And it seemed to primarily occur after activating the advertising mechanism. When ads were enabled, it seemed to cause potential delays, sometimes severe enough to ANR. Even though 'Sync()' was called and careful attention paid to runtime operation, the activity of the advertising system(s) running in the background seemed to risk halting the game entirely. Sometimes right when attempting to initialize ads, sometimes later on after a few menu stages/selections or even during the game. It seemed to be somewhat random, possibly more likely on older devices with weaker performance (but that was difficult to determine). If it is/was the problem, it could be due to connection problems, issues with the ad network service/server, or something internal to AGKV2/S.

So that might be another step you could try while investigating the issue. See if not even calling the advertising functions changes the behavior on some test devices. If you do determine that there may be a potential issue with that or some other internal AGKV2/S operation causing such delays, then it may need looking into further by other users and TGC.
mattyjy2k
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 31st Oct 2019 14:42 Edited at: 31st Oct 2019 14:59
Thanks so much for your input Dybing and SFSW you have both brought up some interesting points that could really help with trying to narrow down what is causing the ANR's
initially I was thinking that it might be possible that they were caused by me using the using the END command to close the APP if the back button was pressed twice and I have changed this to MinimizeApp()
But I'm starting to wonder if it is down to HTTP request timeouts to my web server for users with a slow internet connection.
For some reason the majority of my users are from Nigeria and the ANR's seem to be on very low end devices but I do realize it is my reasonability to handle the HTTP request correctly to allow for users with slow connections
I'm going to try some bug testing on my code in this area. (it's just hard to find when you cant replicate the problems on your own devices or internet connection
I have set a connection_timedout of 6000ms for the HTTP Get request and after this I inform the user that receiving the data has failed and ask them to retry. Do you think that a 6000ms timeout might be too high?
I think like SFSW says, looking in to the way I have implemented my adverts may also be a possible cause, on earlier versions of my App when I didn't want adverts to show I was using SetAdvertVisible ( 0 )
however I was worried that might cause users to click on an advert that was not visible so I changed this to DeleteAdvert() and i'm wondering if I might be be calling this to often and causing the application to stop resonding for users with low end devices and a slow connection.
Just in case your intersted in having a look the app and seeing if it runs fine for you the Andriod APP is called Half Time Football Betting Tips on the play store and my developer name is Goldfish Apps any constructive criticism would be humbly and gratefully accepted.
If you're not in to football it might not float your boat. (I'm not but I built the app for a friend that is.)
Thanks so much for your input guys and if you have any other thoughts on this just let me know I would be really grateful. I will make some changes and get a new update realised and hope my ANR rate drops to an acceptable level.
Thanks Matt
SFSW
22
Years of Service
User Offline
Joined: 9th Oct 2002
Location:
Posted: 31st Oct 2019 16:48 Edited at: 31st Oct 2019 16:49
6000 does seem a little high to me, considering the ANR error report about values over 5000, so maybe 4000 might be a good cap? Just a guess though, I'm not too familiar with how they gauge an ANR and what limits there may be.

I did try your app. Not sure what I'm doing, but the UI looks nice (sharp glassy look with bright graphics) and navigating was straightforward. I'd say your positive review score is a good indicator that it's doing well for what you set out to achieve with it. I didn't run into any noticeable delays on my rather old phone, so perhaps it may be related to http requests and/or slow ad system behavior. Please do keep us posted on your analysis and results.
mattyjy2k
21
Years of Service
User Offline
Joined: 26th Jan 2003
Location:
Posted: 31st Oct 2019 20:44
Hi SFSW Thanks for much for your input and thanks so much for taking the time to get it and take a look I really appreciate it. I'm going to drop the timeout on the get request to 4000ms I'm also hoping that using MinimizeApp() instead of using END when a user comes out of the App using the back button might help as I read somewhere on here that Android likes to handle terminating apps itself and so can see this as an unexpected termination. I would think though that this would be counted as a crash and not as an ANR but will change it and see if there is an improvement.
I really should get myself a copy of AppGameKit Studio too as I'm still on classic AppGameKit and I might find some improvements.

Login to post a reply

Server time is: 2024-11-22 10:20:04
Your offset time is: 2024-11-22 10:20:04