ANE for one platform on Flex mobile project for iOS and Android - flex-mobile

I'm very new at Flex Mobile Projects and native extension.
I have a big doubt... If I have an ANE that only works on iOS or Android, can I use it into a project for Android AND iOS?
I mean, if I want to do something and I've only found and ANE that works for iOS and another ANE that works for Android, can I create only one project and depending on the device use one or another? or should I create two different projects?
Thanks in advance

You should be able to correctly code using two different ANE's, one for each platform, but it does really depend on the ANE.
Most provide a isSupported flag to allow you to determine programmatically whether the extension is supported on the current platform.
if (ExtensionA.isSupported)
{
// Use extension A
}
else if (ExtensionB.isSupported)
{
// Use extension B
}
It's also worth noting that if the extension isn't correctly implementing a "default" version (i.e. one that gets used on unsupported platforms) this may fail. Really comes down to the ANE implementation.

Related

How can I access device information without using packages in Flutter?

How can I access device information without using packages in Flutter? How can I get the information of the device where the app is installed in my Flutter app?
First, you'd be better off using packages. But if you really want/need to do it, you'd have to write platform-specific code code in the native language of the targeted platform (ie. Swift or Objective-C for iOS/Mac, Kotlin or Java for Android, etc), then use so-called platform channels to pass messages between your app and the platform-specific code.
If you'd like to get details about the device, on iOS you'd use UIDevice, on Android you'd typically want Build.
This can only be done through Method Channel

Our iOS developer has developed a game in Unity3D. How do we export it for Android?

Our iOS developer has developed a game in Unity3D. How do we export it for Android? I did a quick check on the internet and it says there "one click export for Android".
Is this really the case? Are there ways it might have been developed that will make it not as easy to do?
If you are asking about "one click export for Android" then yes it is a one click export for Android
Build Settings > Android > Switch platform > Build
But for the question will there be any additional work necessary. Well that depends if you have used any (self made or third party) plugins in your application. If not then no additional work is necessary.
If yes, then there are 3 possibilities:
All the (third party) plugins are only iOS specific.
Some of them have both Android and iOS component in them.
You have written your own plugins.
Then, (as you said that you have developed an iOS only application) it is obvious that all the code you wrote using those plugins is also iOS specific. In that case it is recommended that you enclose all that code in Unity's Platform Dependent Compilation checks (for iOS it is UNITY_IOS for android it is UNITY_ANDROID).
This is recommended because initially you should first check if your application runs perfectly on android devices with out any 'plugins' nightmare. Once sure, then you can go ahead and implement the Android side of all those plugins.
These checks only ensure that the piece of code written inside these are executes only on the respected platforms. Meaning, enclosing all iOS specific code in #if UNITY_IOS will not disturb you iOS build but only prevent that code from running on any platform other than iOS.
Finally, After that you are good to go and follow that "one click export for Android" method.

What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)?

What is the best way to develop a mobile application that run on multiple devices mainly (android and iPhone)?
1) Use android frame work and iOS framework.
2) Or use a cross platform development library something like (AirPlay SDK for example).
3) Or there is other way else you prefer.
Please feel free to give me your suggestions.
Edit: I forgot to say, it'll be a game which require a lot of 2-D graphics.
Appcelerator Titanium is a solution. You write your app in Javascript/CSS and it compiles to Android and iOS via shims.
http://www.appcelerator.com/
PhoneGap is also a good choice if you want to deploy to multiple platforms.
Depending on the application, I'd take a strong look at HTML5 combined with something like jQuery Mobile. Unless your application requires more of the sophisticated resources on the device, this cross platform approach may be appropriate
If it's a game you should consider Shiva3D and Unity.
I always create two aplications, and i try to make them the most equal possible but using always all device functions needed.
write your common code in C++, both platforms support it. for platform dependent code you can create one interface with two different implementation

Compiling an iPhone XCode project to work on Android

I have an iPhone app which is written in XCode and is currently selling on the iTunes app store. I want to be able to release it for the Android market. Is there any way to compile my app from XCode to work on the Android operating system. I don't really want to learn a new language and completely rewrite my app, so was wondering if there is an easier way.
There isn't any way to compile Android apps from Xcode, and i strongly doubt that Apple would introduce such a feature - if it's even technically possible to do. Sorry.
But if you have Objective C down, you shouldn't have to much problems understanding Java (which is used for creating Android apps).
Check the link below for a pretty comprehensive guide to start learning java and code for the Android platform:
http://mobile.tutsplus.com/tutorials/android/java-tutorial/
Good luck!
No, in general you can't do this. Even if assuming Objective-C can be compiled/converted into Java (which is most likely will not be true for times to come), you'll need to rewrite UI part; then most of OS APIs are different too. There are several features that iOS has that Android lacks or does not have open API for it, or has limited API, or has conceptually different or just different API.
Its just easier to move some of your iOS code into C/C++ shared library and then make sure that it compiles and works on both platforms. And then make platform dependent pieces separately for each platform (UI, hardware related stuff, etc.). This way you'll have at least part of your code shared.

support iphone,ipad,android

develop android apps that should support iphone,ipad,android.is there any way for developing this kind of generic app or we need to develop aps depending on mobile os
Though it is possible to create an universal application for iphone and ipad i don't think you can do the same for Android.
In my opinion it is always better to port your application to Android based on your requirements so that you can take advantages of the API's that the platform is offering you.
You can try using a framework named Titanium Appcelrator. This framework will help you target iPhone, iPad, Android with the same code base. This also lets you access most of the Native hardware features available with these platforms but not all. It seems that this also may support Blackberry soon.
We are struggling with the same question at the moment. Since we are working for Android, Maemo, Meego, iPhone and Blackberry (+Symbian 3 soon), HTML5 looked promising, and we dedicated quite some time investigating it. The end result was HTML5 is not yet ready for the development we were hoping for. It's fine if you need simple functionality, but as soon as something more advanced is needed, you need to create a different version. Even if it suits your needs, every platform requires different HTML5-to-native bridge, and every platform has a different engine. As you can see, only front end part could be partially used.
In your case, you need two different applications, one for Android, another one for iPhone/iPad. Try to see if you could take advantage of HTML5, if not, you are unfortunately stuck with separate development for some time to come. Unless you will create a web app and use it with device's browser.
You can create common functionality libraries with C or C++ and use these libraries in iPhone/iPad and use Android's NDK tool to integrate theses libraries with Android
On Android, you're using Java as the main language, and you can also use C and C++ . On iOS, you're using Objective-C as the main language, and also can use C and C++. So the common denominator would be C (at least on the iPhone there are no C++ GUI classes). I have no idea about developing on Android, but on iPhone it's no fun to purely work in C (and I'm not sure if it's even possible, maybe it is but should I when working with Objective-C/Cocoa is fun).
What you can do is write generic logic and share that between both systems, like a library. For example, I worked on a project where we used a C++ SIP/VoIP library that also compiles and runs on Symbian. It shouldn't be a big problem to write C code that can be shared between iOS and Android, as long as it is mostly about logic and not about calling system-specific stuff (you can of course include system specific stuff and guard that with #ifdef but you don't want your library to have more system-specific than system-agnostic code, I guess). For example, if you intend to write a networked game you could implement the network protocol in a way that could be shared between iOS and Android.
But as soon as you're hitting the GUI level I don't think you can share any code, and even if you could you probably don't want to because if you use the native languages/IDEs you are faster designing the GUIs each in their respective main languages/IDEs than trying to find a common way and then have to live with compromises and trying to make it work on both systems all day long. Better to implement the GUI native to each platform (e.g. Xcode has a very good graphical tool called Interface Builder that can save a lot of work/typing).
we can go for the XML VM to run the android apps in iphone.
Check this for more info.
xmlvm.org