Note: The three first methods mentioned above are valid only if your project target android 3.0 or above, showA4GEditoOnClick is To display Android Editorials inside your unity project, you need to use one of the three methods (you can use all of them) bellow:ġ- showA4GEditos : If you want to display the editorials once the activity's started.Ģ- showA4GEditosWithStartTime : If you want to display the editorials after certain time.ģ- showA4GEditosWithStartAndEndTime : If you want to display the editorials after certain time and close them automatically after certain time.Ĥ- showA4GEditosOnClick : If you want to display the editorials when the user click on a button. Now, go to File >Build Settings >Player Settings, and change the Bundle Identifier to com.a4gpublisherunity.īuild the Unity project for Android platform and run it on your device to see the ads. Screen) methods in the Awake() function of an empty GameObject in your startup scene:ĪndroidJavaClass jc = new AndroidJavaClass( "com.unit圓d.player.UnityPlayer") ĪndroidJavaObject a4g = jc.GetStatic( "currentActivity") Ī4g.Call( "loadBottomAds", "yourSecondZoneID") You'll then need to call the loadTopAds or loadBottomAds (you can call the both methods to display two ads (one on the top, and the other on the bottom of the ![]() ![]() The C# file need to be under the Assets folder. You will create a C# file that will attach to a Unity GameObject as a script. This manifest file now needs to be edited to look like this: The Android SDK for Unity is provided as two frameworks files ( AndroidSDKPublisher.jar et A4GPublisherUnity.jar), making it easy to include in your Android project.Ĭreate a ‘Plugins’ folder and within this create another folder called ‘Android’ ( Assets>Plugins>Android).Ĭopy the AndroidSDKPublisher.jar and the A4GPublisherUnity.jar into this folder.īuild the project for Android and then go into the ‘ Temp\StagingArea’ folder with your project folder and copy the AndroidManifest.xml file into the ‘Android’ folder. Decompress the zip file and extract the files to your development computer. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |