IntelliJ JNI debugging - java

I have an android application which does some real time sound processing. Since this task is time critical, I wrote the code that does the processing in C++, the rest of the application is Java. Android Studio supports JNI debugging no questions asked which made it easy for me to write the code. Then, I left the code alone and decided in the meanwhile to get rid of Android Studio and to use IntelliJ instead.
Now, I had an issue in the native code and wanted to debug the C++ code, when I suddenly realized that I was unable to set breakpoints in the C++ code.
I also tried to set a breakpoint in the java code just before the native call and hoped that by hitting "Step in" it would go inside the native code but instead, InteliJ just skipped over it.
Also, the run configuration with dual debugging enabled (which I created in Android Studio back then) does not seem to work (Android Studio used to load a ton of libraries when launching the native debugger, IntelliJ does not do that).
This seems odd to me, as - according to JetBrain's official blogpost - IntelliJ has all of Android Studio's features except for the project setup wizard. What am I missing here?
Btw I am aware of this question but its answers are outdated.

Related

Flutter Snap and Android Development on Linux

I am currently using ubuntu 21.10 and have flutter, java, Android Studio,Visual Studio Code installed. I can build android fine. I can run desktop versions of it. When it comes to building a snap, that is a different story. I once tried to build a desktop app by following the instructions here.
After following the instructions I ran the "snapcraft" and my computer pretty much exploded. It kept installing java and flutter and went into some infinite loop until i ran out of space on my computer (and I also have to pay for data too).
I'm wondering what went wrong? I used the multipass method. I'm not sure what that is or the alternative for LXD.
I have installed android studio, java, and flutter by using the download package methods and not snap. Was that the problem? When I first tried flutter, it did not work with snap, so I prefer not to. I wish there was a simple way to do this, like making a windows exe in flutter, etc.
I can make electron-builder snaps quite easy as well and have uploaded to the store. It was very simple. I'm wondering why things are so complex with flutter?
Any solutions? I would like to rebuild my dev machine in the next few days. I'm thinking of using the snap installs of java, flutter, android studio, instead.

Is there `hot reload` feature in Android Studio native Java app development?

Does Android Studio have hot reload feature for native Java app development?
I am working on somewhat large application and it takes long time to rebuild so I am searching for some way to make it faster.
There is something really similiar called Instant Run for target devices that run Android 8.0 or later. In Android Studio there is a button right next to the run icon and it will apply your changes without rebuilding the entire app from scratch. In newer AS versions the button is simply called Apply Changes.
However, speaking from personal experience this feature is nowhere near as reliable and fast as for instance, Flutters "Hot Reload" and sometimes it will simply not work. In such cases you will have to rebuild the entire app.
Here is the official documentation for Apply Changes.

Processing for Android, use of libraries

I have a Processing sketch that works fine on my computer.
I'm now trying to get it running on my Android tablet using Processing Android mode. But I'm getting a lot of compiler errors saying "cannot find symbol".
I'm using some Processing libraries I've created using https://github.com/processing/processing-library-template .
These libraries don't actually access system resources or call the Processing library themselves. Or any other external Java except Java.util. They're just manipulating data-structures.
However it seems Android mode has a problem with them.
Googling around it seems that a lot of Processing libraries don't work with Android Mode, but I can't find anything explicit : should I simply assume that external libraries can't work at all with Android mode? Or are there specific things that won't work? Or should I be looking for a specific bug somewhere in my code?
Update : Further details. I believe Processing Android mode targets Android 2.3.3. I'm using Processing 2.21. The libraries I'm talking about are my own.
From a related Git Issue page , a comment by omerjerk
The master branch of this repository is not buildable with the master
branch of processing. processing has moved ahead and we haven't
updated this repository yet. Why are you really building the Android
mode yourself ? If you want to run your processing sketches on your
phone, then just download processing 2.2.1 from the main website, open
the IDE and from there, download the Android mode. In case, if you
really want to build Android mode from source, apply this pull request
- #98 .
See if this helps

What program/s or application can compile my Java Server Code, Android Client Code and Asynctask code?

Assuming that I have my Java server code, Android client code and asynctask code, what program or application can compile / write my codes?
What program can run my code in Java Server, Android Client, and Asynctask? I found codes on google but I don't know where to paste it. I'm missing the program/application. What is / are the suitable application(s) that can do the job?
I'm not sure what you mean by your ASyncTask code as this would be part of the android code.
Anyway, your android code can be run from Eclipse but you would need the Android SDK and ADT plugin for eclipse. Details of which can be found here. There are other IDEs but this is probably the most used and if you are beginner at android Google has all the documentation about eclipse which will make things easier.
As for your java server, this can be run in Eclipse, but there are lots of other browsers that can be used, Netbeans is another example.

Porting Java code to Android

I have Java code for face recognition which works fine. There is a problem however if I port the code into an Android application.
I have included the necessary jama and jmf which is required by the Java code into the Android app. The Android code compiles fine, but when I run the app it's force closed!
What might I be doing wrong here? What are the things that I need to keep in mind when I do the porting?
By the way there is no GUI for the Java code.
Porting your java code to Android will usually not work, you need to foloow the guidelines for creating an Android application.
You should start at the Android documentation for help.
http://developer.android.com/guide/topics/fundamentals.html
I'd recommend you take a look at the Android OpenCV project. In their CVCamera sample, they have a nice setup for doing real-time image processing for feature detection etc. I've previously modified it to support face detection using the OpenCV library.
If you want to use your own code instead, I suggest you strip out all the JNI/NDK interop code and substitute your own. At any rate, it's a nice starting point.

Categories

Resources