Android - V10 release candidate

Previous topic - Next topic

Moebius

Something like this:
Code (glbasic) Select
LOADSPRITE "4by4.png", 0
LOCAL Pixels%[]
SPRITE2MEM(Pixels[],0)
FOR Offset = 0 TO 15
PRINT REPLACE$(SOCK_GETIP$(Pixels[Offset]),".",", "), 10, 10
SHOWSCREEN
KEYWAIT
NEXT
END


[attachment deleted by admin]
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

#181
I am using this code and image.

Code (glbasic) Select
LOCAL data%[]
LOCAL loop%

LOADSPRITE "Media/4x4.png",0
IF SPRITE2MEM(data%[],0)
FOREACH loop% IN data%[]
DEBUG "Value : "+loop%+"\n"
NEXT
ELSE
DEBUG "Error\n"
ENDIF


On Windows, I get :

QuoteValue : -1531392
Value : -1
Value : -1531392
Value : -1
Value : -1
Value : -1531392
Value : -1
Value : -1531392
Value : -1531392
Value : -1
Value : -1531392
Value : -1
Value : -1
Value : -1531392
Value : -1
Value : -1531392

Now to modify it slight for Palm - the results are in the other picture


[attachment deleted by admin]

Millerszone

Using MrTAToad code, I get the same values as you do in Windows,
but on my Palm Pre with 1.4.5 I get:

Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Value : 0
Hardware: iMac 27", MacBook Air, PC 3.5Ghz Quad
Developing Tools: GLBasic SDK, Gideros Studio, PureBasic
Developing for: iOS, Android, Windows, OS X, webOS, HTML5

quangdx

I managed to get an older project to compile and create an APK file for me to run on an android device.
But when I try to compile 8BitB.Ob it comes up with the following error.
Code (glbasic) Select
_______________________________________
*** Configuration: ANDROID ***
precompiling:
GPC - GLBasic Precompiler V.7.917 SN:6525c6b7 - 3D, NET
Wordcount:1349 commands
compile+link:
BUILDSRIPT

BUILD FAILED
Q:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.

Total time: 2 seconds
Android=C:\Dropbox\GLBasic\8BitBob\android
success
_______________________________________
*** Finished ***
Elapsed: 12.8 sec. Time: 22:25
Build: 1 succeeded.


Also I found the program that did compile to be running very sluggishly,
even though it's only setup to run at 30fps using a few sprites.
This was tested on a new Samsung Galaxy S II.

Asobi tech - the science of play.
Spare time indiegame developer.

quangdx

Quote from: quangdx on 2011-May-22
Also I found the program that did compile to be running very sluggishly,
even though it's only setup to run at 30fps using a few sprites.
This was tested on a new Samsung Galaxy S II.

Also tested on a HTC wildfire,
found that the it ran incredibly slowly on that.
Wonder if it's anything to do with it being in debug mode?
An interested  thing, it scaled on both devices, 480x800 and 320x240 automatically.
Asobi tech - the science of play.
Spare time indiegame developer.

MrTAToad

QuoteQ:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.
Sounds like the android icon isn't present.

quangdx

Quote from: MrTAToad on 2011-May-23
QuoteQ:\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:384: Compile failed; see the compiler error output for details.
Sounds like the android icon isn't present.

I'm not sure how that would be the case,
as my older program compiled fine, and in both instances I've not created an icon yet,
they both use the standard GLBasic icon.
I even created a new project and copy pasted the source code over and got the same error.
I wonder if it's a command or something, but unfortunately I have no idea what error 384 refers to,
and no idea how to "see the compiler error output for details"
Asobi tech - the science of play.
Spare time indiegame developer.

MrTAToad

384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?

quangdx

Quote from: MrTAToad on 2011-May-23
384 is to do with spaces - do you have any in the project name or path?  Are you using the latest hotfix?

I downloaded and installed the latest fix,
and as you can see by the output text, there are no spaces in the project name
Code (glbasic) Select
Android=C:\Dropbox\GLBasic\8BitBob\android
I wonder if it's because it starts with a number?

Just copied the code into a new project
EightBitBob and it works fine, so it looks like starting your project name with a number will cause a 384 error.
Asobi tech - the science of play.
Spare time indiegame developer.

Kitty Hello

Quote
PRINT REPLACE$(SOCK_GETIP$(Pixels[Offset]),".",", "), 10, 10

:-* WINS A PRICE!

Moebius

I'll take that as a complement  :enc:

Just got to trying the new hotfix, and pausing almost works.  There seems to be a some sort of problem with input.  I'm testing on a Samsung Galaxy S (running an unofficial Android version - 2.3.2).

When I 'pause' the app, by standby-ing the phone switching apps or pressing the 'home' button, the app stays open.  Looking at the debug log using adb, it appears that GLB_ON_PAUSE is called, but GLB_ON_RESUME isnt called.  The same is true using the emulator.

After returning to it, no input is recognised by the GLB app, although it continues to execute just fine.  This also stops my phone from giving vibration feedback when the back and menu buttons are pressed (if that helps somehow), delaying the feedback until I leave the app.
Endless Loop: n., see Loop, Endless.
Loop, Endless: n., see Endless Loop.
- Random Shack Data Processing Dictionary

MrTAToad

Quoteso it looks like starting your project name with a number will cause a 384 error.
Bit limiting, what with not liking spaces and all :)

QuoteWINS A PRICE!
heh

spicypixel

I've just compiled my project successfully and have the apk file(s) however I have the command line instructions to install the apk to the emulator

Code (glbasic) Select

Add SDK_ROOT to your system variables pointing to /tools folder under the sdk
Run the emulator
Copy the apk file to /tools folder
Change directory to /tools and run from commandline adb install application_name.apk


But I wondered how I do this in Eclipse (1) because it'd be nice to know and (2) because in GLB10 the androidicon is created outside the android folder and as an apk file is already packaged I presumed it needs to be recompiled to include the icon and I'm guessing Eclipse is easier than command line.

Or am I off the mark?
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.

Ian Price

I don't know about Android, but for WebOS (Palm Pre) the icon is actually included in the packaged file (GLB also  creates a WebOS icon externally) - perhaps Android is the same and doesn't actually use the external icon?
I came. I saw. I played.

spicypixel

Quote from: Ian Price on 2011-May-24
I don't know about Android, but for WebOS (Palm Pre) the icon is actually included in the packaged file (GLB also  creates a WebOS icon externally) - perhaps Android is the same and doesn't actually use the external icon?

You are indeed right Ian and I now have the apk running on the emulator with the intended icon, which as you say is prebuilt into the package. Just trying to work out now how to import the project into Eclipse so I can export an unsigned apk file and then sign it with my own key. I'd unsign it manually and resign it with my own key in DOS if I knew the commands to unsign =)

It's all good stuff tho, uber pleased.
http://www.spicypixel.net | http://www.facebook.com/SpicyPixel.NET

Comps Owned - ZX.81, ZX.48K, ZX.128K+2, Vic20, C64, Atari-ST, A500.600.1200, PC, Apple Mini-Mac.