I've been working with the vibration example from Adobe for Air 3.0's native extensions on Android.
I have the ANE compiled and the .apk packaged.
The problem I'm having is the actionscript library is getting a null ExtensionContext.
I tried creating the .apk with adt -package -target apk-debug so that I can see the actionscript traces in logcat and that's where I'm finding the null error.
extContext = ExtensionContext.createExtensionContext("com.adobe.Vibration", null);
extContext is null and crashes on the following .call() method.
All of the source is stock from the examples, I haven't changed anything.
Does anyone have any experience with getting one of Adobe's ANE examples working on a windows machine? Most of the examples are for Mac.
Good lord. What a waste of a week.
I was using a tutorial from gotoandlearn.com that was telling me to, in by build script, use a jar command to put my native extension in to a jar.
I simply used the .jar that's automatically built in the NativeAndroid/bin/ folder and all is well.
It turns out, that tutorial is out dated and not really useful for the build anymore.
One additional comment. You need to set target platform and checkbox Is Library from Properties -> Android to get compiled jar in bin folder.
P.S. .sh from gotoandlearn can be executed in Powershell in Windows with minor changes for running bat files: ( cmd "/c adt.bat" )
I'm having the exact same problem on a Native Extension I'm writing, and have open sourced. I started this project with tutorial code from Adobe DevNet. I've found examples of this specific issue I've tried to follow exactly, and have had no luck with it yet. I've identified it to be a sandbox allow-domain problem.
Here's my line of code:
_aneContext = ExtensionContext.createExtensionContext("com.adobe.sampleasextension", "");
Here is a link to the code in my GitHub project:
https://github.com/interactivenyc/ANESampleProject/blob/master/TEST_AndroidAIR/src/ANESampleTest.as
Here is my compiler error:
SecurityError: Error #3207: Application-sandbox content cannot access this feature.
at flash.system::Security$/allowDomain()
at com.adobe.sampleasextension::SampleASExtension()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/ANESampleSWC/src/com/adobe/sampleasextension/SampleASExtension.as:14]
at ANESampleTest/initializeANE()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:198]
at ANESampleTest/onAddedToStage()[/Users/stevewarren/Clients/Speakaboos/git_repositories/ANESampleProject/TEST_AndroidAIR/src/ANESampleTest.as:131]
at runtime::ContentPlayer/loadInitialContent()
at runtime::ContentPlayer/playRawContent()
at runtime::ContentPlayer/playContent()
at runtime::AppRunner/run()
at AppEntryCommon/run()
at global/runtime::AndroidMobileDeviceAppEntry()
Related
I'm'trying to use the pjsip lib for android, after reading some sites talking about the topic I still wondering how to use it.
Many examples suggest to start it building the apjsua folder in the downloaded package but I cannot find it in /pjproject-2.1.0/pjsip-apps/src/
I have all the other sources put not apjsua, does this folder have another name since the new version?
Thanks for your reply.
PJSIP has not yet released there Android version, it is only for testing purposes.
You can find the PJSIP projest for android in branches. Here is the link : http://svn.pjsip.org/repos/pjproject/branches/projects/android/
So I would suggest you to download the whole pjproject.
You can find the apjsua in pjproject/branches/projects/android/pjsip-apps/src/apjsua
In some versions its name is apjsua and in other versions its pjsua.
Checkout code from below link:
http://svn.pjsip.org/repos/pjproject/trunk
After checkout and building it with given commands on PJSIP getting started page, you will find it in following path:
PJSIP_DIR/pjsip_apps/src/pjsua/android/
For confirmation, you can check it by browsing code on following link:
http://trac.pjsip.org/repos/browser
First, I already read 3 or 4 tutorials, 20 related questions on stack overflow, I am desperate, nothing seems to work...
I run on mac os x, on eclipse juno, ndk-r8
I try to debug an application (.apk) that use a library (.jar), that use many native library (.so).
My 2 AndroidManifest.xml contains debuggable=true, i compile the .so with "ndk-build NDK_DEBUG=1"
but when i call "ndk-gdb", on the application directory, I get:
"ERROR: Could not find gdbserver binary under ./libs/none"
(which seems normal)
and in the library directory, i get:
"ERROR: Non-debuggable application installed on the target device."
(which is false)
when my program crash with a segv, if I use addr2line or ndk-stack, both says that my address is incorrect.
does anyone as an idea why gdb cannot attach to my process ? or have a workaround to do this ?
As I said earlier in comments:
ndk-gdb cannot attach to a process where the jni is inside an android library project.
As a workaround, you can put a mock main entry point in the library,
to transform it into a executable project, to execute it in debug mode.
I am currently developping an android application based on OCR (Optical Character Recognition). I've downloaded the "tesseract- android" project that contains tools for compiling the Tesseract, Leptonica, and JPEG libraries for use on Android. I am developping via Eclipse on Windows Vista OS.
I've also downloaded the necessary tools (android-ndk;apache ant..), and I've done carefully all the steps to build this project and add it as a library to my basic application.
My app consists of opening the camera for taking a picture and then processing this picture via tesseract API in order to transform it into text.
My question is:
1. Is it true that this procedure doesn't work under Windows OS?
2. When compiling, I am having the following error:
"java.lang.IllegalArgumentException: Data path must contain subfolder tessdata!"
What could be the potential error? The concerned portion of the java code is:
File myDir = getExternalFilesDir(Environment.MEDIA_MOUNTED);
TessBaseAPI baseApi = new TessBaseAPI();
baseApi.init(myDir, "eng");
I've also tried to use "/tess-two/external/tesseract-3.01/tessdata/tessconfigs" instead of "myDir", but the error remains the same.
I would highly appreciate any help.
Thanks in advance.
Q1. It should work on any operating system, I've been able to ndk-build on Win7, Mac OS Lion, and Ubuntu without any issues.
Q2. Make sure that you have permissions to write to the external storage, and have sufficient space to do so.
If that still fails, have a look at the DDMS and see the file explorer and double check your application is setting up the directory structure and copying over the traineddata.
I had an odd issue where it was creating the eng.traineddata file, but it was 0 bytes which led to all sorts of odd issues.
You could also create the directory structure manually to get you progressing, and fix this initialisation issue later on (but don't forget it!)
I was facing the same problem. Worked for me when I removed "tessdata" from the path.
Before (fail): path = "/mnt/sdcard/tesseract/tessdata";
After (success): path = "/mnt/sdcard/tesseract/";
Then, baseApi.init(path, "eng") worked with no exceptions.
Of course, tessdata folder should be in the path with the desired.traineddata file.
Path errors while compiling native stuff usually is not related with your java code. Your java code would be responsible for runtime problems. Check your build scripts and post more log messages.
First of all, I would like to mention my requirements:
I have been working on an ANDROID Application since a couple of months. I need the code of OCR (Optical Character Recognition) in order to link that to my app through CYGWIN, JNI, NDK. I found that TESSERACT OCR is the only open source code available. I have downloaded the code of Tesseract OCR-3.00 from the following link:
http://code.google.com/p/tesseract-ocr/wiki/ReadMe
I successfully compiled the code in CYGWIN environment as per the steps mentioned in the "INSTALL" file present in the downloaded file. Finally all the MAKE files are generated. In order to use this code in my app, I need the ".so" file, which will be generated through CYGWIN..
Now, the problem am facing is:
I have imported the complete code Tesseract OCR into my Android app code in ECLIPSE as per the steps mentioned in the following link:
http://mindtherobot.com/blog/452/android-beginners-ndk-setup-step-by-step/
I had followed the procedure as mentioned in the above link..but importing the code of TESSERACT OCR is as tough as a hell when compared to the example given in the above link.
The final step where the ".so" is to be created is not working in the case of OCR..The error as shown in the following image![enter image description here][1]
SUGGESTIONS:
Plz suggest me the clear explaination on how to proceed with the next steps....plz plz..someone, plz do take some time to give clear explaination..
Thanks & Regards
when I tried working with Tesseract, I was not able to get it working with Windows and Cygwin. Even I used the same references as you did. Then after I tried compiling the 'tesseract-android-tools'. And it was not working either. After that I used a MAC with the native C environment for compilation and it worked. Maybe you Google after 'tesseract-android-tools' and you'll get a lot of help.
Hope it helps a bit for further progress.
Regards
I am trying to build the bitmap-plasma sample that is included with the ndk, but getting an error. I run ndk-build from the samples/bitmap-plasma directory, and the error it displays is that it cannnot locate android/bitmap.h file.
How do i direct the ndk-build script to the file it needs?
Using android-ndk-r4 on Ubuntu Lucid 10.04
Well it's working now, so in case anyone was having my same problem:
There as an android-ndk-r4b bugfix release today, which it seems no longer has this problem.
Available to download here.
http://developer.android.com/sdk/ndk/index.html
With Ubuntu 10.04 and NDK r5b, I have just posted a bug report (with the fix included) for build_platforms.sh. See http://code.google.com/p/android/issues/detail?id=15180 for details. Essentially, the local declarations in the symlink routine must be amended. Otherwise, it only links the first file (alphabetically) from each directory, and truncates the remainder from the list.
Correcting this allowed the symbolic links to be fully populated, thereby filling in the missing header files and libraries and allowing the samples to build successfully.