Ok, quick question . . .
Is it possible to build (compile) an Android Native Extension (ANE) without using Flash Builder.
Im trying to build an extension within eclipse but anywhere i look it says to use Flash builder somewhere throughout the process. I dont have flash builder, only Flash CS6 and Eclipse. Is there a way to package and get a ANE file using only flash and eclipse?
Many Thanks
here's some documentation on how to package .SWFs into an ANE: http://help.adobe.com/en_US/air/extensions/WSf268776665d7970d-2482335412ffea65006-8000.html
as far as getting your .AS code to .SWFs and .SWCs, the mxlmc (for the .AS->.SWF) and compc (makes .SWCs) will both run outside of flash builder (and are found along with adt in the free to download flex sdk: http://www.adobe.com/devnet/flex/flex-sdk-download.html )
(.as, .jpg, .swc, etc) ==mxmlc==> (.swf)
(.as, .jpg, etc) ==compc==> (.swc)
(.swc, .swf) ==adt==> (ANE)
its not an answer but what I have to say will not fit into the comments box . . .
ok now im really lost and confused.
heres what iv done, I have created an android project within eclipse. within this project I have included the flashruntimeextensions.jar file and created all necessary files within the eclipse project(that im aware of)(a TorchExtension.java file which returns a new Context.java file, in which i use map.put("torchy", new TorchFunction()); and then obviously a torchFunction.java file which contains code to "turn torch on".
am I correct in thinking I need to export this as a SWC or ANE file, which I can then import to flash through the java build path?
or do I have to create some form of action-script library to talk between flash and native code? i have gone through countless pre existing ANEs but I have failed to get any working, I feel like im missing something important.
Related
A third party created a unity project for me but they lost their project on their end. A guy had it on his laptop, never backed it up but he did send the integrated unity project for android. The only issue is that we need to change something inside it. So I have the android project, I just need the built unity's source code.
The same situation occurred with our IOS version, luckily Xcode had the Assembly-Csharp accessible and I could find the value I needed to change. The Android's Unity was built with il2cpp. I've managed to re-secure the assets using some tools I've found online. So I can potentially rebuild the project with new scripts. However this may take a rather large amount of time. So I found I can edit the source code through the hex code, but this seems limited/nigh impossible as I need to make a condition on this string instead of simply setting the value. If there is a way to do this with a hex editor on the lib2cpp.so file I would greatly appreciate even a lead. Alternatively I have found some things on hooking a string, but I am unsure of how to go about this and cannot find sources of where to start such a thing.
Any leads or information on how to edit a string on a condition in the unity source code through it's lib2cpp.so file or libunity.so file would be greatly appreciated!
I'll try to make this simple :
If I create an AIR app from the Flash IDE, I can choose to embed folder in my package. Then I can load the files using 'app:/'+filename. Everything is ok.
I have to move to Flash Builder because I can't test workers in the IDE (thanks Adobe). My issue is that, if I test/debug from Flash Builder, it does a stream error when calling 'app:/'+filename. If I launch the test in the IDE from FB, it works but the Workers don't. I should mention, the reason I'm using this method is that I have so many graphical assets, it's just easier to maintain/update this way instead of using [Embed.. ] for all my items, and it just works in the IDE...
I've added my folder to my sources locations in Flash Builder, still it seems I cannot use the 'app:/' thing.
How can I make this work so I don't change my code and still use 'app:/'? FB is such a confusing program...
edit : I tested again the workers in the IDE build launched by FB (the test in flash IDE icon), I can trace its state with :
worker.start();
worker.addEventListener(Event.WORKER_STATE, this._handleWorkerState);
private function _handleWorkerState(__e:Event):void{
trace(__e.currentTarget.state);
}
traces 'new' then 'running'. But for some reason, it doesn't send or receive any data from any message channel, which, again, works in FB4.7 when i run a debug but doesn't find my files....
Error #2044: Unhandled ioError:. text=Error #2032: Stream Error. URL: app:/foldername..
So basically, I'm looking for a solution to at least one of my problems :)
EDIT :
So ok. Here it is, one issue was due to the wrong debugger version installed (for the workers part). So I can now work and compile in the IDE again. I haven't found an answer to why 'app:/' doesn't work from FB4.7. So that would be the remaining question.
One option since you have Flash IDE is to create a library with all of your images. Drop all your images into the library in Flash and export them for actionscript. Then publish and create a a SWC. Then you can use the swc, which is kind of like a zip file for display objects, in flashbuilder and access them like:
var mc:MovieClip = new imageExportedForAS3_1()
Create a top level folder in your flex project called for example images, copy all of your images into that folder, then every time you need to load an image, just use the source attribute and use the absoulte rute, for example.
<mx:Image source="#Embed(source='../images/pic.png')"
I have never used the app:/ sentence before! Good luck!
I'm trying to use the FTDI (d2xx) jar file in Delphi XE5 in a android app.
http://www.ftdichip.com/Drivers/D2XX.htm
But I cant get I to work..
Has anybody got any examples on how to import a (this) external jar file?
OR has done this jar file and got it working (so I know it is possible).
I have tried the methods from
XE5 - Fun with external Java libraries
Well I did't have fun, I can't get I to work (easy peasy?).
I don't know what class to load. I have got a assigned "DEXClassLoader" but don't know what class to load. If I look at the dex file I think it should be 'com/ftdi/j2xx/D2xxManager' but I get a "java.lang.classnotfoundException: com/ftdi/j2xx/D2xxManager" message.
The second option I found was the one from Bian long (coderage 8)
I am still investigating this but my demo licence of XE5 is running out.
(I also found the "Android 2 Delphi Import Tool". But i dont know if it works.
If it works I want to buy it. it's only 80 euro)
If I don't get It working we will not update to XE5 (but I want to..) and wait until there is more documentation / samples.
Can anyone help me..
About your second question
OR has done this jar file and got it working (so I know it is possible))
yes, it is possible. http://www.winsoft.sk/acpftdi.htm
They are selling a source for $60 and have a free demo.
And as an answer to the first question: it's really just an automatic conversion of jar file. I have tried a Java2OP utility from embarcadero and Winsoft's example with minor changes successfully compiled and executed using pas-file generated by Java2OP.exe instead of their library.
So, if someone want to use FTDI with delphi on android, my way of getting it works for free is:
Get Java2OP.exe from http://docwiki.embarcadero.com/RADStudio/XE7/en/Java2OP.exe,_the_Native_Bridge_File_Generator_for_Android (you need a registered delphi to download)
run it:
Java2OP.exe -jar d2xx.jar
After completion, add d2xx.jar and generated pas file to your project, take the example code from http://www.winsoft.sk/acpftdi.htm or from java examples that comes with d2xx.jar.
I would like to use the facedetection in opencv cpp to use it in an android app. I have compiled jni successfully. But I wonder how would i use the haarcascades. I can store in sdcard and read it from there. Is there any other way i can use the xml files directly from the project?
There is a c++ example called facedetect coming with the opencv superpack. I'm running OpenCV-2.3.1 myself and it's located in this folder: ../opencv-2.3.1/samples/c/
The sample uses haarcascades and this might be your best bet for facedetection. If you can use the Android NDK with proper JNI calls from a .cpp file then you shouldn't have any problems to use this sample.
I'm working on a similar thing myself but haven't tried it myself yet. Should be implementing the thing somewhere next week but can't guarantee it. Let me know if this works out for you
I want to change some functionality in the WebView control, is there any way to change the source of the sdk. knowing that I got the source code android.jar and I attach it to eclipse for debugging but I can't edit it.
What about extending WebView via inheretance and implementing functionality in subclass? Editing android sources is unlikely a best practices :)
is there any way to change the source of the sdk.
There is no "source of the sdk".
The source code is called an "operating system". It runs as firmware on a device. You can change this code and create replacement firmware which you can load on a device.
Take a look at the git-hub phonegap source files - https://github.com/phonegap/phonegap-android
You can download the source, edit them however you like and then make a jar file.