Android-NDK how to compile this code? | Beginner - android-ndk

A developer has published its code in GitHub for anyone who wants to create their server for SAMP Android (a project in development that allows them to play Android GTA online).
Code Link: https://github.com/4x11/SAMP-Android
I want to know which program to use and the right commands to compile this code. As far as I know, this is an NDK build code ..

You can start by reading the NDK guide.
https://developer.android.com/ndk/guides/
Then since the code makes use of the old ndk-build makefiles,
https://developer.android.com/ndk/guides/ndk-build
And the respective integration samples,
https://github.com/googlesamples/android-ndk/tree/master/other-builds/ndkbuild

Related

Possible to use a static library built from a different Android NDK?

The Android app I am working on is completely written in C++. I need to integrate it with a static library that also is written in C++. There is no dependency on STL in any of the projects.
The static library uses cmake to build. Unfortunately, the app is based on an old AOSP version of Android NDK and has no support for cmake.
I also have a newer version of Android NDK in a different directory. This version does support cmake toolchains.
I am thinking I will build the static library against the new NDK and use it in my main project. The ABI is the same for both the projects - armv7a.
I have tested this logic with a sample code. It seems to work. I am able to invoke methods in the static library from my main app.
Also, there are no name-mangling issues.
The question I have is if there is any issue I am overlooking.
I am thinking it should not matter that the compilers used to build the sources are different. As long as they are producing arm-compatible code, I should be able to able to integrate them.
As a matter of fact, another library that I am using, gstreamer, is available for download as pre-built binaries at https://gstreamer.freedesktop.org/data/pkg/android.
Please advice.
For those interested, mixing NDKs doesn't seem to be an issue as long as you follow certain guidelines. Some of them are listed at https://developer.android.com/ndk/guides/cpp-support.
Essentially, there is no problem if your project is 'C' based. However, if you are using C++, you must not use STL.
I have managed to build part of my code with two NDKs and I am not seeing any link time or runtime errors.

VSCode and AndroidStudio Project setup to run flutter for device, web (and desktop?)

I have read a question/answer which states Flutter Web is a fork of Flutter and so one Android Studio (or VScode) project can't be built to handle both.
I'm not an expert on either (obviously) but I don't understand why the fact the libraries are forked implicitly precludes one from using the same source code for the different destinations.
Has anyone done so? And, if so, is there a skeletal project anyone would care to share?

Using Zxing Library in my aplication

I have seriously tried to find a method to integrate zxing library for my barcode scanning application and found some examples and tutorials, but they mostly concentrate on the code of integrating the project library. I have understood how to use it but my only issue is I cant seem to find a correct way to copy the new zxing library. Please can anyone guide me through which files to copy where or how to bind the project in Android Studio.
I believe you want to 'add' the zxing library in your Android Studio project.
If you are comfortable with using Gradle, just add the below line in your app's build.gradle file under dependencies.
compile 'com.google.zxing:core:3.2.0'
Build your project and then start integrating zxing by importing the required classes.
I hope this answers your question and solves your problem.

Converting android ndk build files to gradle

Is there any documentation on converting a application.mk/android.mk file to a gradle based build.gradle file?
good links, QArea. Thanks a lot!
At this moment NDK support in Gradle are very limited. If you need to assemble something that gradle not provides that function
I do like this.
I collect the old-fashioned, but to .so-patches automatically picks up the Gradle-plugin:
ndk-build -j4 NDK_LIBS_OUT=src/main/jniLibs
Otherwise, you must wait for next version of gradle 0.13. Devs promise that NDK will fix integration with NDK.
I made a script tool to convert android.mk building system to gradle building system, because I wanted to test the demo source codes in:
https://android.googlesource.com/platform/development/+/05523fb0b48280a5364908b00768ec71edb847a2/samples
But after searching whole internet, I found no one did it yet. So I created this tool by myself. But even with this tool, we couldn't ensure all projects in AndroidSamples could be built and executed successfully because of the API versions and features mismatch. So I created my own projects for https://android.googlesource.com/platform/development/+/05523fb0b48280a5364908b00768ec71edb847a2/samples
And I want to convert those demo projects one by one.
Now the whole source codes are here:
https://github.com/clockzhong/AndroidSamples
I already successfully converted some samples into gradle building system and executed them correctly on my android phones. But I still have some version mismatch issues, anyway, I'll mentioned it in the project check-in comments.

Tesseract Development

I am quite new into application development.
Just wanted to ask you guys, How do I implement the source code from Tesseract inside Visual Studio that I could compile and run? What are steps I have to do to get it running? I can't seem to find the full project file for it. Thanks in advanced.
Have you tried the instruction for building on Windows from this page?
https://code.google.com/p/tesseract-ocr/wiki/Compiling
While a go I was in the same situation, Google Code was shutting down and the official Github Tesseract implementation for Visual Studio was really buggy, old and didn't compile.
This repository with a ready to go VS 3.02 tesseract implementation with Leptonica helped me:
https://github.com/charlesw/tesseract-vs2012
It has a documentation how to run it. But basically you have to open it with VS and run it. It will create the dll and libraries required to use Tesseract in a VS Project and the binaries ready to go using Command Lines.
If you need the documentation for Tesseract 3.02 or higher you can find it here:
http://tesseract-ocr.github.io/modules.html
The oficial forum is in google groups there you will find some examples:
https://groups.google.com/forum/#!forum/tesseract-ocr

Resources