native

visual studio 2015 android is missing .mk files for NDK native development

安稳与你 提交于 2020-01-02 09:59:53
问题 I am using Visual Studio 2015 to compile and test Android native c++ code. I really need to use LOCAL_SHARED_LIBRARIES in android.mk file to use shared native library. But Visual Studio 2015 doesn't even have .mk files. Instead a bunch of XMLs is used. Please help me. 来源: https://stackoverflow.com/questions/36219677/visual-studio-2015-android-is-missing-mk-files-for-ndk-native-development

How do I correctly wrap native c library in Xamarin.iOS

微笑、不失礼 提交于 2020-01-02 07:29:30
问题 I am trying to bind a native c (not objective c) library to Xamarin.iOS. My project that consists of .c and .h files is building fine in XCode. Actual .h and .m of the project do not contain any functions, I only need to use the c-defined routines. The h file, that contains the required method definition looks like this: #ifdef __cplusplus extern "C" { #endif /* __cplusplus */ #include <stdio.h> #include <stdlib.h> #include <stdint.h> #include <string.h> int sprec_flac_encode(const char

Marshalling array of structs vs classes

荒凉一梦 提交于 2020-01-02 06:55:22
问题 I want to read a native struct into a C# type using Marshalling. My method to Marshal structs is like so: T ReadObject<T>(BinaryReader br) { var bytes = br.ReadBytes(Marshal.SizeOf(typeof(T))); var handle = GCHandle.Alloc(bytes, GCHandleType.Pinned); try { return (T)Marshal.PtrToStructure(handle.AddrOfPinnedObject(), typeof(T)); } finally { handle.Free(); } } Now this works fine in general, the problem arises with the following type: [StructLayout(LayoutKind.Sequential, Pack=1)] class SubData

Add a native lib to an APK

∥☆過路亽.° 提交于 2020-01-02 05:51:12
问题 I'm developing an Android application that uses native code. I need to add an external native library to my APK's lib folder on every build. How can I do that? Thanks. 回答1: Put the library in the native library path which defaults to "libs" in your project folder. If you built the native code for the 'armeabi' target then put it under libs/armeabi. If it was built with armeabi-v7a then put it under libs/armeabi-v7a. <project>/libs/armeabi/libstuff.so 来源: https://stackoverflow.com/questions

Add a native lib to an APK

*爱你&永不变心* 提交于 2020-01-02 05:51:05
问题 I'm developing an Android application that uses native code. I need to add an external native library to my APK's lib folder on every build. How can I do that? Thanks. 回答1: Put the library in the native library path which defaults to "libs" in your project folder. If you built the native code for the 'armeabi' target then put it under libs/armeabi. If it was built with armeabi-v7a then put it under libs/armeabi-v7a. <project>/libs/armeabi/libstuff.so 来源: https://stackoverflow.com/questions

JNI - UnsatisfiedLinkError - loadLibrary always fails

淺唱寂寞╮ 提交于 2020-01-02 05:21:15
问题 I am attempting to get a simple JNI example working, but no matter what I do, I cannot get it to work using the loadLibrary command. It works perfectly if I specify the absolute path of the .so file and use System.load instead of System.loadLibrary. Here is my directory tree: . |-- - |-- TranslatorWrapper.c |-- TranslatorWrapper.class |-- TranslatorWrapper.cpp |-- TranslatorWrapper.h |-- TranslatorWrapper.java `-- libTranslatorWrapper.so Here is the Java code: public class TranslatorWrapper {

JNI - UnsatisfiedLinkError - loadLibrary always fails

百般思念 提交于 2020-01-02 05:21:03
问题 I am attempting to get a simple JNI example working, but no matter what I do, I cannot get it to work using the loadLibrary command. It works perfectly if I specify the absolute path of the .so file and use System.load instead of System.loadLibrary. Here is my directory tree: . |-- - |-- TranslatorWrapper.c |-- TranslatorWrapper.class |-- TranslatorWrapper.cpp |-- TranslatorWrapper.h |-- TranslatorWrapper.java `-- libTranslatorWrapper.so Here is the Java code: public class TranslatorWrapper {

Are all the “Magic” methods on the JVM marked as Native?

穿精又带淫゛_ 提交于 2020-01-02 03:50:11
问题 By "Magic" I mean the methods which have semantics which are not expressed in pure Java. I know all native methods are magic, in that their implementation is provided by the underlying runtime and not by Java bytecodes. Is the reverse true? Are all magic methods native , or are there some magic methods apparently implemented in pure Java, but with some extra help from some JVM-special-casing? The use case is that I want to modify the semantics of Java by instrumenting its bytecodes. All these

Anyone ever tried to develop in C or C++ for Blackberry platforms?

折月煮酒 提交于 2020-01-01 09:26:29
问题 Every indication I have, based on my experience in embedded computing is that doing something like this would require expensive equipment to get access to the platform (ICE debuggers, JTAG probes, I2C programmers, etc, etc), but I've always wondered if some ambitious hacker out there has found a way to load native code on a Blackberry device. Anyone? Edit: I'm aware of the published SDK and it's attendant restrictions. I'm curious if anyone has attempted to get around them, and if so, how far

SBT: Cross-platform way to set java.library.path?

我只是一个虾纸丫 提交于 2020-01-01 09:06:30
问题 I was working on a project that requires loading of native libraries, and so far, all development was restricted to Linux. In order to run my project, I could simply enable forking and modify java.library.path as follows: javaOptions in run += "-Djava.library.path=some/common/path:lib/native/linux" My question is: How can I do the same in a cross-platform way, so that I can share my build.sbt with a Windows-based developer. There are in particular three things that I couldn't figure out so