New Android SDK version 5 from Leadbolt.

Discussion in 'Advertising Discussion' started by fatos, May 10, 2013.

  1. James Rebello Active Member

    Member Since:
    Mar 28, 2013
    Message Count:
    70
    Likes Received:
    31
    Trophy Points:
    50
    Can you post a screenshot of your code in eclipse?
  2. mudak New Guy

    Member Since:
    May 21, 2013
    Message Count:
    3
    Likes Received:
    0
    Trophy Points:
    0
  3. James Rebello Active Member

    Member Since:
    Mar 28, 2013
    Message Count:
    70
    Likes Received:
    31
    Trophy Points:
    50
    Yes just remove the space between Key and Event.

    Change
    public boolean onKeyDown(final int keyCode, final Key Event event)

    to
    public boolean onKeyDown(final int keyCode, final KeyEvent event)


    Also replace your Ad section ID with MY_LB_SECTION_ID
  4. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Leadbolt's SDK got updated again. V5.1 is now live.

    I was wondering, those of you who kept SDK v.4 and even v.3 in your lwps and didn't updated them to v.5 experienced any kind of issues?
    Because I have lot of lwps right now, they now show the "SDK Update Required" message, but it would take me forever to update them all!
  5. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    I have lot of live wallpaper whith Sdk 4 and have no issues until now, do not worry NewKid.
    The implementation is the same like Sdk 5 because the pdf guide didnt changed, just the jar file is new 5.1
    NewKid likes this.
  6. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    That's very good to know, thank you!
    fatos likes this.
  7. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    You are welcome;)
  8. TheShadow Active Member

    Member Since:
    Sep 12, 2012
    Message Count:
    73
    Likes Received:
    11
    Trophy Points:
    50
    Hi @NewKid can you share few of your lwps if you don't mind.i would like to see them and test it ;)
  9. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    I'm confused. I already "quick fixed" the AdController with the top option, now I want to be able to have it automatically fill in the correct package name, but which exactly line of code do I delete? <receiver android:name="com.<sdkpackagename>.AdNotification" />
    <service android:name="com.<sdkpackagename>.AdNotificationService" />
    <receiver android:name=".BootReceiver"> and once I've deleted it how will I be able to access the option to automatically change the package name to the correct one.
  10. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    k i realized I had to delete the line of coding in the bootreceiver.java and not the android manifest -_-' uh so, my question still remains how will I gain the quick fix option if I already quick fixed.
  11. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Umm, if there's nothing to fix, quickfix won't come up. You can use content assist (ctrl+space) to offer you options. So for example, type com. and then press ctrl+space. It will offer you all the available options to complete the statement. Among those you should find your package name.
    These are just little tips and tricks; you can type everything in manually!
  12. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    I typed com. then pressed ctrl+space but the only options that come up are: Abstract, class, enum, final, interface, new, nls, runnable, and toarray. Where is my package name.
  13. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Maybe you didn't import the leadbolt sdk. You can find your sdk package name in your leadbolt dashboard though.
  14. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    Okay, so I found it, but when I delete import com.<sdkpackagename>.AdController; and replace it with the leadbolt sdk it tells me the import com.leadboltsdkname is never used, and gives me 3 options: remove unused import, organize import, and add @SurpressWarnings 'unused' to 'BootReceiver'
    Am I on the right track here?
    If so, what is my next step.
  15. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100
    Are you on SDK 5 or 5.1? just curious..

    Also, can you please type here your Leadbolt's SDK package name? It seems you're still having problems setting up the bootreceiver.
  16. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    175
    Trophy Points:
    500
    Importing your SDK into the boot receiver is not enough. If it says it's not used, that means you haven't added the rest of the code into the boot receiver. Follow the instructions in the implementation guide.
  17. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100

    Yes I am, import com.ppedotsvfnsbmgzea.*;
  18. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100

    Okay, I used the implementation guide to set up the boot receiver but I'll look at it once again.
  19. NewKid Seasoned Vet

    Member Since:
    Apr 1, 2012
    Message Count:
    100
    Likes Received:
    20
    Trophy Points:
    100

    I haven't test SDK v5.1 yet, but it looks like the implementation guide is the same, so this is how your BootReceiver file should look, except of course for your Notification code. Also, I'm assuming you are just using Notification Ads, if you are using icon ads as well, then the code is a bit different.
    Check this code and see if it matches yours, you can also copy and paste it entirely, just change your LB notification code and it will work.
    And by the way, the "import com.ppedotsvfnsbmgzea.AdController;" line can be on the top like in this code bellow or in the middle as it appears in the LB PDF, it doesn't make a difference.

    Code (text):
    package com.sbg.lwc;
     
    import com.ppedotsvfnsbmgzea.AdController;
    import android.content.BroadcastReceiver;
    import android.content.Context;
    import android.content.Intent;
    public class BootReceiver extends BroadcastReceiver
    {
    public void onReceive(Context ctx, Intent intent)
    {
    //register the notification on reboot
    AdController mycontroller = new AdController(ctx, "Change_with_Your_LB_Notification_Code");
    mycontroller.loadNotification();
    }
    }
    If by pasting this code in your BootReceiver file you still get an error, then my guess is that you haven't import Leadbolt's SDK, but since lwc v2.6 targets sdk version 10 I think this is done automatically, but I'm not sure, I don't remember exactly because it's been a while since I haven't make a lwp.
    Did you import Leadbolt's sdk as it says in their PDF?

    Try this code and tell me if it worked, it should! ;)
  20. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100


    I really appreciate the help man, I did it and it worked but I am still getting the error, "Parser exception for /Name of My Live Wallpaper/AndroidManifest.xml: The value of attribute "android:name" associated with an element type "null" must not contain the '<' character." Any advice on how to get rid of that?

Share This Page