Author Topic: How do i use Android Studio?  (Read 1247 times)

Offline Bluepixel

  • Mc. Print
  • *
  • Posts: 26
  • www.bluepixel-studios.net
    • View Profile
    • Bluepixel Studios
How do i use Android Studio?
« on: 2019-Nov-09 »
Hi there, I was super excited to try out android studio, when I compiled to android it told me to install android studio so I did. I created a simple hello world program and when I compiled for android it started up android studio, started updating some stuff and after a long time of waiting I just got errors.

Ive tried a lot to make this work but nothing seems to work.
Is there maybe a tutorial or guide on how to use android studio?
www.bluepixel-studios.net

There are two ways to write error-free programs; only the third one works.
(Alan J. Perlis)

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1741
    • View Profile
Re: How do i use Android Studio?
« Reply #1 on: 2019-Nov-09 »
Check the readme in the android studio folder created by GLB after you compile.
Also the Android Studio SDK Manager needs to have SDKs and libraries installed - you can find more about those online...


There are certain things you need to change and others you need to leave as is.

build .gradle at the app level >

  // GLBASIC_USER_NOTE versionCode, versionNumber, target SDK
        minSdkVersion 23
        targetSdkVersion 29


androidmanifest.xml - make sure you have it setup correctly if you edited it.

Below image is my SDK tools setup.



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

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 271
  • to program what I have todo how should I program?
    • View Profile
Re: How do i use Android Studio?
« Reply #2 on: 2020-May-04 »
Hi. I can't compile Android with last version Android Studio 3.6.3. Getting below error:
Do you have any advice on how to proceed?
Below image is my SDK tools setup.
Version Java java 1.6.0-25
Thank you

"ERROR: Unable to resolve dependency for ':app@debugAndroidTest/compileClasspath': Could not resolve androidx.appcompat:appcompat:1.1.0.
Disable offline mode and sync project
Show Details
Affected Modules: app"


Offline dreamerman

  • Global Moderator
  • Dr. Type
  • *******
  • Posts: 365
    • View Profile
    • my personal website
Re: How do i use Android Studio?
« Reply #3 on: 2020-May-04 »
I will join Your question. What beside Android Studio is currently needed to compile for Android - like specific JDK/Java version or some other tools (as for other tools that I checked recently they for example advised to use older Python versions and so on) are needed? Or I missing some tutorial that's available here on forum and it's up-to date..
Check my source code editor for GLBasic - link Update: 20.04.2020

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Re: How do i use Android Studio?
« Reply #4 on: 2020-May-04 »
Java 1.6.0-25 and any other sun java is not required at all as Android Studio uses OpenSDK version of Java instead, which is included with Android Studio and installed by default. So you dont need to use any of the official java version at all!

Also if Android Studio want you to update project settings to newer settings in a project, then the project can cause fails to compile completly.

But if that was happens, its very easy to revert it again:

in File/Project Structure/Project

Make sure Android Grandle Plugin uses version 3.4.1 and Grandle version uses 5.1.1. We can uses a bit newer version here, but those versions should works and still works nicely today (has just released PowerUp Elevation today)!

Also im do heard androidx.appcompat:appcompat:1.1.0 is depreacted? howover line is still there and should not cause any trouble throught when that grandle versions above is using.

After that, open the grandle file again and sync. Then any missing sdk, cmake and ndk that is required should now been downloaded automatic. This take some time.

« Last Edit: 2020-May-04 by spacefractal »
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1741
    • View Profile
Re: How do i use Android Studio?
« Reply #5 on: 2020-May-04 »
Also, make sure to sync project before builds - and might need a clean project with the new update.
Comp:
Speccy-48k, Speccy-128k, Amigas, PCs

Offline caffeinekid

  • Mr. Drawsprite
  • **
  • Posts: 59
    • View Profile
    • TCKSOFT
Re: How do i use Android Studio?
« Reply #6 on: 2020-Sep-07 »
I'm trying to build for Android and as far as I'm aware I've installed everything I need to.

Android Studio just comes up with configuring projects and doesn't get past that no matter how long I leave it. It also seems to be using my network connection constantly for some reason?

Any ideas guys?

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 271
  • to program what I have todo how should I program?
    • View Profile
Re: How do i use Android Studio?
« Reply #7 on: 2020-Sep-09 »
I would like to help you if only Android Studio works for me
« Last Edit: 2020-Sep-09 by Qedo »

Offline caffeinekid

  • Mr. Drawsprite
  • **
  • Posts: 59
    • View Profile
    • TCKSOFT
Re: How do i use Android Studio?
« Reply #8 on: 2020-Sep-12 »
Well I got a apk compiled but it doesn't actually work it says it has a fatal error. Probably a schoolboy error as I've never used android studio before and with it was simple still like the old days.

Quote
java.lang.RuntimeException: Unable to instantiate activity ComponentInfo{com.tcksoft.blitz/org.libsdl.app.SDLGlbasic}: java.lang.ClassNotFoundException: Didn't find class "org.libsdl.app.SDLGlbasic" on path: DexPathList[[zip file "/data/app/com.tcksoft.blitz-8d5YTa9SdmINaA_Ah0AnzA==/base.apk"]
.... yaddayaddayadda.

No default activity? How has it/me managed that and any idea how to fix it please? Cheers.

Offline caffeinekid

  • Mr. Drawsprite
  • **
  • Posts: 59
    • View Profile
    • TCKSOFT
Re: How do i use Android Studio?
« Reply #9 on: 2020-Sep-13 »
I've got it building and running on my phone, but no sound? I'm using wav files but nothing is playing. The graphics are working but no sound.

Do I have to initialise the mixer or something? I don't have a clue.

Offline Qedo

  • Dr. Type
  • ****
  • Posts: 271
  • to program what I have todo how should I program?
    • View Profile

Offline MrPlow

  • Prof. Inline
  • *****
  • Posts: 1741
    • View Profile
Re: How do i use Android Studio?
« Reply #11 on: 2020-Sep-14 »
Hi,
For v16 sound should be working just fine.

I have been using this even when SETCURRENTDIR is used.
 
Code: (glbasic) [Select]
FUNCTION LOADSOUNz: File$, ID,BUF
     
         LOADSOUND GETCURRENTDIR$()+File$, ID,BUF
ENDFUNCTION


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

Offline caffeinekid

  • Mr. Drawsprite
  • **
  • Posts: 59
    • View Profile
    • TCKSOFT
Re: How do i use Android Studio?
« Reply #12 on: 2020-Sep-15 »
Thanks I will give that a try and fingers crossed.

It's rather frustrating. To say the least.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Re: How do i use Android Studio?
« Reply #13 on: 2020-Sep-15 »
its a issue im fixed and gernot broke it again (etc did not used it). howover you can uses GETCURRENTDIR() what ever system throught.

Android is also not windows at all and there can been some frustation parts as well.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.

Offline spacefractal

  • Community Developer
  • Prof. Inline
  • ******
  • Posts: 3929
    • View Profile
    • Space Fractal
Re: How do i use Android Studio?
« Reply #14 on: 2020-Sep-16 »
also you should NOT update the  grandle version when you asked to that, that can break your project. so when its ask it, press no to this project.

Installing AS can been quite annoying until get anything running for the first project.
Genius.Greedy Mouse - Karma Miwa - Spot Race - CatchOut - PowerUp Elevation and The beagle Jam.