Sign In Register

How can we help you today?

Start a new topic

Android SDK consuming too much data

When I start my Android app and watch network usage, I see that my app communicates a lot of data over internet. It gets to 1 mb per few minutes, which is a lot, considering FUP limits in my country are around 1gb and even lower many times. I see on the screen that it communicates constantly and I am not even doing anything. I just turn the app on and do not send any requests. I used just standard code from tutorial. Is this expected behaviour? How can I prevent sending so much data? My game will be much slower, I don't need instant update, even five secods would be OK and low network usage is priority. Thanks.

Hi Matyas,


Where exactly are you seeing this ? Is this during gameplay in the app itself or does it happen as soon as you authenticate ? Can you let us know the name of the game please ? We'll take a closer look at it for you. it's possible that you are sending large amounts of data back in the responses of your events.


Regards,

Liam

Hi, thanks for reply.


It happens as soon as I authenticate. I see it in phone manager on Android (Huawei 550), you can see there how much apps use data. I noticed it just when I started development. I sent auth request and then left app running on phone. Then I looked at data usage and saw that when app is running, used data sum just keeps growing like 0,2 MB per minute so it went up to 200MB in first two days of development.


Name is of the game is A7B39PRO.  I have added some events since then so now I am actually sending too much data, but that wasn't there before, so don't get confused.


I have temporarily added a bit hack solution - I just call gs().start() and gs().stop() before and after every request, but that's not what I want. Considering GS is built on websockets, it just kill the whole point and practically makes the rest api out of it.


Thanks

M.R.

I tried it again now, just authentificated and let app run and do nothing. It made 3,5 MB in 10 minutes :/

Hi Matyas,


I've raised this with the SDK team. I'll be in touch when there is an update.


Regards,

Liam


1 person likes this

Hi, 


I was digging through SDK source on GS bitbucket and I found out that ping interval on WebSocket is set to 30 ms. That roughly corresponds to one ping with response having 10kb size. That is a lot. Is it possible that server or client sends some additional data with ping? Like PlayerData or something? I would check it by myself with some packet sniffer but my phne has older Android so it is not that easy to do.


I also tried to hook all message listeners and not one was called. Also no requests/responses are logged to terminal so I am afraid it is all just from keeping connection alive.


Anyway, I would be very grateful to have customizable ping interval. Like I said, I need refresh time in seconds for my game, 30 ms is overkill. I don't know how often is ping required to keep connection alive on server side though.


Thanks for support,

M.R.

Hi Matyas,


Yes we're seeing the same. We'll looking into this now. It will likely result in an SDK fix which will be used pushed out in due course. I'll let you know when I have more info. 


Regards,

Liam

Thanks a lot.

M.R.

Hi Matyas,


This has been addressed. Please update the SDK from here and let us know if you have any further questions.


Regards,

Liam


1 person likes this

Wow, You guys are fast! I didn't expect that. Thanks a lot, this is amazing support.


If I can point out one other little thing I noticed today, so I don't need to start new thread - ScriptMessage class is missing method getScriptData(). It is in the docs, so I suppose it should be here. Also there is a little typo in the docs for it here and here - method parameter is called 'event', but referenced as 'message' later.


Anyway, I feel bad for posting just criticism here because platform works very well otherwise. SDK is very easy to understand and use and I like that it is open source. Also Cloud functions works great and I appreciate test harness a lot.


Thanks a lot again and have a nice day,

M.R.

Login to post a comment