Questions tagged [native-methods]

115 questions
107
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
  • 37,175
  • 18
  • 99
  • 146
63
votes
12 answers

Making a short alias for document.querySelectorAll

I'm running document.querySelectorAll() frequently, and would like a short alias for it. var queryAll = document.querySelectorAll queryAll('body') TypeError: Illegal invocation Doesn't work. Whereas: document.querySelectorAll('body') Still does.…
mikemaccana
  • 110,530
  • 99
  • 389
  • 494
12
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,443
  • 7
  • 47
  • 70
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,775
  • 3
  • 28
  • 40
9
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,485
  • 3
  • 35
  • 61
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
2 answers

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
  • 110,530
  • 99
  • 389
  • 494
9
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
  • 110,530
  • 99
  • 389
  • 494
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,612
  • 3
  • 42
  • 62
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
  • 5,286
  • 1
  • 49
  • 59
7
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,891
  • 5
  • 38
  • 42
7
votes
2 answers

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
  • 23,602
  • 63
  • 219
  • 412
6
votes
3 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
  • 11,548
  • 24
  • 76
  • 113
5
votes
2 answers

How to retrieve the file previews used by windows explorer in Windows vista and seven?

I am developing a Delphi documents management application, so somehow I am giving the user some functionality similar to windows explorer. I would like to know if there is a way to get the preview used by windows explorer. For example windows…
UnDiUdin
  • 14,924
  • 39
  • 151
  • 249
1
2 3 4 5 6 7 8