Topic locked

incompatibility with other plugin

October 21, 2013 - 10:00am #1

Hi,

 
We are using your pluggin for Unity Android. We don't have any problem if the plugin is used has a stand alone plugin. 
 
Now we are experiencing some issue while trying to integrate it with some other plugins. The problem is due to the  <intent-filterproperty needed in the manifest.xml to launch for instance the QCARPlayerProxyActivity because the other plugin need to be the main application also (using the  <intent-filterproperty too). Your activity, as the other plugin activity, don't give access to the source code of the activity ( compiled in .jar file) which prevent us from code modification to extend it.
 
 How could we resolve this incompatibility?
 
 
Best regards, 
 

incompatibility with other plugin

January 4, 2015 - 6:21am #6

incompatibility with other plugin

December 28, 2014 - 9:12pm #5

Hi,

We have a project developing with vuforia and need to share images on Social media networks.

For this we are using prime31's plugin. but these two have its own MAIN Activities. We are unable to merge the Andoid manifest files. 

can you help how to merge these Manifests ? it would help to so many developers.

AND

Can you give more explanation for how to use the given code snippets (previous comments),  I tried to use the code on a button event. but am getting there is no "currentActivity" error. 

AndroidJavaClass ajc = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");

Can you please give more explanation ? it would be great and helpful for many developers. 

Thank you.

 

 

 

 

incompatibility with other plugin

November 5, 2014 - 3:41pm #4

Hello,

Can I please get more details on this? I'm trying to handing mergeing of multiple android plugins for Unity. I understand its something to do with multiple plugins using the manifest command <action android:name="android.intent.action.MAIN" />

 

How do you use the first two blocks of code? Is there other setup involved? Does this cleanly allow multiple 'main' plugins?

 

Thanks.

incompatibility with other plugin

November 15, 2013 - 7:49am #3

Copying the previous post into a new thread with proper formatting for readability (moderators feel free to format the OP and delete mine if needed)

//In case RootActivity is the MAIN in the manifest
AndroidJavaClass ajc = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
ajo.Call("launchScannerImpl", showUI, defaultTxt, symbol, forceLandscape);


//In case RootActivity is not the MAIN activity in the manifest (multi-plugin)
AndroidJavaClass ajc = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
var jc = new AndroidJavaClass("com.c4mprod.ezcodescanner.RootActivity");
jc.CallStatic("launchScannerImpl", ajo, showUI, defaultTxt, symbol,
forceLandscape);

//On the plugin side we extend the RootActivity from UnityPlayerActivity and
//the CallStatic calls this:
public static void launchScannerImpl(Activity root, boolean showUI, String
defaultText, int symbols, boolean forceLandscape) {
Intent intent = new Intent(root, CameraActivity.class);
intent.putExtra(RootActivity.EXTRA_BOOLEAN_UI, showUI);
intent.putExtra(RootActivity.EXTRA_STRING_TXT, defaultText);
intent.putExtra(RootActivity.EXTRA_INT_SYMBOLS, symbols);
intent.putExtra(RootActivity.EXTRA_BOOLEAN_LANDSCAPE,
forceLandscape);
root.startActivity(intent);
}

 

incompatibility with other plugin

November 6, 2013 - 6:59am #2

We made also ourselves some Unity Plugins (i.e EasyCodeScanner,
EasyAnalytics) and to avoid the conflicts between our plugin and other
unity plugins we've put in place a small trick that prevent us from being
the main activity.
On the Unity side instead of doing this (which forces the plugin as being
the main activity):
//In case RootActivity is the MAIN in the manifest
AndroidJavaClass ajc = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
ajo.Call("launchScannerImpl", showUI, defaultTxt, symbol, forceLandscape);
We do this:
//In case RootActivity is not the MAIN activity in the manifest
(multi-plugin)
AndroidJavaClass ajc = new
AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject ajo = ajc.GetStatic<AndroidJavaObject>("currentActivity");
var jc = new AndroidJavaClass("com.c4mprod.ezcodescanner.RootActivity");
jc.CallStatic("launchScannerImpl", ajo, showUI, defaultTxt, symbol,
forceLandscape);
On the plugin side we extend the RootActivity from UnityPlayerActivity and
the CallStatic calls this:
public static void launchScannerImpl(Activity root, boolean showUI, String
defaultText, int symbols, boolean forceLandscape) {
Intent intent = new Intent(root, CameraActivity.class);
intent.putExtra(RootActivity.EXTRA_BOOLEAN_UI, showUI);
intent.putExtra(RootActivity.EXTRA_STRING_TXT, defaultText);
intent.putExtra(RootActivity.EXTRA_INT_SYMBOLS, symbols);
intent.putExtra(RootActivity.EXTRA_BOOLEAN_LANDSCAPE,
forceLandscape);
root.startActivity(intent);
}
That way we get the main activity already in place, instead of forcing
ours, and launch our own activity from that. We don't know if it can be
applied to your plugins but just in case it might help.
Best,

Topic locked