I have a problem when I add an ANE (that I built by myself) to a Flex mobile project.
The problem is that the size of the objects are different than before I add the ANE. I've never used this ANE, I've only added it.
Here is an image before I add the ANE:
And an image after I add the ANE:
As you can see, the size of whole app are different. Do you know which can be the problem?
Thanks in advance
** Update info **
Code on ios:
#import "FlashRuntimeExtensions.h"
FREContext eventContext;
FREObject init(FREContext ctx, void* funcData, uint32_t argc, FREObject argv[])
{
eventContext = ctx;
NSLog(@"init");
return NULL;
}
void CameraExtContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx, uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet)
{
NSLog(@"camera ext context initializer");
*numFunctionsToTest = 1;
FRENamedFunction* func = (FRENamedFunction*) malloc(sizeof(FRENamedFunction) * *numFunctionsToTest);
func[0].name = (const uint8_t*) "init";
func[0].functionData = NULL;
func[0].function = &init;
*functionsToSet = func;
}
void CameraExtensionUniversalInitializer(void** extDataToSet, FREContextInitializer* ctxInitializerToSet, FREContextFinalizer* ctxFinalizerToSet)
{
NSLog(@"Camera extension initializer");
*extDataToSet = NULL;
*ctxInitializerToSet = &CameraExtContextInitializer;
}
Code of library in AS:
package com.xxx.Controller
{
import flash.events.EventDispatcher;
import flash.events.IEventDispatcher;
import flash.events.StatusEvent;
import flash.external.ExtensionContext;
public class ReaderDeviceExtensionController extends EventDispatcher
{
private static var _instance:ReaderDeviceExtensionController;
private var extContext:ExtensionContext;
public function ReaderDeviceExtensionController(enforcer:SingletonEnforcer)
{
super();
extContext = ExtensionContext.createExtensionContext( "com.xxx.Controller", "" );
if ( !extContext ) {
throw new Error( "Reader device native extension is not supported on this platform." );
}
}
public static function get instance():ReaderDeviceExtensionController {
if ( !_instance ) {
_instance = new ReaderDeviceExtensionController( new SingletonEnforcer() );
_instance.init();
}
return _instance;
}
public function dispose():void {
extContext.dispose();
}
private function init():void {
extContext.call( "init" );
}
}
}
class SingletonEnforcer {
}
Extension.xml:
<extension xmlns="http://ns.adobe.com/air/extension/3.1">
<id>com.xxx.Controller</id>
<versionNumber>0.0.1</versionNumber>
<platforms>
<platform name="iPhone-ARM">
<applicationDeployment>
<nativeLibrary>libTestSimpleAne.a</nativeLibrary>
<initializer>CameraExtensionUniversalInitializer</initializer>
</applicationDeployment>
</platform>
</platforms>
</extension>
I build the ANE with the following ADT command:
adt -package -target ane MWCameraNativeExtension.ane extension.xml -swc NativeDevicePluginForCamera.swc -platform iPhone-ARM -C ios .
Code of my application in Flex:
<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark" title="HTMLMainContent">
<fx:Declarations>
<!-- Place non-visual elements (e.g., services, value objects) here -->
</fx:Declarations>
<s:Label x="346" y="290" fontSize="16" paddingLeft="20" text="HI HI HI"/>
</s:View>