Are plugins for Android's native Web Browser version dependent? - android

I've been trying the code Google provides with Android source code for a Browser Plugin, more specifically, following this README,
https://www.codeaurora.org/git/projects/qrd-gb-dsds-7225/repository/revisions/cc99b832a941dc8cbb86f1607d04eb87935ddbfd/entry/android/development/samples/BrowserPlugin/README
My question is, will I need to distribute a separate plugin for each platform(Froyo, Gingerbread, Honeycomb, etc)?. I'm planning to include native code within the plugin.
Thanks in advance!

Related

How to create a cordova plugin for my android library?

I have developed an android library using which one can send messages to other android devices. I have developed many demo apps for mobile and watch to demonstrate this using native android projects. Now I want to explore hybrid android development. I want to know how a native android code can access my android library and use the functionalities.
I have come across custom Cordova plugins. Is it possible for me to build a Cordova plugin for my android library? If yes, can I then use it in a hybrid project and access the functionalities? If not, what is the best way to do it? Thanks in advance.
To answer your 2 important questions:
1. Is it possible for me to build a Cordova plugin for my android library?
Yes, it's possible to create a custom Cordova plugin for your library. That's how all the Cordova plugins are dependent on the base Android library.
2. can I then use it in a hybrid project and access the functionalities?
Yes, you can.
Some are the links that might be helpful to create a new custom Cordova plugin.
https://cordova.apache.org/docs/en/latest/guide/hybrid/plugins/
https://cordova.apache.org/docs/en/2.5.0/guide/plugin-development/android/
https://taco.visualstudio.com/en-us/docs/createplugintutorial/

Using crosswalk standlone without cordova

I am building an hybrid android app using crosswalk webview as my app needs webrtc support. I have a query in my mind as cordova webview is not stable over android versions and also do not have webrtc support therefore we add crosswalk plugin ,then why not use use crosswalk standalone . In this case we will also have some control over native features of android. THen what is the advantage of using cordova + crosswalk over using crosswalk webview alone.
You can do it, I have and there are some things you need to be aware of.
You will run into errors, the crosswalk community is way smaller, and therefore some solutions to your errors will be harder to find in the usual places.
Then you will have to make some decisions (space-wise). In crosswalk you have Shared and Embedded modes.
https://crosswalk-project.org/documentation/shared_mode.html
You will run into some trouble with embedded mode and testing with x86 and 64-bit phones. (You need to change your gradle dependency to 64-bit).
With proguard and architecture splits you can package your app to a "reasonable" size ( under 40mb ), depending on the contents of your assets folder. (Embedded mode)
As a java developer, I don't see the advantage of using cordova + crosswalk in most projects, but I do wish that the documentation available for crosswalk would be updated more frequently.
To get started, add this to your gradle file:
repositories {
mavenLocal()
maven {
url 'https://download.01.org/crosswalk/releases/crosswalk/android/maven2'
}
}
dependencies {
compile 'org.xwalk:xwalk_core_library:20.50.533.12'
}
Cordova is a complete HTML5 development framework with plenty of plugins that can help you to use Web API to do some works that only native code can do originally. By default, Cordova is using the system WebView on Android.
In contrast, Crosswalk is a HTML5 engine with the main purpose of being more powerful WebView. If you're developing pure web application, Cordova is the recommended way and you can replace the system WebView with Crosswalk by installing the Crosswalk plugin. But if you already have lots of native Java code and want to build a hybrid application, it's more convenience to use the embedding API of Crosswalk directly.
If you do that you are basically repackaging a website into an app. I don't know about Android, but Apple will not approve your app for sure, which defeats the purpose of using a hybrid framework anyway.

WebRTC on Android

I would like to use WebRTC on Titanium. In the end of last year, WebRTC was implemented on Chrome for Android. I would like to make an application with WebRTC on Android.
I have a few questions:
Is it possible to use WebRTC on native webview or it is only for chrome?
What is the simplest way to implement webRTC on Android?
I have found the old article about webRTC on mobile here WebRTC on a standalone mobile app but it is old, how has the situation changed now?
Just an update on WebRTC for those seeing this post later:
WebRTC Library
If you are only catering to Android L (5.0), you can use the updated WebView. I am not sure you can support older Android versions with a WebView though. You can take the native option of course.
As other users mentioned, compiling WebRTC source files is certainly a viable option if you have the time and resources. However, if you would like to get up and running faster, Pristine.io is dedicated to hosting up to date WebRTC Android artifacts. To begin using WebRTC natively on your Android, you can add the following to your app's build.gradle:
dependencies {
...
compile 'io.pristine:libjingle:9694#aar'
}
At the time I am writing this, I have been working with WebRTC on Android for the past few months, and the most recent revision I have been using is 9694. Find the most recent revision here.
Getting Started on Android
As with WebRTC's javascript library, you will need a service to take care of user discovery and SDP signaling. I built a WebRTC Signaling API using PubNub for the signaling service. You can include it and begin to use it right away by adding the following to your app's build.gradle:
dependencies {
...
compile 'io.pristine:libjingle:9694#aar'
compile 'me.kevingleason:pnwebrtc:1.0.6#aar'
compile 'com.pubnub:pubnub-android:3.7.4' //optional
}
Additional Resources
Signaling API Documentation
Sample Android WebRTC App
Tutorial on making an Android WebRTC app with signaling library
Check this link, it is sample android application provided for apprtc demo of webrtc. Follow the instructions on this link, you will get android application which you can test on two android devices, also on android to web apprtc demo works fine. Following the source code you may get some clue for developing your own android application for android.
Note:The link provided in this example for gclient config command is older one. Follow this link
gclient config http://webrtc.googlecode.com/svn/trunk
Good luck.
Yes, it's possible in Android using crosswalk. Please refer to this https://crosswalk-project.org/

phonegap for each platform should be created?

phonegap is cross-platform solution for mobile development. my question is for each platform i should create new project with phonegap and import my html/js/css? or there is a tool to generate other platforms code?
As I know there is no tool for that.
You have to use the project templates for all devices you want to support and share the "www" folder for all the projects.
The main problem with this approach is that you have to implement all changes in the native code for each device... for example we had to change the start page in our project.
edit
Thank you for the hint #PeterMmm, did not know this =)
As #PeterMmm has mentioned, the PhoneGap build service allows you to build for all the supported platforms "in the cloud". Currently it does not support custom plugins although I understand that is a planned feature.
So as long as you are using only stock PhoneGap API calls you should be OK to use the build service.

Flurry SDK for Android using AIR 3.0

I am writing application for Android using Adobe AIR 3.0. And I need to integrate Flurry analytics in this project. On official site http://www.flurry.com/ I downloaded Flurry SDK for Android. It is jar file. How can I integrate it to my action script 3 project? I am using Flash builder 4.6. Thanks.
Develop a native extension.
http://www.adobe.com/devnet/air/articles/developing-native-extensions-air.html
You cannot as far as I can tell. There is no way to include native development SDKs in your Air/Flex applications.
The problem is that your AIR application doesn't have direct access to the native SDKs functionality; only the functionality that Adobe has bubbled to the surface. Since Flurry's SDK interacts directly with the native Java implementation, Adobe would have to write code to let those events, triggers, methods & classes be accessible inside of the AIR runtime.

Categories

Resources