BASIC

Author Topic: Android - V10 release candidate  (Read 88491 times)

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1543
    • View Profile
Re: Android - Beta SDK
« Reply #120 on: 2011-May-04 »
Yes...compiled Android successfully compiled and was able to install the package. :)  :booze:

Offline Qube

  • Mr. Polyvector
  • ***
  • Posts: 157
    • View Profile
Re: Android - Beta SDK
« Reply #121 on: 2011-May-04 »
X_GETMATRIX command, woohoo, many thanks for adding that in, fantastic help  :nw:

Offline BigAnd

  • Mc. Print
  • *
  • Posts: 44
    • View Profile
Re: Android - Beta SDK
« Reply #122 on: 2011-May-05 »
I get a hang on exit with the new beta. Same code that worked with the previous beta.
This was on an HTC Desire 2.2.

Getting better FPS with this beta. It was about 40 FPS but now its about 50 :)

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10719
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #123 on: 2011-May-05 »
If it hangs on exit, can you post the logfiles? (android/bin/viewlog.bat)

Offline BigAnd

  • Mc. Print
  • *
  • Posts: 44
    • View Profile
Re: Android - Beta SDK
« Reply #124 on: 2011-May-05 »
I sure will when I get home from work Kitty.

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #125 on: 2011-May-05 »
The following doesn't appear to be working :

  • Viewports seem to be totally ignored
  • PLAYMUSIC
  • SPRCOLL possibly - as I'm using Moru's font system, there is a large gap between characters making me thing the collision part isn't working

ooh - almost forgot : CREATESCREEN seems to be not working too
« Last Edit: 2011-May-05 by MrTAToad »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10719
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #126 on: 2011-May-05 »
Oh my. That's such a huge list. I wonder what's wrong with my OpenGL setup.

Offline BigAnd

  • Mc. Print
  • *
  • Posts: 44
    • View Profile
Re: Android - Beta SDK
« Reply #127 on: 2011-May-05 »
CREATESCREEN must be working as my game uses it for the level background and final rendering. Maybe the size is too big?

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10719
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #128 on: 2011-May-05 »
If createscreen does not work, there's really a serious problem. This extension is really important.


MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #129 on: 2011-May-05 »
I wouldn't be surprised if my tablet doesn't support the extension for CREATESCREEN, which is going to make displaying results... fun... :)

Mind you, I've got an Android phone coming in a week or so, so hopefully it will all be okay on that...  However, the good news is my program didn't crash when exiting  =D

Could you add 480 x 800 (and 800 x 480) to the resolution list too, please (thats my tablet resolution size)
« Last Edit: 2011-May-05 by MrTAToad »

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10719
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #130 on: 2011-May-05 »
The current beta should have 480x800 as a resolution suggestion in the box. No?

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #131 on: 2011-May-05 »
Yes, it does - didn't look there  :whistle:

Offline Albert

  • Dr. Type
  • ****
  • Posts: 257
    • View Profile
    • Blog
Re: Android - Beta SDK
« Reply #132 on: 2011-May-06 »
I'm using CREATESCREEN, and it's working on Android.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10719
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #133 on: 2011-May-06 »
Awesome. Does GRABSPRITE work, too?

Offline Moru

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1781
    • View Profile
    • Homepage
Re: Android - Beta SDK
« Reply #134 on: 2011-May-07 »
GLBasic IDE, Version: 9.089

I'm running the following code to get a message over UDP network protocol.

Code: GLBasic [Select]
rv = SOCK_RECV(sock, msg$, 999)
src_ip = SOCK_GETREMOTEIP(sock)
src_port = SOCK_GETREMOTEPORT(sock)
IF rv>0 THEN log("message recieved: ["+src_ip+"]["+src_port+"]["+msg$+"]")
 

The src_ip and src_port both ends up as 0 instead of the integers I'm expecting.

Full source below, change IP in the source to your ip, or just type in "localhost" at the promt and press enter.

Code: GLBasic [Select]
// --------------------------------- //
// Project: NetUDPThruRouter
// Start: Tuesday, September 15, 2009
// IDE Version: 7.104

// Works if you send a message from inside the firewall to the outside IP of the other client
// And then send a message from that client on the outside of the firewall to the inside.
// Both clients can be behind a firewall.


GLOBAL sock%               // The socket connection
GLOBAL port% = 15000       // Port number to use

LOCAL ok%, ip%, rv%, msg$
LOCAL myip$
LOCAL destip$
LOCAL timeout
LOCAL src_ip%, src_port%                // The ip-address and port of the last packet

myip$ = NETGETIP$()        // Get our local IP just for the show
log("Our IP: "+ myip$)

STDOUT "\nDestination IP: "
destip$ = STDIN$()
// Just for less typing when testing
IF destip$ = "" THEN destip$ = "127.0.0.1"

ok = SOCK_INIT()    // Init network
IF ok
    sock = SOCK_UDPOPEN(port)           // Get the socket so we can send/recieve on the port
    IF sock <> -1
                SOCK_SETBLOCKING sock, FALSE    // Set socket to blocking(true), wait until message was sent or recieved

        ip = SOCK_GETIP(destip$)        // Convert the string to an integer IP
        // Send 32 packets, waiting one second for an answer between each send
        FOR n = 0 TO 31
            log("Sending message: "+"Hello from "+myip$+" To: "+destip$)
            ok = SOCK_UDPSEND(sock, "Hello from "+myip$, ip, port)
            IF ok <> -1
                log("message sent with "+ok+" bytes")
                timeout = GETTIMERALL() + 1000      // Start timer for one second
                WHILE rv <> -1 AND GETTIMERALL() < timeout
                    rv = SOCK_RECV(sock, msg$, 999)
                                        src_ip = SOCK_GETREMOTEIP(sock)
                                        src_port = SOCK_GETREMOTEPORT(sock)
                    IF rv>0 THEN log("message recieved: ["+src_ip+"]["+src_port+"]["+msg$+"]")
                    IF rv=-1
                        log(NETGETLASTERROR$())     // Didn't work, tell user why
                        SOCK_CLOSE(sock)
                    ENDIF
                WEND
            ELSE
                log(NETGETLASTERROR$())
            ENDIF
        NEXT
    ELSE
        log(NETGETLASTERROR$())
    ENDIF
ELSE
    log(NETGETLASTERROR$())
ENDIF
KEYWAIT



FUNCTION log: str$
    STDOUT "\n"+str$
ENDFUNCTION