native

is java byte the same as C# byte?

萝らか妹 提交于 2019-12-18 04:42:18
问题 Native method from dll works in java if the input parameter is array of bytes - byte[]. If we use the same method from c# it throws EntryPointNotFoundException. Is that because of byte[] in java and c# are different things? and if it's so how should I use native function from c#? 回答1: Java lacks the unsigned types. In particular, Java lacks a primitive type for an unsigned byte. The Java byte type is signed, while the C# byte is unsigned and sbyte is signed. 回答2: Is that because of byte[] in

What is the difference between managed and native resources when disposing? (.NET)

时光怂恿深爱的人放手 提交于 2019-12-17 22:27:18
问题 I was reading the MSDN article about how to implement IDisposable and I am uncertain about the difference between managed and native resources cited in the article. I have a class that must dispose 2 of its fields when it is disposed. Should I treat them as Managed (dispose only when disposing = true) or Native resources? 回答1: A managed resource is another managed type, which implements IDisposable . You need to call Dispose() on any other IDisposable type you use. Native resources are

Android 7 Native Crash: libc.so tgkill

半腔热情 提交于 2019-12-17 21:25:28
问题 I'm seeing this native crash with the following stack trace. This happens in Android 7.0 & 7.1 only. Nothing new has been added to the app, which has been in production for a few years, but with more devices being updated to Nougat this crash happens frequently now and is becoming a nuisance. Any advice would be appreciated. native: pc 000000000007a6c4 /system/lib64/libc.so (tgkill+8) native: pc 0000000000077920 /system/lib64/libc.so (pthread_kill+64) native: pc 000000000002538c /system/lib64

MSBuild: Custom.After.Microsoft.Common.targets for native C++ projects in VS2010

纵然是瞬间 提交于 2019-12-17 19:50:50
问题 I've read about the use of "Custom.Before.Microsoft.Common.targets" and "Custom.After.Microsoft.Common.targets" in order to execute a custom target before/after every project build and I would like to use this technique in order to change version info while building on our TeamCity build server. The problem is that although it works for C# projects, it doesn't seem to work for native C++ projects. After some digging around in the Microsoft.Cpp.targets file I found out that for native C++

Android Call Recording Incoming voice not getting recorded

末鹿安然 提交于 2019-12-17 17:34:23
问题 I'm working auto call recorder app, I'm able to record voice call on below android 6 using MediaRecorder.AudioSource.VOICE_CALL , From android 6 not able to record voice call using VOICE_CALL . I managed to record using MediaRecorder.AudioSource.MIC but here incoming voice not getting recorded and I want to record voice call in normal mode not in speaker on mode. Please help me on this. (I had tried on Xiomi Redmi 4a(android 6),not working). myRecorder.setAudioSource(MediaRecorder.AudioSource

Is it possible to share an enum declaration between C# and unmanaged C++?

感情迁移 提交于 2019-12-17 15:44:19
问题 Is there a way to share an enum definition between native (unmanaged) C++ and (managed) C#? I have the following enum used in completely unmanaged code: enum MyEnum { myVal1, myVal2 }; Our application sometimes uses a managed component. That C# component gets the enum item values as ints via a managed C++ interop dll (from the native dll). (The interop dll only loads if the C# component is needed.) The C# component has duplicated the enum definition: public enum MyEnum { myVal1, myVal2 }; Is

Converting .NET App to x86 native code

邮差的信 提交于 2019-12-17 15:41:20
问题 There's a program written entirely in C# that targets .NET Framework 2.0. Is there a way I could somehow compile (translate) managed EXE to a native one so it could be .NET-agnostic? I know there are probably commercial products for that purpose... but they are a bit expensive. The problem is that we are to deploy the program on computers running Windows XP with no .NET Framework installed. There's also a requirement that the program's size must not exceed 500Kb (1Mb maximum) for it is

HTML5: camera access

冷暖自知 提交于 2019-12-17 10:12:33
问题 I am quite new to HTML5 . I try the following HTML5 code to access camera on my mobile phone. It always display "Native web camera not supported" . It seems that my mobile browser (safari and android 2.1 web browser) does not support the camera. Could you please tell me which browser should I use to access to camera? <!doctype html> <html> <head> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, maximum-scale=1.0"> <style> body {width: 100%;} canvas {display: none;} <

Adding new paths for native libraries at runtime in Java

故事扮演 提交于 2019-12-17 06:45:34
问题 Is it possible to add a new path for native libraries at runtime ?. (Instead of starting Java with the property java.library.path), so a call to System.loadLibrary(nativeLibraryName) will include that path when trying to find nativeLibraryName . Is that possible or these paths are frozen once the JVM has started ? 回答1: [This solution don't work with Java 10+] It seems impossible without little hacking (i.e. accessing private fields of the ClassLoader class) This blog provide 2 ways of doing

Where to find source code for java.lang native methods? [closed]

旧时模样 提交于 2019-12-17 02:35:24
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I'm vaguely familiar with the JNI, and I'm curious to see my machine-specific implementation for some native methods in the java.lang package. Thread#currentThread() , for example. I've found a bunch of DLLs in [JDK_HOME]/jre/bin, but like I said I'm trying to find the source code. Does anyone know where the