FAQ Database Discussion Community


use Pointer address in Java using Bridj and JNAerator

java,c,native,jna,jnaerator
I have this code in C and I would like to write the same in Java: static u_int32_t print_pkt (struct nfq_data *tb){ unsigned char *data; ret = nfq_get_payload(tb, &data); if (ret >= 0) printf("payload_len=%d ", ret); printf("data: "); for(i=0;i<ret;i++){ printf("%c",data[i]); } fputc('\n', stdout); return ret; } I used JNAerator to...

How do I understand and fix error while compiling Linux kernel for embedded system

c,linux-kernel,make,arm,native
While trying to compile the following file: /* * linux/arch/arm/mm/proc-syms.c * * Copyright (C) 2000-2002 Russell King * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as * published by the Free Software...

Difference Native and Non-Native iOS apps

ios,native,hybrid-mobile-app
I am not really sure if this is the right place to ask, if it isn't, I am sorry. I am researching different apps in the same category, and I am trying to figure out how many of them are Native or Non-Native(Hybrid?) apps. Is there any way I can...

Why doesn't java's -verbose:class argument include jre inherent native classes?

java,class,jvm,classloader,native
When I use the VM argument "-verbose:class", it shows all classes that are being loaded except for those that are both inherent to java and declared natively, like primitives or arrays (can't think of anything else though, are there?). Despite using the following line of code within a main method,...

Android Bitmap - What is nativeBitmap?

android,bitmap,native
So I was looking in the source code of the bitmap class and I saw this: public final long mNativeBitmap; What is the native bitmap long? It surely can't be the actual bitmap because a long is 64-bit (8 bytes) which can't handle a bitmap bigger than 2 pixels (supposing...

What's the best practice when populating a sqlite database with default data?

java,android,database,sqlite,native
I'm making an app that will be using few hundred database posts from a sqlite database. I will not be adding new data during the lifetime of the app (unless I update the whole app). I might end up using a static xml for the data, but I need to...

Updating AIR application with embedded runtime?

actionscript-3,flash,air,native
I'm writing a AIR application with an embedded runtime (.app) and am having trouble finding a way to update it. I need to somehow download a new .app off a server and overwrite the existing file, and promptly restart the application. I'm clueless on how I'd achieve this. Any ideas?...

does NewDirectByteBuffer create a copy in native code

java,c++,jni,native
I am creating two arrays in c++ which will be read in java side: env->NewDirectByteBuffer env->NewByteArray does those functions copy the buffer I send it? Do I need to create the buffer on the heap in the c++ side or is it ok to create it on the stack because...

C# native Image template match (FIXED)

c#,performance,image-processing,native,template-matching
UPDATED - SOLVED LOCKING BIT HERE IS THE NEW CODE public Task<Point[]> MatchImage(Bitmap orig, Bitmap template, int limit = 30) { Task<Point[]> tsk = new Task<Point[]>(() => { BitmapData lockedOrig = orig.LockBits( new Rectangle(0, 0, orig.Width, orig.Height), ImageLockMode.ReadOnly, PixelFormat.Format24bppRgb); //bloqueando a leitura da memoria em que a imagem nova sera...

Mobile - Codename - How can it be faster than native language?

java,ios,objective-c,mobile,native
Context : Starting to write a mobile application for android and ios. Looking at many alternatives. Can't stand the html5/webview thing. Most of the times it is sluggish. I tried many demo apps (phonegap/steroid..) and didn't feel at home. Not smooth enough. More, some games are coming : so no...

Build native 64bit and 32bit exe with JXCore

node.js,native,jxcore
I'm looking for a way to builn a native 32bit exe on my 64bit developing machine. Usually I would run: jx compile .\PhotoFly.jxp But that produces a 64bit version. Any ideas how to get the 32bit version?...

How to change windows desktop background

java,windows,native
I realise that there are other questions on this topic, all of which I have attempted to implement the answers of and failed. I would like to end up with a full blown answer, ideally with a demonstration, on how to, in Windows and only Windows set the desktop background...

Android NDK OpenCV - No implementation found for native

android,c++,opencv,android-ndk,native
can you help me handle my errors? I have read a lot of tips how to fix them but nothing helped me. I also know that there are similar question already asked but they didnt help me. So I give a chance to ask you: I am trying to make...

C++ error C2440 when getting native pointer

c++,pointers,native,local,command-line-interface
Haven't write C++ code for long, and what I am trying to do is very simple. I'd like to create a local instance of a native class. Then pass a point to that class to another method. The code is as following: someclass instance(); someclass* pInstance = &instance; I am...

C# / C++ Asynchronous reverse pinvoke?

c++,c,asynchronous,pinvoke,native
I need to call C# code from a native C/C++ .dll asynchronously. While searching how to do I found that I could create a C# delegate and get a function pointer from it, which I would use inside my native code. The problem is that my native code needs to...

Compiling java source code to native exe

java,c++,object,native
Is it possible to compile java source code into native exe like C++? Like C++ all headers files are included during compilation, all java library files that are required should be attached in that exe, and this exe should not be a bytecode but native exe instead and run without...

Best option for converting a JSP website to Android app?

android,cordova,webkit,native,hybrid-mobile-app
I have set up a JSP website on a Tomcat 6.0 server. Now I want to create an Android app to fetch the web's data and view it on the phone. I have considered three possible plans for this: Rewrite the website into WAP version and use a Webview to...

Multiple dependent native projects in visual studio

c++,visual-studio-2012,native,project-management
Visual studio doesn't support native projects as it supports .NET projects. In the sense that when for example creating a static(.lib) library. Including of the static library, and the directory containing the headers, has to be done manually. For one project this isn't some much of a problem. But if...

Sliding accordion with pure JS and for loop

javascript,css,css3,accordion,native
I've written a for loop, which should run through all accordions and their children, but I can't figure out why it's only working on the first object. Fiddle Example for ( var i = 0, accordion = document.getElementsByClassName('accordion'); i < accordion.length; i++ ) { var accordion_section = accordion[i].children[i], accordion_key =...

Should if(a&&b) take more time than if(a) if(b)?

java,c#,native
I used the following simple logic to answer a question like this one: 1: if(a) // 1 operation 2: if (b) // 1 operation and 1: if(a && b) // 1, 1(&&), 1 => 3 operations. So, 2 operations versus 3, but in the first example the compiler needs to...

How to free memory allocated by native method on Java side?

java,c++,memory-leaks,jni,native
I am trying to pass a byte array (with random data) from native to Java and I am not sure if this causes any memory leak or not. Here's the C++ code. JNIEXPORT jbyteArray JNICALL Java_com_sample_test_jni_TestJNI_return_1byte_1array (JNIEnv *env, jobject obj) { unsigned char *byteArray = new unsigned char[LENGTH]; srand(12345); for(int...

Simple convert C++/CLI int^ to unmanaged int*

c++-cli,native,managed
This is so basic it should be easy to find. In my searches all I get is more complex solutions. Converting strings, marshaling, pinning objects. How do you simply convert from a c++/CLI int^ pointer to a native int* in C++/CLI. The body of my function is void Open(int ^Hndl)...

I receive error message when run JNI android app A/libc﹕ Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 17729

java,android,c++,jni,native
I got an error when i run android app that I use JNI functions and c++ code in it. When it run, I got below message: Fatal signal 11 (SIGSEGV) at 0xe480001d (code=1), thread 5465 And finally here is my codes: JNIEXPORT jstring JNICALL Java_ir_bassir_ndktest4_MainActivity_getName (JNIEnv *env, jobject obj){ jclass...

How can i call java methods from objective-c?

java,objective-c,native
I am developing an objective-c program that will call java methods to do networking because objective-c networking is very hard. I need objective-c to call java methods to do networking. However, the objective-c part has the main method, not java, so i wont have access to the JNI stuff. How...

Android emulator native player on Eclipse

android,eclipse,native,music,player
So i am working on something that tracks what im playing on native music player. Only problem is, that emulator doesn't seem to have any music on it. I'm using Eclipse for my project and i couldn't find answer anywhere. So, is there any way to get music in there?

iOS - Return to Safari from Native App without Opening New Tab

ios,tabs,safari,native
I am having trouble figuring out how to switch to Safari from a native app in iOS 7+. I've used UIApplication.sharedApplication.openURL(), but that opens a new tab. I would like to return the user to the current page he/she was viewing before without opening a new tab. I found this...

Gradle C/Native Plugin: Directory Structure, Platforms and Flavors

c,gradle,native
I have a simple C program (helloworld) compiling and building on my Windows 7 machine (via MinGW) using Make. I would now like to switch my build system to use Gradle (personal reasons, no disrespect to Make!) and am trying to wrap my brain around the Gradle Native Plugins (and...

Network connectivity check in blackberry cascades 10

c++,networking,blackberry,native,blackberry-cascades
I'm trying to perform a network connectivity check whenever user opens the app or whenever app comes in foreground. Below is the sample code void ApplicationUI::onFullscreen() { qDebug()<<"Application has entered foreground"; QNetworkConfigurationManager mgr; QList<QNetworkConfiguration> activeConfigs = mgr.allConfigurations(QNetworkConfiguration::Active); if (activeConfigs.count() > 0) { qDebug()<<"Has Internet connection"; } else { qDebug()<<"No Internet...

Unsatisfied Link Error: native method not found : kdu_jni

java,android,native
I imported kdu_jni.jar file as an external jar. That library is coded native. When i using JAVA Project, it works but Android does not accept this' s methods. package com.jp2.pathology; import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; import kdu_jni.Jp2_threadsafe_family_src; import com.jp2.view.jpip.JPIPResponse; import com.jp2.view.jpip.JPIPSocket; import com.jp2.view.kakadu.JHV_KduException; import com.jp2.view.kakadu.JHV_Kdu_cache; import android.app.Activity;...

Xamarin Unified API: Native library binding: NSUInteger vs. enum

ios,binding,enums,xamarin,native
I am binding to a native Objective-C library with the help of a Binding Project in Xamarin. Everything works fine. Now I migrated my solution to the Xamarin Unified API and to 32 AND 64 bit and after a lot of work, it works OK again. Although everything is working,...

mongodb - capped collections with nodejs

javascript,node.js,mongodb,native,capped-collections
I'm trying to set up and update some capped collections in MongoDB using Node.js (using the native MongoDB driver). My goal is to, upon running app.js, insert documents into a capped collection, and also to update existing documents in a capped collection. Both of these are running on setInterval(), so...

Getting Access on the Android VideoView received packets when Streaming a URL

java,android,video-streaming,native,videoview
Does the native code of the VideoView give access to the received packets of the video before or after decoding it? I need to access these packets in order to transmit them to another device. The initial solution is to modify the Android native code. Other possible solutions that I...

APK size exceed 50MB due to large amount of native libraries

java,android,jni,apk,native
Our app supports 7 different architectures. We have a native library which we are using in our java code. When we build a single APK its size reach the 50MB limit because we have 7 instances of the native library packed into the APK. Each instance of the library after...

Test for std::thread native handle implementation

multithreading,c++11,pthreads,native,handle
With std::thread::native_handle(), I can get the underlying pthreads handle in my implementation (mingw-w64 with pthreads) But is there a way to check during preprocessing if the implementation is actually using native pthreads or something else (win32 threads, etc...) ? I would like to make a code as portable as possible,...