Android - has anyone tried yet?

Previous topic - Next topic

MrPlow

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

MrPlow

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

Kitty Hello

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.

spacefractal

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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

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

MrPlow

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

MrPlow

Also, where is the c++ code placed in the Android Studio project?
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

MrPlow

#7
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>
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

spacefractal

#8
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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/

MrPlow

#9
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?

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

MrPlow

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

erico

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.

MrPlow

Quote from: erico 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

MrPlow

My logcat from trying to run the built & signed apk

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

spacefractal

#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.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation - The beagle Jam - Cave Heroes 2023 - https://spacefractal.itch.io/