grpana.blogg.se

How to use android studio cocos 2dx
How to use android studio cocos 2dx




The onRequestSuccess callback is fired after the SDK has successfully made a content request to our servers.In this tutorial, I create a Cocos 2d-x v3.3 project, and import the project into the recently-released Android Studio. Your TJPlacementListener has a callback for "onRequestSuccess". When you request a TJPLacement you pass along a TJPLacementListener object. NOTE: In order to ensure proper functionality, prior to creating a placement object, the Tapjoy connect call needs to have been made and succeeded. Another equivalent way is to check to see if p.isContentReady() is true, as in the example above. This way, you can be sure that the content is actually on the device, and can be shown to the user without delay. Often, it is a good idea to wait until the onContentReady delegate fires before showing content to the user. Note that you should mute your audio before showing content from a placement that might include video, otherwise the audio for the video and your app’s audio might conflict. The primary methods defined by the TJPlacementListener interface are: The Tapjoy EasyApp sample app has a complete code example showing how this can be done. At a minimum your class will need to extend the TJPlacementListener interface (public class YourMainActivity extends and Activity implements TJPlacementListener). You will need to prepare delegate methods to handle the various placement responses. For ads, this makes the user less likely to interact with the ad, and therefore less likely to make money for you.

how to use android studio cocos 2dx

If you wait until the last moment to request content, it is likely the user will have to wait for the content to load, and watch a loading spinner.

how to use android studio cocos 2dx

For example, if the placement is a button on your main menu, you might want to request content for it when your application starts, just after the Tapjoy Connect call succeeds. Pre-caching the contentįor the best user experience, you should request content in advance of when the user might be shown that content. Do not make a request before you have received the onConnectSuccess callback. NB: Before you request content please ensure that the Tapjoy connect call has succeeded.






How to use android studio cocos 2dx