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 / Has the filtering resume bug been fixed?

Author
Message
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 11:32
I have searched the forum and the issues board but can't find an answer. In my game I have filtering turned off to get the blocky low resolution look. But when I exit and resume the game on Android the filtering is on and everything is blurry. I am using 1076 and was wondering if this has been fixed in 108.


Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 16:09
At the top of your main loop, check GetResumed() for returning 1.

If it is one, than you have just resumed. That is where you reset things to the state you want your app to be. For many apps, it is a good idea to put it in the paused state, if you have one, unless it is on a menu or something that isn't actively doing things.

Some information (like filtering, apparently) is not held in memory (or wherever the backgrounded app goes) and needs to be restored.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 20:10
Thanks for the tip, I'll give that a try

I remember something about GetResumed only works on Android. Am I wrong? Does it also work on iOS? What about other platforms like PC?

Does this affect CPU usage?


Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 20:36
GetResumed works in v1088 for iOS and Android.

If you are doing Tier 2 in v1076, I have a tweak that works about the same for iOS.

On the PC, when an app gets minimized, it keeps running and you cannot tell that it is minimized with any of the AppGameKit commands.

It has no affect on CPU, it is a very simple function call.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 20:53
I don't care about iOS in 1076 (using T1 BTW). I don't own a Mac and I won't get one until it's closer to release. But I will switch to 108 sooner or later. 1076 works great for me until I need features from 108. I do not have time and energy over for betatesting.

Does GetResumed affect CPU usage when the app is "minimized"?

BTW, Android apps made with 108 doesn't use extreme amounts of CPU power when minimized right? 1076 apps draws 45-50% when minimized on my S2.

Thanks again for your help


Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 21:23
GetResumed() is an extremely simple function that checks for some flag set in the AppGameKit core. It has no affect on CPU usage that would ever be noticed.

Certainly there is no difference when the app is minimized versus not minimized. Since the same loop is running in both cases.

Android apps, when sent to the background, should't use any CPU (or no more than any other) as they are not running (unless you are using features that stay active while in the background, and AppGameKit doesn't have anything natively that does that).

I believe the CPU usage you are reporting in v1076 is a known bug and reported as fixed for v1088.

How are you checking CPU usage on your Android devices?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Mar 2013 21:37
Last time I cheked, my task manager also said that the CPU usage was around 50%, but I think all of them where made using 107. This was acording to samsungs preinstalled taskmanager on my galaxy note.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 21:41
You have a task manager on your Android devices?

Or are you talking about programs running on your PC?

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 22:03
There is a task manager on my Galaxy S2. Isn't it standard in Android?

Thanks for answering all my questions


Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Mar 2013 22:13
I can't find anything resembling a task manager on any of my Android devices (Toshiba 7" Thrive, Nexus 7 and Samsung Galaxy S III).

I can find several apps in the store, but none seem to really show CPU usage on a per app basis (except OS Monitor and I'm not sure if it really is doing what I think it is).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
The Zoq2
14
Years of Service
User Offline
Joined: 4th Nov 2009
Location: Linköping, Sweden
Posted: 4th Mar 2013 22:13
I believe the taskmanagers on our phones are installed by samsung.

There is an app in the play store called watchdog that can see the CPU usage of apps though I think.
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 4th Mar 2013 22:27
DA, I can confirm the CPU Usage issue has been fixed for v1088. I have built several apk's with the most recent version and the CPU is minimal, even when minimized.

AL, if you hold down the home key on you S3 you should see a pie chart type icon on the bottom left panel. Click that and it will list all the apps currently running along with the CPU usage (just make sure you are on the 'Active Applications' tab). Not sure about you other devices but I suspect they are all similar...
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 22:40
On my S2 I can access it either through longpressing the home button or run the app. I thought it was standard from like 2.3 or something. I find it very handy as it allows me to see CPU usage and close running apps. Not tried on my Note 10.1.

Quote: "DA, I can confirm the CPU Usage issue has been fixed for v1088. I have built several apk's with the most recent version and the CPU is minimal, even when minimized."


Sweet, thanks


Demo 3 is out now!
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 4th Mar 2013 23:25
I tried to use GetResumed in the player (compiled it myself in Eclipse). It worked except that SetDefaultMagfilter didn't do anything. SetTextDefaultMagFilter did work however. Anybody knows if this is fixed in 1088? To test this one would need to scale up a sprite. If it stays hard pixelated and not smooth, the filtering is off. Which of course is what I use for RTA's retro look.




Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Mar 2013 04:40
Funnel7, thank you. I found the task manager. Cool!

Digital Awakening, can you show a more complete example of where the MagFilter is even used? I'm assuming that somewhere in the code you expand the display or something. If you can show enough of a sample, I can test it in v1076 and v1088 and either tell you it is fixed, or we can post it as an official bug in the google list.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 5th Mar 2013 09:02
AL:
Here's a fully working test app. When you run it you will see the image and the text perfectly sharp. After a resume only the text is sharp for me, the image is blurred.


Demo 3 is out now!

Attachments

Login to view attachments
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Mar 2013 16:48 Edited at: 5th Mar 2013 16:55
Yup, that example works and shows the problem in v1076.

Now, let's see if I can get a v1088 test running.

EDIT: Yup, it is a bug in v1088 as well. Go ahead and post it in the google list (attach your project). I will officially confirm it there.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Digital Awakening
AGK Developer
21
Years of Service
User Offline
Joined: 27th Aug 2002
Location: Sweden
Posted: 5th Mar 2013 20:50
Here it is: http://code.google.com/p/agk/issues/detail?id=504

Thanks for all your help


Demo 3 is out now!
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 5th Mar 2013 21:20
And I have officially confirmed it both in the google list and in the TGC AppGameKit CT site.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master

Login to post a reply

Server time is: 2024-05-06 19:47:05
Your offset time is: 2024-05-06 19:47:05