FAQ Database Discussion Community


Eclipse does not seem to recognize Native Android code

eclipse,android-ndk,native-code
I am trying to learn about native Android, using NDK. I find some sample projects in NDK folder and on the Internet. After much configuration, they are runnable. But, my problem is: when I open a .c or .h file in JNI folder with Eclipse (just want to see what...

Do Java Atomics only require atomicity with respect to the VM

java,multithreading,jvm,atomic,native-code
I was looking at the Java source code for the AtomicInteger class (found here) to see which atomic primitives are required to implement a JVM. I noticed they use the undocumented Unsafe API to implement their atomic integer operations and that the only two primitives they use seem to be...

Alooper_addFd data parameter

android,native-code,android-looper
I am not sure how this function works. This is prototype: int ALooper_addFd(ALooper*looper, int fd, int ident, int events, ALooper_callbackFunc callback, void *data); What is this 'data' pointer? If callback is not NULL, 'data' should be custom data passed to callback. But, if callback is NULL, what is 'data' parameter...

How do I write a Windows 10 universal class library that references native code?

winapi,native-code,windows-universal
I have a C# class library that references and wraps Win32 native methods. But I can't seem to port this code over to a newer "universal" C# class library. What do I need to do in order to properly marshal these native methods?

unmanaged memory leak in a managed application

c#,memory-leaks,windbg,native-code
I am trying to find root cause of a an unmanaged heap. My application is a .NET app but it calls some third party libraries that are C++. I have taken two memory snapshot that are 1.5GB apart. Here is output of !address -summary from the 1st snapshot 0:000> !address...

When to call MediaCodec:getOutputFormat()?

android,exception,mediacodec,native-code
For an audio codec, calling MediaCodec::getOutputFormat() throws an IllegalStateException on one device (not on another). The Android docs says that such an exception is raised if the codec is not in the Configured or Executing states: http://developer.android.com/reference/android/media/MediaCodec.html On both devices, the call to getOutputFormat was after the codec was configured....

Does .Net Framework Class libraries in GAC compile each time to Native Code ? Or will it load directly from Native Image Directory ?

.net,clr,gac,jit,native-code
I have been reading the book CLR Via C# and in that by using NGen.exe i learnt that i can compile my assemblies to Native Image. This increases the performance. However the native code is customized to my architecture. When i opened the Native Image Directory C:\Windows\assembly\NativeImages_v4.0.30319_64\System\d6591361d8701ff6eb6a9df223c24684 I found Native...