Making apk from jar using microemulator - java

Well i `ve made an app using java me and as graphics i used lwuit library which i added into the midlet`s jar. On Nokia it runs smooth and i wanted to port it to android. So i found out about microemulator http://microemu.blogspot.ro/2008/11/running-java-me-applications-on-android.html and i followed those steps and i got the apk. However when i run it into the Android Emulator it closes at start. I don`t know what may be the problem because i was able to convert the demo jar app into apk and it ran succesfuly.
Any ideas on what should i do?

I suggest you port your application to Codename One which should be pretty simple. It has proper Android support which will make your application look and act native on Android.

Related

How to develop an Android application without Android Studio?

I've installed and set up Java JDK 17 as well as Android SDK (the manual way) on my Ubuntu 22.04.
From there, is it possible to develop an Android application in Java WITHOUT Android Studio ?
Developing through the command line or through a light IDE is fine by me, but there are very few guidance and information out there.
Thanks to enlighten me.
Sure you can! You'll need to type an awful lot of stuff though, that Android Studio does for you automatically:
You'll need to create gradle files to build your project, you'll need to create an Android manifest to describe your Android components and your app (permissions, themes, target SDK, etc.).
You'll need to create the code files containing your Android components (Activity, Fragment, Service, BroadcastReceiver, etc.). You'll need to create all your UI definition files in XML (layouts and other resources).
Then you can use gradle on the command line to run all the necessary preprocessors, code generators, compilers, linkers, resource builders and package builders to give you an APK which you can then install on your device for testing. And you can debug by writing lots of stuff to the logs and using adb commands to get the logcat off the device to see the log messages, exceptions and stack traces.

java logic with flutter ui

I have written a huge java programm (about 6000 lines of code including UI) with javaFX. I decided to convert this project to a flutter project to be cross-platform and make it look nicer. My idea was, that I could just use my Java logic in the flutter project, which actually works pretty easy via MethodChannels in the android directory of a flutter App, but here is my question:
Does this android directory in the flutter project make the project only viable for android (as long as I dont make a similar version for iOS)?
Is there any other way to use my android code other than this android directory (maybe in the normal lib directory)?
Edit: Reworked my questions to make clarify what I was asking for

Android Studio - package java.awt.image does not exist

I have a problem running my project on Android Studio. I am working on an Android project that has a native Java library inside it. It was running fine all the time. But suddenly when I open Android Studio, I find this error:
There is also an error in the .gradle of the project:
It says that URI is not registered.
When Android Studio is started, I find this message:
It seems that there is something wrong in Java configuration, but I can't find out what is the problem?
It was running fine all the time
Not on Android, it wasn't.
It seems that there is something wrong in Java configuration
No. You are using classes that are not part of the Android SDK.
The java Swing and AWT API are not part of the Android SDK and thus aren't including with it. You must find an Android equivalent image library to use in your app. There are few good ones around just depends on what functionality you need to have available to you in you app. Try searching Picasso and or Volley. Picasso is very popular and well known. it has a lot of feature including networking functionality for loading images from the web. The Volley library isn't an image library but an networking library that contains some predefined classes for loading images over the internet.
So this just happened to me. I'm not 100% on the details of how I got it working again, but its roughly this (on my Mac):
Quit Android Studio
I went to ~/Library/Application%20Support/ and deleted the AndroidStudio3.2 directory
I relaunched Android Studio and I got some warning dialog about plugins not existing.
Chose the button that is something about reinstalling or fixing (or whatever isn't deleting or ignoring)
Another dialog comes up. There are a bunch of plugins that are in red. Deselect all the red ones. Then reselect all those ones that were previously red.
Android Studio asks you something and if you want to restart Android Studio. Pick the thing that includes restarting.
And once Android Studio restarts, chose to rebuild your project, and then it worked.
Good Luck and I hope this works for you too.

Run *.jar file on Android

I copied the program from this link: Memo Game and turned it on on Eclipse. Everything worked properly. What if I want to try it on my Android device? I download BlueStacks and exported Eclipse project into Runnable JAR file. Then I tried to turn this file on using this guide but I couldn't do it. I found the whole process very difficult and I am sure there are easier methods to write Android applications.
Main question: What should I do in order to turn on a normal Eclipse application that I write and test on my computer on Android? Is it at all possible?
I know that there is a program called Android Studio, but there you use specific commands that I am not familiar with. That's why I am asking about turning on the same code I write on computer but on Android.

Android Bluetooth Communication Between Android App and Java App

I want to create an app that passes a string of a command from the Android app to the Java app. I do not know where to start. How could I make something like this where the Android app gives the Java app (running on a Mac or PC) a command and the desktop app does it? Thanks.
It was a long time ago, but I actually did something like that.
You can check the project at https://github.com/guillaumyle/BlueRemote/
I suggest you to ignore everything not "Bluetoooth Communication" related, as it is probably not well written.
Check the blueremote package for the Android part.

Categories