Moving a Cocos2d-x Android project around in the local file system - android

I've used create-android-project.sh to successfully create an Android app as part of my Cocos2d-x project. Now I want to move the app's directory and all contents to a different location in my local file system.
When I try to build the app after moving it I receive the error:
'make: *** Android NDK: Aborting. Stop.'
How can move my current project around the local file system and still have it build and run correctly?
If I need to re-create the Android project after modifying the creation scripts that's fine too. I looked through create-android-project.sh and it wasn't obvious to me how I can modify the script to create the project in another directory of my choice. Or perhaps I need to adjust some of the settings in Eclipse.

Changing the COCOS2DX_ROOT in build_native.sh to an absolute path makes the project compile successfully.
This is similar to NDK_ROOT defined at the top of the file.

Related

Linking C++ OpenCV to an app in Android Studio

I am integrating existing C++ code that uses OpenCV to an Android app, using Android studio. For this purpose, I have installed the package OpenCV-android-sdk and added it as a module to Android studio. I have also created a simple Kotlin app.
So far I have managed to integrate my C++ code into the project. After adding the paths to the OpenCV includes by means of an include_directories statement, the code compiles successfully.
My next step would be to link against the precompiled OpenCV library, to resolve the "undefined symbol" errors. I have no idea how to achieve this/where to specify it. I have tried to find resources on the web, but not two resources tell the same and the solutions seem overly complicated. I am lost in the jungle.
I finally managed. Here comes the recipe (validated under Windows).
Make sure to download the OpenCV Android SDK and copy it somewhere.
The project must be created as a Native C++ app (Phone and tablet). A cpp folder is automatically created with a native-lib.cpp source file and a CMakeLists.txt.
Add the following lines to the CMakeLists file, after the project line:
set(OpenCV_DIR $ENV{OPENCV_ANDROID}/sdk/native/jni)
find_package(OpenCV REQUIRED)
You must define the environment variable OPENCV_ANDROID and make it point to the folder .../OpenCV-android-sdk that you copied. (Alternatively, you can hard-code the path in the set command.)
Then insert at the bottom
target_link_libraries(app_name ${OpenCV_LIBS})
where OpenCV_LIBS points to the folder .../OpenCV-android-sdk/sdk/native/libs, and app_name is the name you gave when creating your app.
Finally, cross fingers and build.

How to set the local cpp source path in Android studio for prebuild library

I created an App which includes our source code as a native lib (so-file). I'm able to step into it and everything works fine so far with this code.
This native lib links against another native lib which was pre-build on a different machine and which I copied into the jni-abi-folder. I have checked out the svn-repository of this so-file in a different folder parallel to my project and need to be able to debug also into it.
When I now do a break, I can see the method names in the callstack so I assume that the symbols can be loaded, but Android Studio doesn't know where to find the source files.
Under Visual Studio, when I did a break, I could specify the symbols in the symbol path and then an error was displaced that I should navigate to the corresponding source file. Then I only needed to navigate to the folder and it was working.
How can this be done with Android Studio - I have the newest version 3.2.1 installed.
I finally found the solution.
I got a stripped version from my colleague, he basically gave me the version inside his apk which is stripped. Now he gave me directly the build version (I think it is located somewhere in the intermediate directory or so, just search for the name of the lib).
Under Run\Edit Configurations\Debugger\LLDB startup commands the original source directory can be mapped to the source directory on my computer which is different. To achieve this, enter "settings set target.source-map or-dir cur-dir"
There should be a way to find out the original source directory from the so file, but I don't know it right now.
I hope this can help somebody else

Connection with SQLLite on Unity3D using Javascript in Android

How can connect with SQLLite from Android using Unit3D and Javascript?
Someone can'i help me?
Here are the specific steps to getting SQLite set up in your project.
Download SQLite - you'll want the ZIP file with the DLL inside
that's in the Precompiled Binaries for Windows section.
Important Copy sqlite3.dll into your into your project's Plugins folder (make a folder called Plugins if you don't have one).
You won't get a warning if you don't do this, and your project will run fine in the editor, however, it will fail to work when you actually build your project, and will only provide information about this in the log file.
This will give you a License Error if you're using Unity Indie, but it doesn't seem to have an effect on the actual play in the editor, nor does it seem to effect the ability to build stand-alone versions.
Alternately, you can leave it out of your project entirely, but when you build your application, you'll need to include a copy of sqlite3.dll in the same directory as the .exe in order for it to work.
In your project, add in the dbAccess.js file: http://wiki.unity3d.com/index.php/SQLite#dbAccess.js
You should be good to go!
Source (and the above is pretty much copied word-for-word from):
http://wiki.unity3d.com/index.php/SQLite

phonegap build command resetting the asset/www source code

Whenever I execute phonegap build android/ios, my asset folder is getting reset to sample folder and source code.
Because of this , whatever the code I am copying into the asset/www it is being overwritten by sample codes of phonegap
Does anybody come across this issue.
What could be the reason.?
This is the correct behavior of cordova/phonegap project.
Under yourProjectRoot/platforms/android/assets/www there are the source copied in build phase from the yourProjectRoot/www directory, you must implement your HTML5/js code in this folder, this is the entry point for you source.
I suggest you to take a look here: Build the App before start the development.
Help of PhoneGap build command says:
Builds your application for one or more specified platforms. When no
platforms are specified, all installed platforms will be built.
The build task will first prepare and then compile your application.
If you want more control, you can individually prepare and compile
your application with the commands.
Your platform specific www folder is overwritten because prepare command is fired.
If you preparing your entire project in platform specific folder like ${PROJECT_ROOT}/platforms/android and you want to compile it than you have to run phonegap compile your_platform. It will bypass prepare and go straight to compile.

Android gradle project directory variable

I am trying to write a script in gradle that requires opening up a file. I am trying to find the current directory where the project is installed. so I can open a file in my "raw" directory.
Note: I am aware that I can use a temporary file to find the current location of the application. However, I am trying to stay away from that solution.
I am trying to find out if gradle has a buildDir variable that I can use in my task instead.
See the Gradle docs. Specifically, you're interested in projectDir (The directory containing the build script) or buildDir (projectDir/build).

Categories

Resources