Problem Implementing Airpush SDK 6.0

Discussion in 'Advertising Discussion' started by erv79, Jun 6, 2013.

  1. erv79 New Guy

    Member Since:
    Jun 6, 2013
    Message Count:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Hello guys,

    Newbie here. I just started to use LWP to create wallpaper recently and attempting to integrate ads into the wallpaper. Airpush is currently using SDK version 6. Anyone tried it out yet?

    If anyone has implemented it, hopefully can give some advice.

    I am going through the SDK 6.0 documentation here:

    http://www.airpush.com/docs/index.php?title=Android_SDK_6.0_Documentation#Step_1_-_Adding_the_JAR

    I am stuck at the Installation Instructions Step 1 – Adding the JAR

    I followed the instructions, but I just can’t get the JAR file to show up in the Android Dependencies folder as shown in the guide. Btw, I am using ADT Version: v22.0.0-675183

    Thanks
  2. Sam Keeps coming back

    Member Since:
    Jun 3, 2013
    Message Count:
    14
    Likes Received:
    5
    Trophy Points:
    10
    You can use the same old way to set the jar file into your project .
  3. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    Right click on the jar then go to Build Path>Add to Build Path.
  4. erv79 New Guy

    Member Since:
    Jun 6, 2013
    Message Count:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Thanks for the reply guys. I managed to reach the last step but got stuck again here:

    (Important: For push notifications, the developer needs to copy the airpush_notify.xml file that's included along with the SDK download to the project layout folder. The developer must not make any changes to this file)

    This is where I copied the airpush_notify.xml file: project folder > res > layout

    This error code appeared at the xml file (see attached screenshot):
    error: Error: No resource found that matches the given name (at 'src' with value '@drawable/ic_launcher').

    Attached Files:

  5. Sam Keeps coming back

    Member Since:
    Jun 3, 2013
    Message Count:
    14
    Likes Received:
    5
    Trophy Points:
    10
    in the "drawable" folder please check an image named "ic_launcher" .
    If there is not such named images then use any notification size image rather than that image and specify the name in the XML .
    Maximus likes this.
  6. erv79 New Guy

    Member Since:
    Jun 6, 2013
    Message Count:
    4
    Likes Received:
    1
    Trophy Points:
    0
    There are a few images in the "drawable" folder: icon.png, lwc_logo.png, and images of items selected from the items library in LWP.

    I have tried using all of them and specifying the name in the airpush_notify.xml file. I have even tried copying and pasting the ic_launcher.png from the sample project included in the SDK download. But, a new error code will now appear in the manifest.xml file which is related to the Airpush sdk.
    error: Error: String types not allowed (at 'configChanges' with value 'orientation|screenSize').

    I am sending an email to their support to see their response.

    Thanks
  7. Jovan Active Member

    Member Since:
    May 5, 2013
    Message Count:
    50
    Likes Received:
    2
    Trophy Points:
    50
    Hi Erv,
    I found solution few days ago. You have tutorial from some French I think. Just follow that and follow airpush sdk instructions and you will I hope succeed.
    Maybe there you will find one error line in airpush_notify.xml just delete that line if you get error there.
    The tutorial is on
  8. erv79 New Guy

    Member Since:
    Jun 6, 2013
    Message Count:
    4
    Likes Received:
    1
    Trophy Points:
    0
    Hi Jovan, the tutorial is for the SDK 5.0. The problem i faced is specific to SDK 6.0. Anyway I emailed the LWC team and got a reply. For those who are facing the same problem integrating Airpush SDK 6.0, here's the reply from Vas:


    "You won't be able to use android:configChanges attribute unless your project minSdkVersion is at least API 13. So you can either change your project's minimum and target SDK versions, or remove the conflicting parameter from the manifest. I wouldn't worry about it though, as it seems to be some minor screen orientation parameter; not a game-breaker by any means."

    So, in conclusion, just remove this line of code:
    android:configChanges="orientation|screenSize"
    Maximus likes this.
  9. Maximus Seasoned Vet

    Member Since:
    Jan 16, 2012
    Message Count:
    122
    Likes Received:
    40
    Trophy Points:
    100

    Awesome, thanks for posting this Erv!
  10. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    Hi all,

    I'm glad to know that you guys discuss about how to implement Airpush SDK 6.0.
    I use Airpush implement on my wallpaper for monetize. There is no problem for previous SDK version but I'm stuck on this version.

    All the code are different and I'm getting confuse.
    On the "Errors when exporting to Eclipse" room, I was ask about my problem and Vas on his way to help me.
    Can anyone help me?

    I will re-post my problem from that room here...Sorry for spamming :(

    Hope that someone can help me out.
    Thanks a lot.

    God bless..
  11. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    I've update my 2.1 LWC and then tried to create new wallpaper. Everything is okay.
    Then I have to export to Eclipse in order to implement ads code, in this case I use Airpush.
    I was faced some problem:
    1. The package name inside "src" is wrong. It named as "com.sbg.lwc". On 2.1, the package name generated automatically as the apk name, for example "jelly.lwp". This create many errors. Please help :(
    The difference found on the folder structure:
    [2.1] .../archive/company_name/lwp_name/source/src/company_name/package-name
    [2.6].../archive/company_name/lwp_name/source/src/com/sbg/lwc ---> so, my package name become "com.sbg.lwc".

    2. There is an error on the airpush_notify.xml. Said that:
    "Description: error: Error: No resource found that matches the given name (at 'src' with value '@drawable/ic_launcher').
    Resource: airpush_notify.xml
    PathLocation: /LiveWallpaperSettings/res/layoutline 31
    Type: Android AAPT Problem"

    I'm stuck on this step. Please help me :(

    And I was notice that the manifest have many difference with the [2.1] but there is no tutorial available for [2.6].
    Since I'm not good in programming, I'm totally confuse...
    I'm going crazy because both of LWC and Airpush have new SDK and I have to edit all but found lot of errors.
    Can someone please help me? I really need it's working soon :'(



    VAS REPLY:
    1. What errors are you getting?

    2. ic_launcher is usually a reference to the icon file. In LWC wallpapers, the icon is called icon. So the xml file should reference to it accordingly: @drawable/icon. Make the change and the error will go away.


    ME:
    1. Here are the errors (I've categorize the error based on their location on "scr":

    Description: R cannot be resolved to a variable
    Resource: LiveWallpaperSettings.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 138 (and many more)
    Type: Java Problem

    Description: R cannot be resolved to a variable
    Resource: SBLiveWallpaper.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 226 (and many more)
    Type: Java Problem

    Description: The import zhuangaifen.wildowl.R cannot be resolved
    Resource: SBLiveWallpaper.java
    Path: /LiveWallpaperSettings/src/com/sbg/lwc
    Location: line 6
    Type: Java Problem

    FYI, for this case, my company name is "zhuangaifen" and my lwp name is "wild owl".

    I've tried your suggestion to Azumi above but it's not working.
    Please help me Vas...I think, it is because of the package name is not same but we can't refactor-rename manually. It should generate automatically then Eclipse will catch the data.
    package_name.png

    Please help me guys...Thanks...
  12. virajith Active Member

    Member Since:
    Dec 2, 2012
    Message Count:
    71
    Likes Received:
    10
    Trophy Points:
    50
    hey 1st u need to correct any error in res folder

    then that error will go :)

    always use same package same from AndroidManifest.xml
  13. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    Can I edit it manually?
    By rename the folder to force the Eclipse generate the correct package name?
    I saw many people here post about similar problem and the errors contain "com.sbg.lwp"...is it a bug or something?
    Thank you for answering :)
  14. virajith Active Member

    Member Since:
    Dec 2, 2012
    Message Count:
    71
    Likes Received:
    10
    Trophy Points:
    50
    u can rename it , u wont even get errors

    also u need to use same package name in AndroidManifest.xml
    btw eclipse does this automatically
  15. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    I get this warning, Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this
    version. Consult the android.os.Build.VERSION_CODES javadoc for details.

    on this line of code.

    I followed the AirPush code implementation on youtube and then exported my Live wallpaper but when I go to load it up on my android device to test it... it says, "Unfortunately, Dragon Ball Live Wallpaper has stopped." This is only when I put the airpush code in. Help.

    I also get this warning.. "The value of the local variable scaleFactor is not used" on this line of code // assume to use high resolution image
    float scaleFactor = sfHigh;
    int res = R.drawable.wallpaper_hdpi;

    if (sfHigh > sfMid) { // use mid resolution image
    scaleFactor = sfMid;
    res = R.drawable.wallpaper_mdpi;
  16. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    Yellow warnings don't break your application. They usually point to some sort of redundancy in the code.
    Joshua likes this.
  17. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    What about this. <uses-sdk android:minSdkVersion="10" android:targetSdkVersion="17"/> (Not targeting the latest versions of Android; compatibility modes apply. Consider testing and updating this
    version. Consult the android.os.Build.VERSION_CODES javadoc for details.)
    Same thing applies?

    Also. I'm trying to add the airpush_notify.xml to the layout folder. But, it gives me an error Please help me.
  18. Vas Origin

    Member Since:
    Jan 4, 2012
    Message Count:
    770
    Likes Received:
    167
    Trophy Points:
    500
    Yes. It's not an issue.
  19. Ai Fen Keeps coming back

    Member Since:
    Jul 13, 2013
    Message Count:
    23
    Likes Received:
    2
    Trophy Points:
    10
    Can someone tell me how to implement smartwall anytime user go to Setting, please?
    I just implement on the onCreate procedure but it seems like not maximal...thanks...
  20. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    Vas, now everytime I go to launch my program on my android device it crashes, sup with that? I renamed the icon.png as ic_launcher.png

    this is the crash.

    Exception class name
    java.lang.ClassNotFoundException

Share This Page