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 / Broadcast Problem

Author
Message
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 4th Feb 2013 19:50
I'm new to AppGameKit, but I just want to create simple apps that work. but I'm having a problem broadcasting to android devices. I've tried a Nexus 7 and a HTC Desire s, but both have the same problem.

The problem is, when i broadcast the app, the android device receives it, then it appears to crash, because then it just quits altogether. Does anyone know why? It works on my iPod, but that broadcasting works differently. The firewall is set correctly.

Thanks.
TrezSoft
AGK Tool Maker
12
Years of Service
User Offline
Joined: 8th Nov 2012
Location: UK
Posted: 4th Feb 2013 22:22
Which version of AppGameKit and which version of the Player are you using ?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 4th Feb 2013 22:30
Also, what are you trying to do in your app?

Working v1076 and v1088 Players are available on this page. I guarantee they are virus free (I made and use them myself).

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 5th Feb 2013 23:31
im using v1076

at the moment, i basically have nothing in the app. it just selects a date and a time. it has 11 buttons and 10 texts (created with createtext). it does nothing other then change numbers.
MikeMax
AGK Academic Backer
12
Years of Service
User Offline
Joined: 13th Dec 2011
Location: Paris
Posted: 6th Feb 2013 06:43
can you show your code ?
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Feb 2013 15:28
AGK, where did you get the Player you are using?

And, seeing your code will help us figure out if it is the Player or your code.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 6th Feb 2013 18:30
im using the AppGameKit player i got from the download page after a purchased it. here is the code:



I'm not brilliant, it works on the computer, but it wont broadcast to android devices properly. The wait function at the end needs touching up, but I'm on that.
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 6th Feb 2013 19:55 Edited at: 26th Feb 2013 19:18
Get the v1076 Player from http://www.triassicgames.com/tgc/public_download.html. (I AM Triassic Games, so I know it is a safe site and download).

For starters, you don't use DisplayAspect and VirtualResolution together. DisplayAspect is for when you use the percentage system. Based on the rest of your code, you are using the virtual resolution system, so drop the SetDisplayAspect call. It's not impossible that this is the source of your problem.

Instead of calling GetCurrentDate() three times, call it once and store it in variable.

And it wouldn't hurt to create a function that does your Text creation (pass in string, y position and initial x position, pass back the Text id).

Put parenthesis in the last big if statement to make sure that it is parsing the way you want (and to add to readability). Try this (I am also correcting the '=>' and '=<' to the '<=' and '>=', I am surprised the compiler accepted them):


I dropped the second sync call in the last if, because you will get the sync call just after the end of the if block.

You should add similar parentheses to your if statements in your functions. It is never safe to assume that the parsing priorities at execution is the same as at execution.

Your wait function won't wait very long. The Timer() function counts in milliseconds, not seconds. Also, it uses floating point values. You'd be much better off passing in a float value "function wait(time#)' and using all floats within the function (starttime# and timepassed#). If you want it to wait a second, call as 'wait(1000.0)'.

Between the odd '=>' and '=<', using setaspect with virtual and the integer and floats, the fixes mentioned above might clear up the problem.

Finally, are your sure that the file names are spelled the way you are using them in your code with respect to case? On Android devices, "this.txt" is not the same as "This.txt". On Windows it is.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 6th Feb 2013 21:15
When I can I will update the code. Thank you for helping. I'll add another update if the problem still exists.
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 6th Feb 2013 23:23
I've shortened the code but the problem is still there. here is the new code:

easter bunny
12
Years of Service
User Offline
Joined: 20th Nov 2012
Playing: Dota 2
Posted: 7th Feb 2013 05:05
Does it work with something extremely simple like this


There are 10 types of people, those who understand binary and those who don't
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 7th Feb 2013 15:36
Did you replace your Player with the one from this page I posted? If you haven't done that, than any fixes you make might not work anyway.

And, does MissJoJo's sample work on your Player?

And please verify that the names of the actual file in your media directory are 'background.png', 'AddToList.png' and 'AddToList2.png', with exactly the same upper and lower case.

(The comments below are as I go through your code from the top to bottom.)

Since you are explicitly setting the resolution to width 200 and height 320, set your width and height variables to those values. This is just in case the values aren't being collected properly from the getvirtualheight/width commands. And use the variables in the setspritesize command.

You should also make width and height float variables (width# and height#) since all the calls you use them with are expecting floating point. In theory, AppGameKit will automagically convert them. But one shouldn't assume that the values get converted where you expect them.

Move the function to the end of your code, don't put it in the middle and then jump around it.

And put the 'end' command after the 'loop' command. Or put all your functions in another file and include the file at the top of the main.agc file.

Your textset function is close to what I meant. But, as it is, you don't need to pass in the text. And the total width will change when you change the text size, so the position you pass isn't necessarily the one you want.

Try commenting out (with remstart and remend) everything you your main loop except the sync() command. Does all the text show up correctly?

Move the 'addlistpressed = true' command up before the 'endif' above it. I'm guessing you only want it true if the pointer actually hits that sprite.

Cheers,
Ancient Lady
AGK Community Tester and AppGameKit Master
Gorea235
11
Years of Service
User Offline
Joined: 4th Feb 2013
Location: England, T\' North
Posted: 19th Feb 2013 10:19
I've tried reming out bits, still didn't work. i tried doing everything Ancient Lady suggested, still din't work. But, the thing is, it works on the game i am creating. And the game has a lot more code in it. So, i've practicly given up on it.

here's the code anyway:


Thanks for all the support.

Login to post a reply

Server time is: 2024-11-24 07:27:01
Your offset time is: 2024-11-24 07:27:01