Android IDE (AIDE) Support Forum

I can't use JFrame, can't add Library…?9

Hello dear friends,
I have a main problem with adding library. I couldnt add any library to AIDE.
Maybe from this I cant create a very simple window with codes for example. Because of JFrame doesnt recognised in AIDE. I almost read all info from here but still didnt fix my problem. I will add some pics and details pls if someone understand what is my problem, I will be glad and appriciate him/her…
My small prog is just this:

package src;
import javax.swing.JFrame;
public class Pencere
{
public static void main (String[]args)
{

JFrame pencere=new JFrame();
pencere.sizeSet(640,480);
pencere.setVisible(true);

}
}
its not working….
I give file path to in AIDE/Settings/Build& Run/SDK>storage/emulated/0/Android/obb/com. aide. ndk/main. 1706280005.com. aide. ndk. obb

My build.gradle is this:

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
repositories {
jcenter()
}
dependencies {
classpath ‘com.android.tools.build:gradle:1.+’

    // NOTE: Do not place your application dependencies here; they belong
    // in the individual module build.gradle files
}

}

allprojects {
repositories {
jcenter()
mavenCentral()
}

}

My setting.gradle is just this:

include ‘:app’

1 Like

Hello there, I learnt new things.I learnt how to add library to ANDROID PROJECT and added. But still I couldnt add any .jar file or library to my JAVA PROJECT. Now I can’t continue to make java projects with AIDE.
In the browser if I open the Android project I can see the selection of +Add to project… button. But when I open the java project in my main directory I can’t see this button about +Add to project…
If someone know what is problem, I would appreciate to him/her…

This is my JAVA Project Properties,there isn’t any libraries that added…

I added to ANDROID PROJECT library, but can’t add it to JAVA PROJECT. There is no chance to add or I don’t know how to add…

your pissing in the wind mate JFrame cant be used on Android because Swing cant be used on Android, notice i said cant be used on Android and not cant be used on AIDE, it makes no difference if your writing a pure Java program your still doing it on a device that runs an Android OS.

Basically Android doesn’t use a standard JVM (Java Virtual Machine) to run Java byte code it used a DVM instead (Dalvik virtual machine) this was later changed to ART (Android run time) maybe you remember back when Android phones had the option in developer settings to switch between the 2 before Google made ART the default? anyways Android uses a special version of Java that was built specifically for Android so for that reason it doesn’t support all of the Java API’s you can see what it supports here.

https://developer.android.com/reference/packages, notice the swing package is there but JFrame is not, also take a look at the awt package notice you can only use font from it, Android uses XML for its UI not Swing.

Try any Java IDE on Google play you won’t find a single 1 that will let you use JFrame. happy coding :+1:

2 Likes

Thank you very much Jay…
Hahaa I quessed that maybe this codes doesnt use on Aide also…But I am begginer and found very excellent video series 130 parts on youtube for Eclipse…When I came to 32.part I forced have to stop…The man is only making very simple window and I tried also…but a lots of errors happened.
Jay, am I need to add library or jar files to make projects. All my java projects properties shows library? If yes how to do it? And there is Git setting, how can I set Git for java project. If you help me I would be appreciate you…
Thank you very much…

Its a really powerful IDE though so don’t let the fact you can’t code a UI with it put you off using it, a well written console program can be just as good as a program with a pretty UI.

what tutorials are you watching btw do you have a link? the slidenerd videos are really good should check em out.

there’s an official tutorial by the AIDE devs here for Git https://www.android-ide.com/tutorial_git.html its been a really long time since i used AIDE so i dunno if this still works.

create a folder in the root of your project and name it libs use a file manager to put your library’s in that folder.

Thank uou very much Jay.I appriciate your helping to me. Since 3 days I was trying to understand what is the problem. I asked to support@appfour.com too but didnt take a good answer like yours unfortunately…
Yes I have the link of tutorial videos about java for eclipse. This guy’s latest videos are really hard and big, you can take a look…He is explaining very good but in Turkish. And I stopped here;


Do you have links for any tutorial videos for AIDE or java on Android?
I will try to add Git…Ty…

Cool i use to use Eclipse for Android and Java development but switched to IntelliJ for Java and Android Studio for Android. Tutorials to do what in AIDE? i doubt there’s any tutorials on Java on Android as its pretty much the same as a desktop.

Dear Jay,
I still didnt learn how to use graphic codes in AIDE, that is what I want to learn since 3 days…I learnt there is awt package for this but there is no any video or sample about how to use it on AIDE. Or cant we draw graphics as Java Projects in AIDE?
For example I want to open a new window and want to draw a square there…with codes in AIDE but as a Java Project. Do you know what are the codes, if you know can you write here a very simple sample?
If I learn this I can share this to all graphic components…

Like i said awt is there but you can only use Font from it. To draw graphics you would need to use a library something like Libgdx https://www.android-ide.com/blog/2014/04/08/learning-game-development-with-aide/

if you want to code Java programs that have UI objects you need to use a computer.

Thank you very much Jay I learnt what I wonder all and what is my problem by you. But if so, if we cant do real java project on Aide just like on computer why we are paying money to buy it…Just only use console outed programmes?
I was planning to learn as firststep java and than will jump to Android. I hope we can use and make Android proggrame that not limited…If it has limited also, AIDE stays onlynas a trash for me…
I will write my this thoughts to developer AIDE’s too…
Again I appreciate your helping me, even Aides owners didnt tell any word about how it works or not also…
See you…
Best regards…

you can do a real java project on AIDE since when is a console program not a real project? your talking like the devs have fucked you over :confused: when you got exactly what you paid for, its clearly written in the app description that you can build Android apps using Java and other languages and code pure java console applications if you never read the app description before forking out thats your fault

Of course the Android side has limits AIDE is still just an Android app its not a full blown desktop IDE and it never will be but you can make some pretty damn good professional apps with it if you actually know how to code and know Android development. It amazes me why so many beginner Java developers think they should be able to run a Java program that uses Swing on a device that runs an Android OS.

your learning Java development so you should know whats required to compile and run a Java program. Btw Swing is also ancient and in a few years Oracle will no longer be maintaining it, they created JavaFX to replace it.

just read the app description again and

turns out its actually written 3 times in the app description that you can code pure java console apps. Have you actually tried any of the other Java IDE’s on Android yet? you wont find a single 1 that will let you code and run a Java program with Swing there all console only.

I accept that I am begginer and dont know detailed information about java and android proggramming. My english is not very strong also. But I trusted the word in introduce AIDE that tells:
AIDE fully compatible with eclipse…Just copy it and paste to Aide, it will work… (I didnt notice and understand what does it means PURE JAVA CONSOLE APP as a begginer, very normal. I supposed that I can code evrything as like as in Eclipse…And I quess many person quess like that too…as beginner…Sure devs cant make an app only for beginner, they are right…but they have to explain this in introduce clear…openly…
As a result…I turned back to Eclipse now…gived up using AIDE…

if your learning a programming language you should also learn about the language itself not just how to code using it but also its requirements, limitations etc. Knowing this will help you do things in your programs such as writing code that interacts with the OS your running it on which at some point you will definitely need to do. Java is cross platform but remember each operating system is different.

Thats actually true AIDE is fully compatable with Eclipse but Swing is not a part of Eclipse its a part of Java, did you know you can actually write a Java program using nothing but notepad and a command line? Eclipse just makes it a lot easier to write code, btw Its cool that your learning Java for Android development this will make it so much easier to code Android apps. Anyways this post is getting longer than i want it to, happy coding :+1:

Yes I knew you can write codes on notepad too. At the beggining sure I got some info and as a result I learnt if you be good proggrammer you have to learn a proggrame language than you pass to Android. And I learnt that Java is most adviced proggraming language…I knew old languages that Turbo Pascal and Q Basic. So I am not very alien to proggramming. All languages logic are same differences are only with witing commands shape…Now I am going ahead to learning Java with eclipse and I hope after that I turn back to AIDE to making Android programmes…Yes you are right it is getting long our discussion. Thank you very much about infos that you gave me…See you…

once, i tried to import the jdk.jar in a android project, it’s slow, but has compiled, when i launched the app, it has crashed!