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.
Related
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
I'm working on a Android embed system, and have a make a service library for all app installed in the system.
This library is shared, I mean it doesn't packed in the other apk, it's a standalone apk and when install it, other app can use library.
You can imagine like openCV app example from version 2.4. User have to install OpenCV Manager and other app have to import it, otherwise it will throw Exception and require you to install this app. It also have same behaviour like <uses-library> tag in manifest but no instruction how to do it.
Sơ anyway to solve it?
PS: I have search everywhere but all the post is about static lib use Android Studio. Shared Library found only use Eclipse and for a long time ago. At new version, openCV sample is converted to Android Studio and use normal import.
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.
I am new to android and java development although I am an expert with IPTV and I have made the biggest Greek and Cyprus IPTV but since there is a lack of Greek IPTV android apps I decided to make one application.I found IPTVCore on playstore which is made by the developer of the IPTV app.In the description it has a link on an app that uses iptv core github
I downloaded the zip changed the icons and renamed the files. In MainActivity.java I removed the first comments and added my playlist url and changed package name.
I have android studio and eclipse with android addons.
How to make it an apk?
If you mean to simply be able to load it onto a devices to test then both Eclipse and Studio will allow you do this when you elect 'Run' and have a device attached via the USB (with USB debugging enabled). This will actually install the apk on your device so you can test it.
If you mean actually making the apk available for others (via the play store for example) then you should look and the Android publishing documentation:
http://developer.android.com/tools/publishing/publishing_overview.html
In very broad terms, you develop the app, build it, test it etc and then when it is ready for release you build it for release (remove all debug code, test data etc), sign the app, and release it via a marketplace like Play Store, or avi email or your own web site.
One important thing to remember is to version the app properly - the is important for all the obvious reasons (users or support wanting to know the version) but also because the marketplace update mechanisms may use it to check what versions can be updated etc.
Update - answering the question in the comment below:
There are two approaches suggested in the Readme file with the project:
To build you custom IPTV app you can do one of the following:
Clone iptv.example project, change app name, launcher icon, and
package name.
Blockquote
Create new Android project with empty activity and use
the code from MainActivity.java
The second one might actually be simpler for you if you know how to create a simple Android project - just do that and then replace the MainActivity code in the newly created project with the code in the MainActivity file (the only java source file) in the githib project you have downloaded.
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.