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

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #15 on: 2011-Apr-23 »
Ah, I've just tried to build an app without the USB cable plugged in to my phone and received this error:-

BUILD FAILED
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:639: The following error occurred while executing this line:
C:\Program Files\GLBasic_beta\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:271: exec returned: 1

Dabz


Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #16 on: 2011-Apr-23 »
Right, with the USB plugged in, can you go to Apps->Settings->Applications

Then check if the these are ticked:-

- Unknown Sources                                       <---- Probably doesnt matter as the app gets signed as a debug app, but switch it on regardless
- Development->USB debugging                   <---- Important

Dabz
« Last Edit: 2011-Apr-23 by Dabz »

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #17 on: 2011-Apr-23 »
Ah, I can't connect my tablet as there is no port for it to do so - in which case it does look as though the device must be connected...

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #18 on: 2011-Apr-23 »
Well, at least we know whats wrong... I had a feeling it had something do to with the USB cable, but I never realized you couldnt plug one in! :D

Anyway, what you've done isnt wasted, you can still build them...

Create a AVD (Android emulator) and get it running, then, try and build the project again... On my machine, when the phone is disconnected but the emulator is running, the application gets shunted onto the AVD (Note: Some stuff may not work as expected on an AVD as it does on hardware, this doesnt just apply to GLBasic apps, it happens even with native stuff)

Then, if its possible, you can just manually move the APK package that's  built onto your device and install it from there for actual testing on hardware (You may need to manually sign the app with keytool/jarsigner first)... That is, if its possible for you to do this.

Thing is though while testing, on the AVD, the application runs perfectly in a sense that my app is stretched to fit the screen, whereas on my actual device, its not, also, the colour parameter for DrawRect looks like its ignored on the AVD (Stays white) but works as expected on the device.

Dabz
« Last Edit: 2011-Apr-23 by Dabz »

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #19 on: 2011-Apr-23 »
Right, managed to get the resolution to shift up a bit by editing t the AndroidManifest.xml file:-

Code: GLBasic [Select]
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.denathorngames.nagsheeddarts"
      android:versionCode="1"
      android:versionName="1.0">
          <supports-screens android:resizeable="false"
                  android:smallScreens="true"
                  android:normalScreens="true"
                  android:largeScreens="true"
                  android:anyDensity="false" />
    <uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
        <uses-permission android:name="android.permission.INTERNET" />
    <application android:label="@string/app_name" android:icon="@drawable/icon" android:debuggable="true">
        <activity android:name="org.libsdl.app.SDLActivity" android:label="@string/app_name" android:screenOrientation="portrait">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>
 

Note this line:-

Code: GLBasic [Select]
android:anyDensity="false"
 

This makes Android scale the application, though, its not the general 'done thing', but works on my HTC Desire... The proper way is to scale everything up, but, that would mean changing loads of code, redoing my LoadBMP images etc etc

I'll get something up, push it about on a few devices and see whats what! :)

But, overall, it works well for me (apart from mp3's not playing, though, I will try OGG), and I must say, brilliant job!  :good:

Dabz

EDIT: Tried .ogg, it plays the file, sorta, I say sorta because you can hear the music, but its barely audible behind what I can only describe as machine gun fire! :)

« Last Edit: 2011-Apr-24 by Dabz »

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #20 on: 2011-Apr-23 »
Unfortunately, even with an AVD running, the build failed.  It does look like a Windows 7 x64 problem or something is missing...

Do you have the NDK installed ?  I have the  Android 2.2 SDK installed - is that the right version ?
« Last Edit: 2011-Apr-23 by MrTAToad »

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #21 on: 2011-Apr-23 »
Nope, I havent installed the NDK... And yep, 2.2 is the one!

Dabz

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #22 on: 2011-Apr-24 »
Time to see if its a x64 problem :)

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #23 on: 2011-Apr-24 »
I am using the x64 version of the JDK too - I wonder if only the 32-bit version works ?

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #24 on: 2011-Apr-24 »
No luck with Windows XP in a Virtual Machine either :

BUILD FAILED
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:472: The following error occurred while executing this line:
C:\Program Files\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:203: apply returned: 255

Next need to try a proper XP machine
« Last Edit: 2011-Apr-24 by MrTAToad »

Offline matchy

  • Prof. Inline
  • *****
  • Posts: 1542
    • View Profile
Re: Android - Beta SDK
« Reply #25 on: 2011-Apr-24 »
 :coke:

A simple print fps and coloured drawrect test which runs on my device (30fps) and on the emulator but there's no color...just white.

Offline Dabz

  • Mr. Polyvector
  • ***
  • Posts: 104
    • View Profile
    • BambooCoder
Re: Android - Beta SDK
« Reply #26 on: 2011-Apr-24 »
Quote
o luck with Windows XP in a Virtual Machine either :

Oh, your running on a VM, mines in Bootcamp so is a proper installation.

Dabz

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #27 on: 2011-Apr-24 »
Yes, I'll be trying a proper XP machine later on...

Offline trucidare

  • Administrator
  • Prof. Inline
  • *******
  • Posts: 1377
  • Bachelor of Fail
    • View Profile
Re: Android - Beta SDK
« Reply #28 on: 2011-Apr-24 »
First of all - its a very very beta. only 32bit jdk works - but this isnt limited through glbasic, its from android sdk.

try to avoid spaces and brackets in you path - line 472 call the dex executable - works for me on windows 7 64 bit with jdk32 bit installed in c:\Programme
MacBook Pro 2,2 GHz Core 2 Duo, 4 GB RAM, 160 GB HDD, 8600M GT
Core i3 - 3,07 GHz, 8 GB Ram, 2.5 TB HDD, Geforce GTX 260+ OC

MrTAToad

  • Guest
Re: Android - Beta SDK
« Reply #29 on: 2011-Apr-24 »
Tried with the 32-bit JDK too - but with no luck...

Quote
BUILDSRIPT
     [echo] Creating output directories if needed...
     [echo] Compiling aidl files into Java classes...
     [echo] Compiling RenderScript files into Java classes and RenderScript bytecode...
     [echo] Generating R.java / Manifest.java from the resources...

BUILD FAILED
C:\Program Files (x86)\GLBasic\Compiler\platform\android\android-sdk-windows\tools\ant\main_rules.xml:310: null returned: 1

Shame more information cant be given about why its failing...
« Last Edit: 2011-Apr-24 by MrTAToad »