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

Offline Moebius

  • Dr. Type
  • ****
  • Posts: 315
    • View Profile
Re: Android - Beta SDK
« Reply #180 on: 2011-May-21 »
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

  • Guest
Re: Android - Beta SDK
« Reply #181 on: 2011-May-21 »
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 :

Quote
Value : -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]
« Last Edit: 2011-May-21 by MrTAToad »

Offline Millerszone

  • Dr. Type
  • ****
  • Posts: 307
  • www.smashedfly.com
    • View Profile
    • Smashed Fly
Re: Android - Beta SDK
« Reply #182 on: 2011-May-21 »
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

Offline quangdx

  • Mr. Polyvector
  • ***
  • Posts: 233
  • work hard / play hard
    • View Profile
    • Asobi tech
Re: Android - Beta SDK
« Reply #183 on: 2011-May-22 »
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.

Offline quangdx

  • Mr. Polyvector
  • ***
  • Posts: 233
  • work hard / play hard
    • View Profile
    • Asobi tech
Re: Android - Beta SDK
« Reply #184 on: 2011-May-23 »
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

  • Guest
Re: Android - Beta SDK
« Reply #185 on: 2011-May-23 »
Quote
Q:\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.

Offline quangdx

  • Mr. Polyvector
  • ***
  • Posts: 233
  • work hard / play hard
    • View Profile
    • Asobi tech
Re: Android - Beta SDK
« Reply #186 on: 2011-May-23 »
Quote
Q:\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

  • Guest
Re: Android - Beta SDK
« Reply #187 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?

Offline quangdx

  • Mr. Polyvector
  • ***
  • Posts: 233
  • work hard / play hard
    • View Profile
    • Asobi tech
Re: Android - Beta SDK
« Reply #188 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\androidI 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.

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10739
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - Beta SDK
« Reply #189 on: 2011-May-23 »
Quote
PRINT REPLACE$(SOCK_GETIP$(Pixels[Offset]),".",", "), 10, 10

 :-* WINS A PRICE!

Offline Moebius

  • Dr. Type
  • ****
  • Posts: 315
    • View Profile
Re: Android - Beta SDK
« Reply #190 on: 2011-May-23 »
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

  • Guest
Re: Android - Beta SDK
« Reply #191 on: 2011-May-23 »
Quote
so it looks like starting your project name with a number will cause a 384 error.
Bit limiting, what with not liking spaces and all :)

Quote
WINS A PRICE!
heh

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Android - Beta SDK
« Reply #192 on: 2011-May-24 »
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.

Offline Ian Price

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 4158
  • On the shoulders of giants.
    • View Profile
    • My Apps
Re: Android - Beta SDK
« Reply #193 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?
I came. I saw. I played.

Offline spicypixel

  • Prof. Inline
  • *****
  • Posts: 646
  • Pixel Artist
    • View Profile
    • SpicyPixel.net
Re: Android - Beta SDK
« Reply #194 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.