native-code

Invalid indirect reference on NewObject call

坚强是说给别人听的谎言 提交于 2019-12-10 03:56:17
问题 OK, so I have the native code below. I'm trying to return an array of FilePermissionInfo from it, populated with some data returned by stat(). The problem is that I get the following error when NewObject is called the first time: 06-15 20:25:17.621: W/dalvikvm(2287): Invalid indirect reference 0x40005820 in decodeIndirectRef 06-15 20:25:17.621: E/dalvikvm(2287): VM aborting It's odd, because the only reference object I have is the jclass (for FilePermissionInfo) and I turn it to a global

Ghost4J native library to convert pdf to image

删除回忆录丶 提交于 2019-12-08 13:35:11
问题 I am using Ghost4J Native library 32bit and 64bit dll files to convert my PDF to images. I need to use it with ThreadPoolExecutor i.e. multithreaded, but since its native, it crashes my JBoss too often. After I synchronize the use of this library, The threads do not perform well. i.e. with 4 threads, and with 8 threads, its no difference in performance. Is there any safe way of doing this? 回答1: Have you tried what the ghost4j people recommend for multi-threading: Multi-threading Making sure

Android - Java Stack vs Native Stack

醉酒当歌 提交于 2019-12-08 03:47:20
问题 In Android, when I inspect application memory using adb shell dumpsys meminfo , I observe separate Java and native heaps, but only 1 entry for stack. Pss Private Private Swapped Heap Heap Heap Total Dirty Clean Dirty Size Alloc Free ------ ------ ------ ------ ------ ------ ------ Native Heap 4516 4480 0 1848 11520 7412 4107 Dalvik Heap 9726 9668 0 12924 33436 28477 4959 Dalvik Other 1417 1416 0 28 Stack 288 288 0 0 I want to ask whether in Android, when a java class uses native code via JNI,

Creating Hidden File with Flex/AIR on Win

痴心易碎 提交于 2019-12-07 15:28:52
问题 how can I create a hidden file on my Win filesystem? I've read you should use native code and I know AS3 has got NaviteProcess class but I really don't know how to use it and I don't manage to find much about it. Is there anyone who knows how to do it? Thank you in advance! 回答1: Cleaned up to better reflect where we are and will keep it updated: Based on info from: http://deepanjandas.wordpress.com/2010/09/10/writing-executing-cmd-scripts-through-air/ private var applicationDirectory:File;

Is it possible to get Android.mk or native source file from .apk file?

旧时模样 提交于 2019-12-07 14:18:09
问题 It seems that it is quite easy to get Java source files from .apk file. But is it possible to get Android.mk or native source file from .apk file, by tools or tricky methods? I am doing research on Android app native code security so that these files are quite important for me. Thanks. 回答1: You cannot get Android.mk from an apk, it's only needed for building, as such, it's not stored in there (unless the programmer put it in the res/ folder or something like that). All of the native code for

How to run assembly code without creating a new process?

走远了吗. 提交于 2019-12-07 12:10:18
问题 The file contains the native assembly code, and I want to run it in the current process. But I don't want to create a real file (.com or .exe), so I tried: ... using namespace std; typedef void bitcode(); void testcode(){ cout<<"test"; }; int main() { bitcode *c=&testcode; // bitcode *c stands for the file containing the assembly code. bitcode *d=reinterpret_cast<bitcode*> (malloc(20)); memcpy(d, c, 20); d(); // it doesn't work return 0; }; However, it doesn't work when I invoke d();. I want

Gifflen Fatal Signal 11

北城以北 提交于 2019-12-07 05:29:19
问题 I'm trying to use some Native Code to create Gifs. I draw the images using paint, creating a few strokes, click save and the image drawn gets saved to a JPG format. when I click create Gif it takes all the images and starts creating a gif. This is when I get a Fatal Signal 11 and the app restarts. I use native code so I have a backtrace of the crash: I/DEBUG(95): backtrace: I/DEBUG(95): #00 pc 00002a04 /lib/libgifflen.so (NeuQuant::learn()+239) I/DEBUG(95): #01 pc 00002b9d /lib/libgifflen.so

Android NDK Native LIB, What to do about existing stdio?

守給你的承諾、 提交于 2019-12-06 10:00:31
问题 I have existing native C/C++ code that I am currently building into a native lib and Android app via the NDK. The native code is riddled with print statements to stdout and stderr. Is there a best practice for something like this? Can I just ignore them or do I need to go through and redirect them to the Android logging system? I built the existing code as a standalone native binary and ran it via adb and I was seeing all the output from printf (to stdout) to the console. Seems like a goofy

Android - Java Stack vs Native Stack

匆匆过客 提交于 2019-12-06 09:28:45
In Android, when I inspect application memory using adb shell dumpsys meminfo , I observe separate Java and native heaps, but only 1 entry for stack. Pss Private Private Swapped Heap Heap Heap Total Dirty Clean Dirty Size Alloc Free ------ ------ ------ ------ ------ ------ ------ Native Heap 4516 4480 0 1848 11520 7412 4107 Dalvik Heap 9726 9668 0 12924 33436 28477 4959 Dalvik Other 1417 1416 0 28 Stack 288 288 0 0 I want to ask whether in Android, when a java class uses native code via JNI, is the native stack allocated in contiguous memory location from the java stack, or are they non

Can I create a Bitmap that uses malloced buffer I created in native code?

余生长醉 提交于 2019-12-06 07:49:24
问题 I have a piece of native code where I am mallocing (i.e. allocating) a buffer. I like to draw into this memory using Canvas draw operations. But Canvas code uses Bitmap as its backing plane. I am wondering if there is a way to wrap native block of memory with Android Bitmap. Thanks Videoguy 回答1: You can pass a Buffer from JAVA, fill it in Native code and then render it using Canvas. Done, works perfectly. edited to add an example: warning, Java bloat ahead /* * Copyright (C) 2009 The Android