How to check if native code is being triggered in a React Native Project - react-native-ios

I am building a React Native Application. I don't have any background in native iOS or Android, so the native code parts are very confusing to me.
Right now, I have to determine if a specific line of code in the 'AppDelegate.m' file is being triggered when the notification arrives. But my lack of knowledge in Objective-C and Xcode prevents me from doing so.
How do I check if a specific line of code is being triggered in the native iOS code?

You can you the breakpoint debugging system thats in both Android Studio and Xcode. You will need to put a breakpoint on the line of code that you want the IDE to stop on when it is run.
Android Studio
https://developer.android.com/studio/debug/
Xcode
[https://developer.apple.com/library/content/documentation/DeveloperTools/Conceptual/debugging_with_xcode/chapters/debugging_tools.html]

Related

Window.onblur or Window.onfocus not working in Android Studio

I implemented a simple Javascript function, which allows the audio to be paused or start depending on if the window where the script runs is focused on or not, and it works on the web.
However, I noticed an issue when I try to implement it in android studio, even after enabling the JS as seen in the screenshot. Indeed, when I get out of the app, the sound is still running whether I click on the back or the home button.
I'd like to add as well that I'm a total beginner in the android studio IDE, but I wanted to know if I could maybe find an answer here. How to make my Javascript-script work in the android environment ?
Thanks in advance
Audio Initialization
Javascript function for window.onblur and window.onfocus
Enabled Javascript in MainActivity.Java

KMM Project Build for iOS Without Running

Maybe I'm just missing something but is there a way to trigger the iOS build in Android Studio for a KMM project that doesn't launch the simulator once the build is done?
When looking at the iosApp run configuration I see it has "Build iOS application" listed under "Before Launch" which makes me suspect this is possible but I didn't see it listed as a gradle task or anywhere else I could think of.
I've been doing the iOS work in Xcode and when I make changes to the shared code I want to rebuild it without running the app (which I've been doing from inside Xcode).
Not exactly a solution, but I found that when you hit build in Xcode it builds the Kotlin code so any changes to the shared module are included automatically. No need to do iOS builds from Android Studio.

Android Studio for Dart without emulator

Is it possible to use AndroidStudio (for Dart) withOUT running an emulator?
Context: I am a complete newbie and have started reading some intro books and following online tutorials. I am aiming to learn DART and FLUTTER and have successfully installed AndroidStudio and an emulator and ran some successful test projects like helloworld.
The thing is, these early example projects are VERY basic things, to teaches me about variables and syntax etc and outputs results to the console. At this point, i do not need to boot up an entire emulator (which adds a layer of clunkiness when running)... but AndroidStudio seems to insist on one being activated?
I could use "DartPad" (which i love) for simple stuff - but it's limited and i'd prefer to learn one dedicated IDE if possible.
It depends on what you are actually running. If you are using Dart alone, you should be able to run it. Personally, I do these kinds of projects within IntelliJ Idea - which Android Studio is based on anyway, but doesn't come with the Android "overhead". Microsoft Visual Studio Code is another valid option that many people use.
If your project is based on Flutter (i.e. it contains UI), you need a "device" to run on - it might be the Android emulator, iOS simulator, Chrome or native (experimental).

Cocos2dx can be used in android studio development with java?

I downloaded the cocos3.14.1 in the cocos2dx official website, and then use the online method to create a project structure, and then compiled out android
Studio version of "proj.android-studio", and finally with the android studio to the success of this project can also be run. But then how do I develop it? Map, event, interface, logic how to write?
After importing there will be an activty inheritance Cocos2dxActivity, and a package "org.cocos2dx.lib". But I do not know what to do
You have to write most of the game logic in C++ and keep your class files in "Classes" directory.
You would have to update the android project include these C++ files.
If you're using a mac, it is easier to develop it in Xcode, and build it for android in the last step. That way you can debug all the game logic in Xcode and simulator quickly.
In the project that is initially created, your game logic starts in the AppDelegate file (by setting things like the design resolution etc), and the first scene is the "HelloWorld" scene.
Since you're new to this, why not just purchase a book and get started, or read any of the many tutorials available online.

Configure android ndk for android studio code suggestion

I'm new to android NDK and just know how to use native code in an java project as in this tutorial: http://kn-gloryo.github.io/Build_NDK_AndroidStudio_detail/
But when writing in C++ the IDE features for code completion, suggestion and other stuff disappear, while in java those features work as usual.
I tried to import some ndk sample from google, they are all written in C++ instead of calling native code from JNI as I'm doing, and the projects support code completion.
Can anyone show me a way to configure Android Studio for code completion to work when developing with NDK and JNI?

Resources