How the html5 works as a cross platform? - android

I am currently looking for a cross platform technolgy for my Android App, I come to conclusion of HTML5,I tried some sample code and some Native applications using PhoneGap.
I'm little confused about Native Application(Using PhoneGap),It Uses .java files for writting plugins for Android, now if I want to develope same App for Windows,should i need to create new plugins for windows phone?.
(I'm working on NFC project in android.The plugins for NFC in android are available at
http://phonegap.com/2011/09/26/building-an-nfc-enabled-android-application-with-phonegap/
)

Yes. You will need to create plugins for different platforms that you use. You can use the base set of API's everywhere but if something does not exist, then you'll have to create a plugin for it in the platform's native language. You can contribute these plugins as open source back tot he community so others can use it as well.
See the plugin development guide here:
http://docs.phonegap.com/en/2.1.0/guide_plugin-development_index.md.html

Related

Can Cordova be a wrapper for a Xamarin app?

I am supporting a legacy Android app that was written in Xamarin. That Xamarin app will be replaced by a Cordova app. During a transition period I will need a solution that will support both. My high level thoughts are that after the user logs in to the app, I will send them to to what is applicable for them (legacy Xamarin or new Cordova). The app would effectively contain the code-base for both apps.
Is this sort of thing possible with Cordova - i.e. can I 'wrap' an exising Xamarin application inside of a Cordova one?
Thanks.
The short answer is "no." Xamarin generates an executable binary, not a collection of HTML or JS files thus Cordova/PhoneGap cannot "wrap" it. With that said, you can probably do a couple of things:
1) Have your Cordova app open the original Xamarin.Android app via app url:
Android Custom URL to open App like in iOS
2) In your legacy Xamarin.Android app create a WebView that loads the HTML/JS that your Cordova/PhoneGap would've. Basically, in a way, you'd be recreating the functionality of Cordova with Xamarin.
http://developer.xamarin.com/recipes/android/controls/webview/call_csharp_from_javascript/
http://developer.xamarin.com/recipes/android/controls/webview/load_a_web_page/
http://developer.xamarin.com/recipes/android/controls/webview/load_local_content/
I've found this link about using phonegap on monotouch apps:
http://scott.blomqui.st/2012/08/embedding-cordova-phonegap-in-monotouch-apps/

Opentok module for Titanium SDK that supports both Android and IOS?

I am developing a mobile application using Titanium SDK. This is my first mobile app. Most of the app is done successfully. The only module that remains is Video conference support. The company I am working in has chosen to use Opentok SDK. I finished the web application and it works fine. Now I've hit a wall in mobile app and can't move further. The problem is Opentok provides a module to use for Titanium, But it only supports build to IOS not Android. The reason we chose Titanium is for cross platform support.
Is there any module available to use or any other way to implement Opentok with Titanium that builds into both Android and IOS.
I have already tried using a WebView to open the conference module of web application. But bad luck, Opentok only works with chrome browser in mobile. But WebView utilizes native stock browser which does not support WEBRTC. So, opentok doesn't work with webview too.
Please help me. This is my first app and I am stuck at this point.
To Create a Module for OpenTok Android:
These are the steps I would follow.
Create a new Android module: titanium.py create --type=module --id=com.tokbox.ti.opentok --platform=android --name=opentok-titanium
Follow the installation instructions from OpenTok for Android. (Hint: I added a separate section down below to help you get through their instructions.)
Make sure the module runs: ant run.emulator or ant install.
Try running their sample, fully in JAVA, completely separate from Titanium. Make sure it works, and you know what it should look like. Then, figure out what exactly you need from their API. Or, if you're feeling ambitious, decide you want everything. Work to strip down the example to just the surface area that you need. Simplify it down to the least number of files you feel makes sense.
Write an example/app.js that demonstrates how you want the module to be used. For example, maybe you'd start off by requiring the module, then setting some API + Session keys, then calling some API, etc.
Based on the documentation, port what you need in to your module. Reference the Appcelerator Android module dev guide and open source Android modules for inspiration.
Write documentation for the module to specify what the various properties, methods, etc are, so that other developers can figure out how to use the module.
When you're done, submit a PR to OpenTok and revel in your creation and contribution.
Some Hints for Step 2:
.jar files go in lib/.
.so files go in platform/android/libs/armeabi/
Permissions go in timodule.xml, and you can see an example in the open source PayPal module for Android
OpenTok does not work with WebView. OpenTok support for Titanium Android does not currently exist because it is currently in beta and we don't currently have engineering bandwidth to build a Titanium Android integration. However, if you are familiar with Titanium, you are more than welcome to add the integration yourself and send a pull request. You can get the Android beta here and you can get titanium source code here
If you are in a hurry and open to trying other frameworks, our PhoneGap Plugin currently supports both android and ios.

Convert android app to IOS using phonegap?

I developed an android application with Phonegap and I want to convert it to iOS as well. Before starting my project I heard that we are able to convert same project with multiple platforms using phone gap. But now I don't know how to convert my project to IOS. Can any one suggest good tutorial OR examples to do it.
And also mention what are all prerequisites to convert my android application to IOS using phone gap.
Suggest me some tutorials with examples.
With phongap you can target all platforms including iOS, android and windows etc. using HTML 5, avoiding each mobile platforms' native development language. Code base remains same for every platform. Applications execute within wrappers targeted to each platform, and rely on standards-compliant API bindings to access each device's sensors, data, and network status. refer docs http://docs.phonegap.com/en/3.2.0/guide_overview_index.md.html#Overview
Phonegap is not for converting one build to another.. Using phonegap you can develope for all platforms using phonegap framework, you can generate .apk,.ipa,ota, etc as you wish using sdk in your pc or using phonegap build service. You can read here(phonegap authentic doc) how can you do it for different plaforms.
Nb:Phonegap provides complete documents in their site itself, you can go through and understand, it is helpfull.
You can build on each platform. If you don't want to do that, they offer a Build service that build your app on each platform for you. See https://build.phonegap.com/ for more info.
With phonegap you can create all platform application with same package just you need to clear yourself that for IOS you need certificates to build it. Otherwise same package you are using for android can use for IOS also.

Use Phonegap for SDK developement

I am developing a native SDK which is integrated into a native app ("host app"). The app is calling my SDK method and this method will open a Webview (both for iOS and Android).
I looked into Phonegap as a solution, and saw that it gives me a platform for opening a Webview and communicating with the device. While this is ok, I cannot find a way to build this as the "SDK app" that I wanted, triggered by host native app, without writing the native code for that myself (duplicating my code for iOS and Android and dealing with native code).
Does Phonegap (or other platforms) have the ability to add a native logic (and not only webview) without the need to duplicate my code?
tnx!
Yaniv
PhoneGap is for developing apps. It is not really for third parties to create a library for others to use. While you can try to twist PhoneGap (and similar solutions) to serve that role, that will add extra baggage for anyone who would want to integrate with your library.
Hence, I suggest that you just create a library, sans PhoneGap.

How to setup libGDX project only for Android & iOS?

i have developed some applications on android.But now i want to learn game development in Android & iOS with libGDX.
I want to only develop for Android & iPhone.I do not want a desktop project.
All tutorials tell me to first create desktop project than write code in main project & than run as Android application.
But i want to write code in android project using both android & libGDX features.
is this possible ?
if yes than how ?
In order for you to multi-target with LibGDX, you need to use the core project for shared code, and the starter project for each platform you are targeting (the desktop target is not required if you don't intend to do desktop). If you want to use platform specific code, typically that would be done through an interface (see https://code.google.com/p/libgdx/wiki/ApplicationPlatformSpecific).
If you want to only target a single platform and not use a shared project, you can can create a single project for that platform then add the appropriate jars and other resources. I think this makes more sense for Desktop only or Android only as the iOS stuff is less straightforward to set up.

Categories

Resources