8/19/2010 3:59:50 AM
Title:
Flex and AIR for Android
Hi friends ,
i want to create a application for Android mobiles i got 1 example from given link:
http://coenraets.org/blog/2010/05/sample-application-using-flex-and-air-for-android/
i download the source code of "(EmployeeDirectory.fxp project file)"
and then import to my Flex Builder-4 but i got error:
" unable to open 'C:\Program Files\Adobe\Adobe Flash Builder 4\sdks\4.0.0\frameworks\libs\player\10.1\playerglobal.swc' "
or in some project its some thing about Air2.5 problem
if this is a problem of air2.4 or some other plugin that we can write mobile app in flex.
so plz help or give me link for that air 2.5 or plugin
Thanks in advance
Gourav
8/20/2010 6:53:54 AM
you need the latest flash player sdk 10.1 to compile your project which can be downloaded from this location
http://download.macromedia.com/pub/labs/flashplayer10/flashplayer10_globalswc.zip
6/8/2011 11:16:24 PM
Hi friends,
I want to create application for android devices.
i got 1 example from the given link.
http://www.adobe.com/devnet/flex/samples/shopping-cart-application.html
download the source code of "(MobileShoppingCart.fxp project file)"
and then import to my Adobe Flash Builder Burrito but i got error:
Could not Resolve <s:ViewNavigatorApplication> to a component implementation
im using FlashBuilderBurrito nd Adobe Air 2.6.
please Provide me the solution..
thanks in advance
<?xml version="1.0" encoding="utf-8"?>
<s:ViewNavigatorApplication
initialize="initializeHandler()"
preinitialize="preinitializeHandler()"
firstView="com.adobe.mobileshoppingcart.view.MainView"
xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:presenter="com.adobe.shoppingcart.presenter.*"
xmlns:components="com.adobe.mobileshoppingcart.view.components.*"
xmlns:images="assets.images.*"
runtimeDPIProvider="com.adobe.mobileshoppingcart.util.CustomRuntimeDPIProvider"
splashScreenImage="@Embed('assets/images/splash.jpg')"
splashScreenScaleMode="zoom"
applicationDPI="240">
<fx:Style source="assets/styles/stylesMobile.css"/>
<fx:Script>
<![CDATA[
import com.adobe.mobileshoppingcart.util.ScreenStateHelper;
import com.adobe.mobileshoppingcart.util.ToastUtil;
import com.adobe.mobileshoppingcart.view.MainView;
import com.adobe.shoppingcart.control.MobileAppController;
import com.adobe.shoppingcart.enum.StateEnum;
import com.adobe.shoppingcart.event.NavigationEvent;
import com.adobe.shoppingcart.event.ToastEvent;
import com.adobe.shoppingcart.model.AppModel;
import com.adobe.shoppingcart.presenter.MainPresenter;
import mx.events.FlexEvent;
import mx.events.PropertyChangeEvent;
/**
* Instance of the app controller that is created during preinitialize
*/
private var appController:MobileAppController;
/**
* The presentation model for this class
*/
private var presenter:MainPresenter;
/**
* Helper calss for opening 'toast' notifications (it's an Android thing)
*/
private var toastUtil:ToastUtil;
//
// Private Methods
//
private function addPresenterEventListeners():void
{
presenter.addEventListener(PropertyChangeEvent.PROPERTY_CHANGE, presenterPropertyChangeHandler, false, 0, true);
presenter.addEventListener(NavigationEvent.GO_BACK_EVENT, goBackHandler, false, 0, true);
presenter.addEventListener(ToastEvent.POP_TOAST_EVENT, popToastEvent, false, 0, true);
}
//
// Event Handlers
//
protected function preinitializeHandler():void
{
// Create the app controller prior to making the views
appController = new MobileAppController(navigator);
// Create the toast util
toastUtil = new ToastUtil(this);
// Set (Inject) the presentation model
presenter = AppModel.getInstance().mainPresenter;
}
protected function initializeHandler():void
{
addPresenterEventListeners();
}
/**
* This method is used to bridge the concept gap between 'states' used in the desktop
* web version of this application and the notion of 'view class' used in the mobile
* version of the application. The ViewNavigator instance that is provided by MobileApplication
* requires a pushView method to be called with a Class name. The helper class ScreenStateHelper.as
* is used to bridge 'states' / 'view class' gap.
*/
protected function presenterPropertyChangeHandler(event:PropertyChangeEvent):void
{
if (event.property == "currentState")
{
if (event.newValue == StateEnum.HOME_STATE)
{
navigator.popToFirstView();
}
else
{
var data:Object = ScreenStateHelper.getDataFromEnum(String(event.newValue));
var c:Class = ScreenStateHelper.getStateFromEnum(String(event.newValue));
navigator.pushView(c, data);
}
}
}
/**
* Handler for showing toast messages
*/
protected function popToastEvent(event:ToastEvent):void
{
toastUtil.popToast(event.message);
}
/**
* Handler to go back a screen
*/
protected function goBackHandler(event:Event):void
{
navigator.popView();
}
protected function logoButton_clickHandler(event:MouseEvent):void
{
// Use the special method popToFirstView to return back 'home'
navigator.popToFirstView();
}
protected function cartButton_clickHandler(event:MouseEvent):void
{
// Go to the CartView screen
presenter.goCart();
}
]]>
</fx:Script>
<s:navigationContent>
<s:Button id="logoButton"
width="100%" height="100%"
click="logoButton_clickHandler(event)">
<s:icon>
<s:MultiDPIBitmapSource
source160dpi="@Embed('/assets/images/fx_logo/fxLogo160.png')"
source240dpi="@Embed('/assets/images/fx_logo/fxLogo240.png')"
source320dpi="@Embed('/assets/images/fx_logo/fxLogo320.png')"/>
</s:icon>
</s:Button>
</s:navigationContent>
<s:actionContent>
<components:MiniCartView id="miniCartView" width="80" height="100%" click="cartButton_clickHandler(event)"/>
</s:actionContent>
</s:ViewNavigatorApplication>
6/18/2011 4:08:53 AM
it's an example of flex 4.5. So update to flex 4.5 from Flash Builder Burrito.
Hope this helps. :)
7/5/2011 10:11:31 AM
I had this problem with FlashDevelop. Turns out the compiler was using flexsdk\frameworks\air-config.xml instead of flexsdk\frameworks\airmobile-config.xml which should be used for the mobile platform.