Questions tagged [native-methods]

110 questions
102
votes
9 answers

How to import a class from default package

Possible Duplicate: How to access java-classes in the default-package? I am using Eclipse 3.5 and I have created a project with some package structure along with the default package. I have one class in default package - Calculations.java and I…
Michał Ziober
  • 31,576
  • 17
  • 81
  • 124
53
votes
10 answers

Making a short alias for document.querySelectorAll

I'm going to be running document.querySelectorAll() a whole lot, and would like a shorthand alias for it. var queryAll = document.querySelectorAll queryAll('body') TypeError: Illegal invocation Doesn't work.…
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
10
votes
3 answers

android mupdf libmupdf.so runtime error "No implementation found for native openFile"

I just finished compiling mupdf from mupdf.com on my mac. Took some time to figure it out but now I have a libmupdf.so in my libs/armeabi folder. They provide an example of this class called MuPDFCore.java which is viewable…
10
votes
4 answers

Is the class NativeMethods handled specially in .NET?

https://msdn.microsoft.com/en-us/library/ms182161.aspx Are the three classes described on this paged handled specially in the .NET Framework? (NativeMethods, SafeNativeMethods and UnsafeNativeMethods) The reason I'm asking is I'm wondering if it is…
Bryan
  • 2,710
  • 3
  • 25
  • 40
10
votes
2 answers

Mockito - mocking classes with native methods

I have simple test case: @Test public void test() throws Exception{ TableElement table = mock(TableElement.class); table.insertRow(0); } Where TableElement is GWT class with method insertRow defined as: public final native…
Piotr Sobczyk
  • 6,015
  • 6
  • 42
  • 65
9
votes
2 answers

How can I implement horizontal swipe not using the support library?

If I do not need to grant support for older versions of android and can just use API 17, is there an alternative way to implement the much advertised horizontal swipe (like in gmail) and not use viewpager, fragmentsactivities (new APIs already have…
9
votes
1 answer

jsdom - document.querySelector enabled, but is missing from document

I would like to use JSDom to perform some server-wise DOM manipulation. However, despite explcitly enabling querySelector, it is undefined in the documents created: var jsdom = require('jsdom'); // Yep, we've got QuerySelector turned…
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
9
votes
1 answer

Is it possible to override a native method in a Java class in Android/dalvik?

I am unit testing a class TestMe using EasyMock, and one of its methods (say method(N n)) expects a parameter of type N which has a native method (say nativeMethod()). class TestMe { void method(N n) { // Do stuff …
scorpiodawg
  • 5,202
  • 3
  • 38
  • 52
8
votes
3 answers

Javascript native sort method code

Any idea how I can view the implementation of native javascript methods specifically the sort method. The reason why I am looking for this I am just wondering what the algorithm used is and what is the complexity of the same. I am sorting a huge…
Baz1nga
  • 15,010
  • 3
  • 31
  • 59
8
votes
1 answer

Android Matrix multiplyMM in detail

I've been wondering if anyone has some knowledge about android.opengl.Matrix.multiplyMM that they could share. . Reason for asking is, when learning through OpenGL ES, the method is widely used for all sorts of calculations. However, there is the…
Voy
  • 2,938
  • 1
  • 30
  • 43
7
votes
1 answer

Mockito throwing UnfinishedVerificationException (probably related to native method call)

I have the following exception when I run a test case: org.mockito.exceptions.misusing.UnfinishedVerificationException: Missing method call for verify(mock) here: -> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) Example of correct…
balteo
  • 20,469
  • 52
  • 196
  • 362
7
votes
4 answers

Check element against querySelector? (using native methods, not JQuery)

I have an Element. I would like to check whether it meets a particular query, eg ('.someclass') in the same kind of style as querySelector. This isn't as easy as it sounds. Element.querySelectorAll and Element.querySelector only work on descendents…
mikemaccana
  • 81,787
  • 73
  • 317
  • 396
5
votes
2 answers

MarshalAs attribute case study

When should we use this attribute and why do we need it? For example, if the native function in c takes as a parameter a pointer to unsigned char, and I know that it's needed to fulfill the array of unsigned chars, why can't I use array of bytes in…
Sergey
  • 10,544
  • 23
  • 70
  • 110
5
votes
5 answers

Multiple threads stuck in native calls (Java)

I have a problem with an application running on Fedora Core 6 with JDK 1.5.0_08. After some amount of uptime (usually some days) threads begin getting stuck in native methods. The threads are locked in something like this: "pool-2-thread-2571"…
David Resnick
  • 4,560
  • 4
  • 36
  • 41
5
votes
3 answers

Android - How to enable CheckJni for NDK development?

Can someone please tell me if I'm missing something here? I am trying the following commands in shell. $ ./adb shell stop $ ./adb shell setprop dalvik.vm.checkjni true $ ./adb shell start But Logcat always shows "CheckJNI is OFF" when I install…
1
2 3 4 5 6 7 8