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
0
Question by OWiz · Feb 07, 2013 at 07:09 PM · androidpluginjava

How to talk to Java plugin

I have this AdMob plugin, and I want to toggle the ads on and off.

The ads work and everything. I just want to call this function

 public class AdMobTestActivity extends UnityPlayerActivity
 {
     private AdView adView;
     ///
     private void TurnInvisible(){
         adView.setVisibility(AdView.INVISIBLE);
         Log.i("ADS","Ads turned off");
     }
 }
 


What do I do in Javascript to call this method from the Java file?


UPDATE: So I added this:

 var jo:AndroidJavaClass= new AndroidJavaClass("co.org.example.AdMobTest.AdMobTestActivity");
    jo.Call("TurnInvisible");

Into my Javascript file, but it says "Unable to find Method id for TurnInvisible"

How can I call this Java method?

Comment
Add comment · Show 6
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 OWiz · Feb 08, 2013 at 02:00 AM 0
Share

I have a total of four questions up, but zero answers for any of them. I have a feeling that this community could use some improvements.

avatar image iwaldrop · Feb 10, 2013 at 07:34 AM 0
Share

The reality is that this is a Unity answers site; we don't support Ad$$anonymous$$ob. However, this is really about receiving method calls from a native plugin. Have you tried searching google? Sadly, the most experienced devs don't have much time to check out the site, and it's really just for beginners anyway. Try looking at this post, and also check out what Ad$$anonymous$$ob says to do. We just integrated it into a game we're doing, but I didn't handle the integration so I don't know the specifics.

http://forum.unity3d.com/threads/18059-Import-external-DLL-in-unity

avatar image OWiz · Feb 10, 2013 at 03:42 PM 0
Share

Thanks, but none of that helped.

avatar image iwaldrop · Feb 11, 2013 at 04:41 AM 0
Share

Yeah, well, again, that's not really a Unity specific question; it's a DLL Import question, which is code specific stuff. I'd suggest Stack Overflow.

avatar image OWiz · Feb 11, 2013 at 05:35 PM 0
Share

Not really, because it's a .jar, not a .dll

Show more comments

0 Replies

· Add your reply
  • Sort: 

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

10 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

Related Questions

How Set Java Plugin on Unity? 0 Answers

Android/Unity/Eclipse Help 0 Answers

Passing texture to android plugin 0 Answers

use own sound recorder android library in unity 1 Answer

Admob plugin error: Java.Lang.ClassNotFoundException: com.google.android.gms.ads.mobileads 2 Answers


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