Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
5
Question by $$anonymous$$ · Jul 22, 2013 at 05:05 PM · androidpluginjni

Using two Unity Android Plugins that want to be the main activity?

I'm using two native Android plugins the INABS (In App Billing Service) and BFS Google Play Game Services plugin. I can make each one work individually. But I can't make both run at the same time. As far as I can tell it is due to the fact that both plugins want to be launched as main activities in the manifest like so.

     </activity>
         <activity android:name="com.bfsgooglegames.GoogleGamesUnityPlayerProxyActivity"
                   android:launchMode="singleTask"
                   android:label="@string/app_name"
                   android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen">
         <intent-filter>
                 <action android:name="android.intent.action.MAIN" />
                 <category android:name="android.intent.category.LAUNCHER" />
         </intent-filter>
     </activity>

     <activity android:name="com.itoysoft.android.activity.AndroidIAPActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="fontScale|keyboard|keyboardHidden|locale|mnc|mcc|navigation|orientation|screenLayout|screenSize|smallestScreenSize|uiMode|touchscreen" android:screenOrientation="portrait">  
         <intent-filter>
             <action android:name="android.intent.action.MAIN" />
             <category android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
     </activity>

In that order BFS works when INABS fails and the reverse applies if the order is changed.

Removing the Main action and Launcher category from one or the other appears to have the same effect.

This seems to indicate that it is possible to manually start a Unity Android plugin using JNI but the sample appears a bit unclear and confusing.

Is there any way of having both of these plugins working?

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image BlackPanda · Jun 28, 2014 at 09:15 AM 0
Share

I'm having a similar problem. Anyone has a workaround for this issue??

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by liortal · Aug 03, 2014 at 10:34 PM

I did not fully understand the part in your question where you mention "In that order BFS works... "

In any case - there can be only 1 main activity to your Unity game: either the one that comes out of the box, or a custom one that you provide.

I am not familiar with the plugins you describe, but i suppose they provide their own activity to perform certain initialization upon the app's startup (are they displaying anything when the game starts?)

You should check with the plugins' developers to see if it is mandatory for each one to be the main activity, and if not, perhaps they provide some other initialization API so you can manually initialize the plugin instead of it running in its own custom defined activity.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

An working example of calling Native C code from a C# script in Android 0 Answers

How to use AndroidJavaObject/AndroidJavaClass 0 Answers

using shared libraries generated by Android project in Unity 0 Answers

Android plugin breaks when using receiver. 1 Answer

How to call an android notification plugin if it's not the main activity? 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges