BASIC

Author Topic: Android - has anyone tried yet?  (Read 2027 times)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Android - has anyone tried yet?
« on: 2019-Aug-03 »
Hi

Just wondering if anyone has tried the android studio update to build 32/64 versions of GLB apps for mobile?

Can't seem to find any docs on it - how to start / steps involved / etc.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #1 on: 2019-Aug-09 »
Gernot or Spacefractal - just wondering if any steps or general advise on using v16 for Android?
Is it working for 64bit apk building?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline Kitty Hello

  • code monkey
  • Administrator
  • Prof. Inline
  • *******
  • Posts: 10709
  • here on my island the sea says 'hello'
    • View Profile
    • http://www.glbasic.com
Re: Android - has anyone tried yet?
« Reply #2 on: 2019-Aug-10 »
Yes. The V16 from STEAM creates a fully featured Android project for you and opens Android Studio. You have every single piece of code as C++ in this project (a bit scrambled, but it compiles!).
So, you even could build for MIPS or whatnot exotic platform.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3669
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #3 on: 2019-Aug-10 »
im have been quite away and havent even checked this that much. but yes, the Android Studio compile with full source code and does not use any precompiled so files. So its can compile to any platform its support. But im could not get watches to work as they quite different effort.

But Android TV, 32/64 bit is supported and with Intel/ARM cpus binaries.

Android Studio do should download all eventuelly misses components if required before you can compile it to a emulator for testing.
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #4 on: 2019-Aug-11 »
 :enc:
Excited to try it!!
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #5 on: 2019-Aug-11 »
Okay - got my debug apk built after a few GB of downloads and installs...

Apk for Simple Turtle did not open.

Could be my AE stuff is breaking it...
do I need to remove AExtras specific code or does that matter?

Is there anything I should look out for - no ads or what not in this app...also Androidmanifest I just added the package details etc.

https://www.dropbox.com/s/hkdw7okwppnofj3/app-debug.apk?dl=0
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #6 on: 2019-Aug-12 »
Also, where is the c++ code placed in the Android Studio project?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #7 on: 2019-Aug-12 »
Okay got my AStudio setup running and building...now signing too...
I tried to Run App on Device and in Android Studio - failed.

Unexpected error while executing: am start -n "com.Gazzapper_Games.SimpleTurtle/com.gazzappergames.simpleturtle.logo.educational.SDLGlbasic" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER

Any ideas?? Manifest issue?
Here is my manifest

Code: GLBasic [Select]
<?xml version="1.0" encoding="utf-8"?>

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.gazzappergames.simpleturtle.logo.educational"

    android:installLocation="auto" >

    <!-- OpenGL ES 2.0 -->
    <uses-feature android:glEsVersion="0x00020000" />

    <!-- GLBASIC_USER_NOTE app permissions and features -->

    <!-- Touchscreen support -->
    <uses-feature android:name="android.hardware.touchscreen" android:required="true" />

    <!-- Game controller support -->
    <uses-feature android:name="android.hardware.gamepad" android:required="false" />

    <!-- External mouse input events -->
    <uses-feature android:name="android.hardware.type.pc" android:required="false" />

    <!-- Has Android TV support (here you need to support a least the tv removte and has landscape mode -->
    <!-- <uses-feature android:name="android.software.leanback" android:required="false" /> -->

    <!-- If your app support Android Go? -->
    <uses-feature android:name="android.hardware.ram.low" android:required="false" />

    <!-- Allow access to the vibrator, permission is not required -->
    <!-- <uses-permission android:name="android.permission.VIBRATE" /> -->

    <!-- Checkout the battery status (etc you could lower the framerate in low battery or like that, permission is not required -->
    <!-- <uses-permission android:name="android.permission.BATTERY_STATS" />  -->

    <!-- Allow writing to external storage -->
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />

    <!-- Allow access to the internet -->
    <uses-permission android:name="android.permission.INTERNET" />

    <supports-screens
        android:smallScreens="true"
        android:normalScreens="true"
        android:largeScreens="true"
        android:xlargeScreens="true"
        android:anyDensity="true" />

    <application
        android:isGame="true"
        android:label="@string/app_name"
        android:icon="@mipmap/ic_launcher"
        android:allowBackup="true"
        android:banner="@mipmap/banner"
        android:hardwareAccelerated="true">

        <activity android:name="SDLGlbasic"
            android:theme="@android:style/Theme.DeviceDefault.NoActionBar"
            android:label="@string/app_name"
            android:screenOrientation="sensorLandscape"
            android:configChanges="keyboard|keyboardHidden|orientation|screenSize">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
                <!-- <category android:name="android.intent.category.LEANBACK_LAUNCHER" /> -->
            </intent-filter>
        </activity>
    </application>

</manifest>
« Last Edit: 2019-Aug-12 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3669
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #8 on: 2019-Aug-13 »
Did you checked readme.glbasic.txt? Please checkit out.

do not change the package name at all! leave it to package="org.libsdl.app" <- this is for the executable file, not the app name package! Android Studio cant simply find the exe at all and then fails.
« Last Edit: 2019-Aug-13 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #9 on: 2019-Aug-13 »
Excellent! Thanks SF!

Sorry what does the package name apply to?
This is usually the package of the playstore unique app name in the manifest. no?
Okay - I will try this then - where does the unique app package name go now so?

« Last Edit: 2019-Aug-13 by MrPlow »
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #10 on: 2019-Aug-13 »
Another small issue - the build that AStudio creates is 500MB! Quite a size for small apk - is there a way to avoid this?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Online erico

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 4212
    • View Profile
    • Portfolio
Re: Android - has anyone tried yet?
« Reply #11 on: 2019-Aug-13 »
An apk at that size? There must be something going into it that is not necessary.
I will be trying android out again very soon and let you know.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #12 on: 2019-Aug-13 »
An apk at that size? There must be something going into it that is not necessary.
I will be trying android out again very soon and let you know.

Not the apk itself (about 6mb) - but all the supporting project folder src and libs files - not sure if that's normal or just down to how I installed my Android Studio.

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1519
    • View Profile
Re: Android - has anyone tried yet?
« Reply #13 on: 2019-Aug-13 »
My logcat from trying to run the built & signed apk

Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3669
    • View Profile
    • Space Fractal
Re: Android - has anyone tried yet?
« Reply #14 on: 2019-Aug-14 »
The Package in manifest goes for the package name java and C++ using and when the code communicate between C++ and Java (org.libsdl.app). So if you changes it, Android Studio and Android simply just wont launch it at all!

Also again, checkout the readme file where to find unique id and more. The unique app id is in a grandle file, where you also set the sdk as well.

Android Studio emulators is also supported, but crash when running in Android 4.2 and below. here im wont fix it, they are too old anyway and is now unsupported.

Also this version compiles to 4 binaries (amd 32/64bit and intel 32/64bit).

Im can do nothing about the project size, this is just how Android Studio works and the NDK can been very insane biggie. But as long the apk is its self is small im would not mind. You can also clean up that build again when you are finished using it. This is no wonder throguht its can take some minuttes to build (can take 3-4 minuttes here first time).

Also do not ask me about ads in this version as its has not been implemented yet as im have not looked into that. Howover implementing google ads in this version would not been compatible with the previous version as this version would works a little bit different.

Also if its crash, then Android Studio should point to the code where its crashed, if you using the debug version.
« Last Edit: 2019-Aug-14 by spacefractal »
Greedy Mouse - Karma Miwa - Spot Race - CatchOut - Android Extras - is on a vacation trip, home before end of few days in jan.