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 Studio Chat / StartGPSTracking() causing app to freeze

Author
Message
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 13th Nov 2024 14:46 Edited at: 13th Nov 2024 18:50
I'm currently writing an app to get the users location. I have done this before and it worked great but something seems to have changed.

Calling StartGPSTracking() at the start of my Android app seems to cause it to stop responding to screen taps and other input in the main loop. It reaches a point where the OS asks to terminate the app due to it not responding. The odd thing is that the FPS counter in the loop continues to print to the screen so something is causing an issue in the background.

IMPORTANT: Everything works perfectly when broadcasting to the AppGameKit Player (version 2023.01.25 from Google Play). This problem only occurs when I build an APK and install it on a real device using AppGameKit Studio (v2024.08.15). I've tested this with an Android 14 phone and an old Android 7 phone with the same results.

Here is an example app to demonstrate the problem.



If you broadcast this to the AppGameKit Player app you can press the virtual button and see it instantly respond, printing to the screen and updating the coordinates.

If you build an APK file and install it to a device (ensuring you tick "Precise Location" and "Coarse Location" to be sure) you will find that it doesn't respond to pressing the virtual button and will eventually popup an "isn't responding" message.

Am I missing something or forgetting to tick something which is automatically turned on for the AppGameKit Player app?
Zaxxan
Developer
4
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 13th Nov 2024 23:11 Edited at: 13th Nov 2024 23:19
There is a API34 beta version on Steam that may be worth trying. The API 35 version has an issue with IAP's and it may also be causing the issue you are experiencing. Have you tried the player that is included with the 2024.08.15 build to see if that works when broadcasting?
Virtual Nomad
Moderator
18
Years of Service
User Offline
Joined: 14th Dec 2005
Location: SF Bay Area, USA
Posted: 14th Nov 2024 02:00 Edited at: 14th Nov 2024 02:32
i'm running studio 2024.07.07 2024.09.10 on WIN and exported APK (API 34 as minimum, Coarse and Precise + WriteExternal, Internet/Network & Wake Lock ticked (i think those last 3 are default?) ) is running fine. i keep my location off and it ran fine. turned location on, and still fine. swapped to other apps and back and continued to run fine. i dont use studio so i don't mind updating and reporting.

Samsung Galaxy S24.

will update to 2024.08.15 and test when i have time.

add: i'm only seeing a 2024.09.10 version to update to. and, i dont remember being able to click "selected version" to jump right to betas options (where we use to navigate to them via the gear icon on the right?) but that's handy:

apparently i was already running the 09.10 version while About depicts 07.07 (same in the Change log)... <shrug>

another add: i wonder if the app has lost focus some how? only a guess since, on WIN, when you're using another app you can hover over the AppGameKit app's icon on the task bar and see ScreenFPS() still ticking away?

otherwise, if you want to attach your export of the test code, i'll install.

Attachments

Login to view attachments
Zaxxan
Developer
4
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 14th Nov 2024 04:01 Edited at: 14th Nov 2024 04:23
The IDE in the Steam 2024.09.10 version is dated 2024.08.15 I think, the reason for this is that I built the Repo on the 2024.08.15 and did a pull request. Lee then merged my changes and released to Steam on the 2024.09.10.

The IDE dated 2024.08.15 is API35 and the IDE dated 2024.07.07 is API34 and the Classic version I released a few days ago is also API34. The API level also applies to the AGKPlayer2's that are included in each release. Some people have had issues with the API35 version with IAP's so for maximum stability I would recommend trying the API34 (2924.07.07) version until I can do some testing.

I'll also double check the dates and versions on Steam to confirm what I have just said is correct as I don't actually use the Steam releases myself. I've also gone back to using the Classic version as I prefer the Geany IDE.

I know the dates can be confusing but I'm only in control of the build date not the release date unfortunately.

I would go by the date on the IDE as I then know which version you are using.
Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 14th Nov 2024 13:06
Thank you Zaxxan - it does appear to be related to that bug (even though this app does not use IAP's).
And thank you Virtual Nomad for testing it out on your version - it is always very helpful to know if things work for other people and what their settings are.

I can confirm that switching to the Steam beta version "v2024.09.10" which the IDE identifies as "v2024.07.07" fixes the problem. I have created an APK and it is able to use the GPS details immediately without any pauses, freezes or problems.

I can continue with my project now
Zaxxan
Developer
4
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 14th Nov 2024 15:08 Edited at: 14th Nov 2024 16:52
I'm going to recommend to Lee that he removes the API35 version for now.

I need to check the version numbers on Steam as I've a feeling that the 2024.09.10 version is the API34 version that Lee uploaded with files missing. There is a later build called something like API34Build. I'll check when I get in, I'll confirm later.

Update:
I've just checked my emails and the latest API34 version is called API34BUILD and was uploaded to Steam on the 29th October. The IDE version is still dated the 2024.07.07 but the missing files are in this version.

This is the version that I am going to ask Lee to make as the main download.

@Zappo can you please download the API34BUILD version and check that it works for you.

Update: I can confirm that the best Steam version to use is API34BUILD, this has API34 and Google Billing 6.0.1 and all the files are present.

Zappo
Valued Member
20
Years of Service
User Offline
Joined: 27th Oct 2004
Location: In the post
Posted: 14th Nov 2024 17:10 Edited at: 14th Nov 2024 17:18
Zaxxan,
I've just tried the API34BUILD version from Steam and it generates a broken APK for me so won't work.

I'm not sure if Steam is smart enough to only download changed files but switching from v2024.09.10 to API34BUILD only download about 49MB of files. The APK it generates also went from 14,209 KB (working) to 13,649 KB (broken).

UPDATE: It seems Steam is smart enough to only download changes. Going from API34BUILD back to v2024.09.10 needed to only download about 21MB of files and everything works again now.
Zaxxan
Developer
4
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 14th Nov 2024 17:39 Edited at: 14th Nov 2024 17:44
This is confusing. The 2024.09.10 version was the version that broke IAP's, The API34BUILD fixed the issue because there were missing files from the 2024.09.10 version.

I'll PM you a link to the API 34 version on my Google Drive this is what the API34BUILD is based on. If you could test it for me I would be grateful.

Both the 2024.09.10 and API34BUILD are built from this source code.
Zaxxan
Developer
4
Years of Service
User Offline
Joined: 17th Nov 2020
Location: England
Posted: 15th Nov 2024 23:10 Edited at: 19th Nov 2024 03:42
The API34 version that I have has been tested by Zappo and it fixes this issue.

Update: Lee has made the API 34 branch the main branch as this has the best compatibility. Getting API35 working with the In App Purchases doesn't look straight forward.

For now that will be my final involvement with the Repo's as I want to get back to programming a game in AppGameKit

Login to post a reply

Server time is: 2024-11-21 06:36:26
Your offset time is: 2024-11-21 06:36:26