How to display AdMob ads in FlashBuilder 4.5.1 mobile project? - android

I am currently developing an application in the latest version of FlashBuilder and I cant seem to find out how I can incorporate AdMob ads or any other Ads into my application. Does anyone know how this can be done? There seen to be a few tutorials online focused on Flash however im not sure how to get those to work in the Flex environment. Thanks

Anything that works in AS3 will work in Flex (since Flex is built up on top of AS3) it's just going to be a matter of making sure you've included the appropriate swc dependencies in your project (or AS3 code if you're just copying it in). The only other thing to be aware of is that the Flex 3 framework requires that elements added to components are a UIComponent or sub-class thereof, since this object isn't present in the Flash player itself (it's part of the Flex framework code) you sometimes need to add the Sprite or MovieClip or whatever to a UIComponent then add that to your "page" or component. Please drop a URL to the code you're trying to integrate with and I'll edit this answer to include specifics.
Also to note I specified Flex 3 because in Flex 4 the requirement is that the component implements IVisualElement (and is added via addElement vs addChild).

Well, There are always the Adobe Docs that are a good reference (under "Displaying Ads"). They suggest using the StageWebView object viewport. But, Jespers tells you how to do the same thing, and mentions Rohde's wrapper class that makes the whole thing easier. Choose your favourite.

Related

How are your experiences with NativeScript?

Does anyone have experience with NativeScript and can compare it to developing native apps, especially for Android?
I have read all these articles:
FIRST THOUGHTS ON NATIVESCRIPT
SECOND THOUGHTS ON NATIVESCRIPT
Introduction to Native Script – Is It Worth Your Time?
My Experience Developing with Telerik NativeScript
I know especially three of them may be outdated. But I want to ask all of you developers:
How is your experience with NativeScript?
Are there any Android-Components you cannot use? Which are these ones?
Is styling really so limited?
Do apps really look so different at runtime as in the mockup as in the pictures of the first article referenced above?
Does loading of native Android objects into JavaScript Code always work correctly?
Does NativeScript generate Java-Code for Android-Platform out of the NativeScript code I write?
Is it possible to modifiy this code if I want to use some native-only features? What if I want to make UI changes then? Do I have to regenerate the code and do I miss my native extensions then?
Very glad to see that you are evaluating NativeScript to eventually use it in present and future projects.
I'll try to condense answers to a few of the questions into one, as they really are mostly related.
Skipped.*
That depends on what has already been exposed through a custom view/plugin or module. The core-modules that every NativeScript app comes with contains the most basic of wrappers for both Android and iOS under a common API. There are plugins (nativescript npm modules) that provide additional wrappers on native android views (nativescript-telerik-ui for one, nativescript-carousel), most of which are created by the NS community.
As RexSplode mentioned before me - it's mostly the platform that imposes certain limitations. NS uses CSS to declare style, but you can also access the native components and manage their style and appearance programatically if what you need isn't readily available out of the box.
First I'd like to note that the first 3 articles you've linked are over a year old now, and trust me, NativeScript has evolved a lot since then. With all the available components (remember the npm modules I mentioned earlier?) there's a good chance that you will get a close to 1:1 similarity to a well-styled native Android mockup.
At build time metadata is generated for the Android/Java public API used in the project. When the JavaScript Engine (V8) fires up, that metadata is loaded into memory, prototype chains are constructed, and callbacks are attached, so that when you call new android.widget.Button(); in your JavaScript code, the proper virtual machine instructions will be called, and a native button will be created. Static methods are accessed similarly, check out the official docs to get a better understanding of how it all works.https://docs.nativescript.org/runtimes/android/advanced-topics/execution-flow
and 7., and a cont. of 2. Java code, or rather compiled Java code is generated whenever you wish to extend a native Android class that isn't available already in a module or in the native Framework. Extending classes is very similar to how you would do it in Java - you extend a class, and create new implementations of interfaces. That means that you won't have to open Android Studio to create a new class, build it into a native plugin and then add it to your project, since you can do it all in your NativeScript code using JavaScript/TypeScript. https://docs.nativescript.org/runtimes/android/generator/extend-class-interface
Disclaimer: I am on the NativeScript Engineering team
I investigated the Native Script a little and my colleague at work writes an app with it, so I can offer you a bit of information that I have.
1. skipped
There are limited amount of components you can use with native script out of the box. However, if you have a native-java developer who can write a wrapper for you - you can use everything.
It is limited to the platform you are using. Android itself has a lot of style limitations which cannot be easily overwhelmed.
don't know
It works a little different. Your JS object, or rather widgets are translated to java code. So with the items from the box - yes, they are okey. If you write a wrapper for your custom component, then all is up to you.
Yes it does.
No, the code is generated, how are you going to modify it? Changes will be undone on the next build. However, you can write a native module for your application and use any features you want. It is like defining an interface, which you can use in JS code afterwards.

Can you tell how or what was used to create an Android game?

Could you look at an app (simply as a user) and tell how it was made or what library (if any) were used? I'm thinking about making a game like Devil's Attorney, but I'm really going back and forth with something. That something is whether to use a 2D library like libgdx, HTML5 (phonegap), or just use the standard Android library. The game I'm looking at as an example, almost looks like a really juiced up HTML5 app, but.. I can't tell. So, is there a way to kind of know what platform and/or library was used in making an Android game? This is related strictly to popular/successful Android game apps that aren't open source.
You can find out which libraries are used in an Android app with the AppBrain Ad Detector (main purpose is to detect ad networks, but it also detects popular libraries such as libgdx, cocos2d, unity etc)
https://play.google.com/store/apps/details?id=com.appspot.swisscodemonkeys.detector

Android UI framework

I have some issues in working with Android layouts and make them adapt for all screen sizes..
I have found that there is an alternative solution : Android Bootstrap http://www.androidbootstrap.com/ for that and provide nice UI components (buttons etc...).
Since I'm developing natively, is this kind of frameworks won't make the App runs slower ?
Is this only a UI framework like for the web (Bootstrap from twitter) ? if not, can we use with it everything in Android (Camera, micro etc...) and Can we include some Jars like Zbar ?
Thank you.
I have found that there is an alternative solution : Android Bootstrap
It is not an "alternative solution". You still will need to be "working with Android layouts and make them adapt for all screen sizes", because Android Bootstrap does not change much related to that.
and provide nice UI components (buttons etc...)
It uses the same Android widget set that all other Android apps use.
is this kind of frameworks won't make the App runs slower ?
There is nothing in an Android Bootstrap project that would necessarily make the app significantly slower.
Is this only a UI framework like for the web (Bootstrap from twitter) ?
It is not even that. It is a starter project that demonstrates how to tie together a dozen or so open source libraries for Android app development. You can think of it as an extended version of the templates used to create new applications and activities in Eclipse or Android Studio.
This is not to say that Android Bootstrap is bad -- far from it. However, it does not resemble your description.
can we use with it everything in Android (Camera, micro etc...)
I have no idea what "micro" is with respect to Android. Since you are writing an Android application, just like any other Android application, you can use it with whatever parts of Android you choose to.
Can we include some Jars like Zbar ?
I see no reason why not.
It is very common for such templating engines not to have exactly most components you need. for android it is basicallly about adding support third party libraries to get the exact experience you need.
Thus you may want to consider adding more or lacking parts by leveraging some external libraries like those from HERE

Upgrading and existing flex application using the mx library to work on Android

I am trying to make my flex app work on Android, and that involves making an AIR app to run on Android. Seeing as the flex app needs the mic, an AIR app is required. I am using flash builder 4.5 on win7 with air 2.6. The trouble seems to be that most of it is now not available. For example mx.containers is there, but not mx.containers.viewStack. I notice that there are obvious equivalents in spark for some components but not others.
VBox, HBox, Canvas VDividedBox, AdvancedDataGrid and associated custom renderers are the components my application uses the most.
What is the fastest way to make this work on Android, I am under time pressure. Is there a site somewhere that recommends the best way to do this, and what components can be replaced with which?
(This is my first time posting here, but I have a good reputation on vworker:
http://www.vworker.com/RentACoder/DotNet/SoftwareBuyers/ShowBuyerInfo.aspx?lngAuthorId=6446927)
Thanks
Thor
It sounds like you need to read the Full Adobe Manual for Flex 4.5. Much of it will be review and you can breeze through that, but you'll want to learn about the Spark components and the spark architecture.
To draw a direct parallel to your specific components you need:
A Canvas is, generally, replaced by a Group.
a VBox is replaced with a VGroup. Or you can use a Group with a VerticalLayout.
An HBox is replaced with an HGroup. Or you can use a Group with a HorizontalLayout.
There is no Spark version of a ViewStack. In Mobile Applications you'd probably use the view class and ViewNavigator to accomplish something similar
I'm not sure of a VDividedBox; nor AdvancedDataGrid replacement.
Since you wan to build an Android app, next you're going to want to read this Adobe manual. To get acceptable performance out of AIR for Android, you are probably going to have to rewrite an MX heavy project from scratch.
This is not a project I'd want to partake with tight time constraints; so I wish you best of luck.

Actionscript 3 for Android - is there a mobile ready list view control available in Flash Builder 4.5 using Actionscript Mobile project

I am developing a mobile app in Flash Builder 4.5 based on an Actionscrip Mobile Project - i.e. no flex just pure actionscript.
Is there a listView component that I can use from a pure actionscript project (i.e. a list of items where each item has a picture and some text and you can flick the list up and down with your finger and select an item to proceed to the next screen) ?
After much searching I just don't seem to be able to find one but because it seems like this sort of thing must be available in a platform for developing mobile apps I can only assume I have missed something obvious. I think there is something like this in a Flex library (?) but I am not sure how to access it or if I even can/should from a pure actionscript project.
(After much searching I sat down and wrote one myself and it seems to work fine and replicates the 'real' thing quite nicely for my purposes. However I am assuming that someone else will have done it better and so would like to find the real thing if I can).
There are a few AS3 libraries available that you may want to check out:
MadComponents: http://madskool.wordpress.com/ & http://code.google.com/p/mad-components/
I'm testing the MadComponents library right now and it looks promising. Super easy to get up and running. Lacking on the documentation, but I suspect that will change soon as I've been talking with the creator.
AS3Flobile: http://custardbelly.com/blog/category/as3flobile/ & https://github.com/bustardcelly/as3flobile
Looks really nice and I've made a quick test with it. It has another dependency in the AS3 Signals library. Its a bit more involved to get the basic shell of the program up and running and has limited skinning ability from what I gather.
HTH.
There are no built-in controls if you are building an actionscript mobile project. You have a large assortment of controls if you build a Flex-based AIR application however.

Categories

Resources