Start App Search box integration

Discussion in 'Tutorials' started by Eraste, Sep 27, 2013.

  1. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    Here I will show you how to put the start app search box into your splash screen and live wallpaper settings screen. This tutorial assumes you already have a working splash screen! And will only pertain to start apps search box PPD ( pay per download) ad unit. All the things ( code ) written in this tutorial is included in the files you will receive from start app and the attached zip file in PDF format.

    * Disclaimer - Modifying the contents, code, workings of an app, device, phone, software, computer, can lead to great headache and malfunction! I am not responsible if you destroy any of the above named things during your endeavors. You follow this tutorial on your own and accept all risk in doing so. Please read, re read, the tutorial and make sure you place lines of codes in the correct spots!

    Things you will need:
    Eclipse with an understanding of how it and Google/java code works.
    Your app files
    The start app search box sdk files attached to this post

    First download the attached zip files containing the sdks, Alternatively you can download the needed files after setting up your app in the start app console ( this page will also now show you your app id and developer id needed below).

    Open you app in eclipse and open the AndroidManifest.xml file and add the following permissions, if they are already present you can skip this step:
    Code (text):

        <uses-permission android:name="android.permission.INTERNET"/>
        <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
        <uses-permission android:name="android.permission.READ_PHONE_STATE" />
        <uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
        <uses-permission android:name="android.permission.WAKE_LOCK" />
    Then Add the 3 .jar SDK files you will receive in your download from start app or the ones contained in the attached zip file to your libs folder. When adding them to your libs folder make sure you choose copy files and not link to files.

    Next add the EULA activity to your AndroidManifest.xml file under the application tag before it closes: This is required your pay is dependent on it I believe. User clicks accept you make money user clicks reject you dont.
    Code (text):
    <activity android:name="com.startapp.android.eula.EULAActivity"
    android:theme="@android:style/Theme.Translucent"
    android:configChanges="keyboard|keyboardHidden|orientation" />
    Next add the meta data code lines to your AndroidManifest.xml file ( i put mine right under the EULA activity) under the application tag before it closes.:
    Code (text):
    <meta-data android:name="com.startapp.android.DEV_ID" android:value="<Your Developer ID>"/>
    <meta-data android:name="com.startapp.android.APP_ID" android:value="<Your App ID>"/>
    You will need to get your developer ID and app ID from the start app console. After adding your developer id and app id numbers to the meta data code lines you can save and close the AndroidManifest.xml file.

    Now you will want to open your Splash.java and LiveWallpaperSettings.java files.
    In your Splash.java file under this line:
    Code (text):
    setContentView(R.layout.splash);
    Place this code:
    Code (text):
    StartAppSearch.init(this);
    StartAppSearch.showSearchBox(this);
    In your LiveWallpaperSettings.java file under this line:
    Code (text):
    super.onCreate(b);
    Place this code:
    Code (text):
    StartAppSearch.init(this);
    StartAppSearch.showSearchBox(this);
    After adding the above code you may see some red line errors, If so hover over them with the mouse pointer and when given options select import the startapp sdk. Save both of the files. Build your app and try it out. When you open your app with the icon in the app drawer and you are taken to the splash screen you should see the Startapp EULA screen. You must accept these terms to see the search box.

    If you are having issues with the search box in the Splash.java file move this line:
    Code (text):
    StartAppSearch.init(this);
    Under this line:
    Code (text):
    super.onCreate(savedInstanceState);
    You shouldn't have any issues with it though.

    When you load the app and enter the splash screen you will see a little white/silver tab on the left hand side of the screen, swipe it to the right to reveal the search box. Swipe it to the left to hide the search box.

    Good Luck!

    Attached Files:

    Friendlyspeaking and fatos like this.
  2. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    Works very well, thanks Eraste:)

    Im using a banner and floating ads from Leadbolt and after I implemeted Search box from StartApp now is showing just Serach box and Leadbolt banner, if banner isnt shown then floating ads comes up, but not three of them.

    Thanks SuperEraste
  3. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    Worked great, really appreciate this tutorial. Could you do tutorial for InApp and Post Call Manager ads?
  4. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    After you completed this tutorial if anyone wants to add a 3D Banner from StartApp just add the following code in splash.xml .If you want to display at the bottom then just copy paste the code right above </LinearLayout> tag.

    PHP:
    <com.startapp.android.publish.banner.banner3d.Banner3D
            android:id="@+id/startApp3DBanner"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content" />
    If you want another banner at the top of splash screen add it again the same code right above <TextView
    Joshua likes this.
  5. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    Know how to implement interstitial ads on the splash screen and settings menu?
  6. fatos LWC Major

    Member Since:
    Apr 2, 2013
    Message Count:
    268
    Likes Received:
    73
    Trophy Points:
    200
    Actually I didnt try to do it yet, but I will try
  7. Joshua Seasoned Vet

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

    iight cool thanks man
  8. Joshua Seasoned Vet

    Member Since:
    Jul 12, 2013
    Message Count:
    116
    Likes Received:
    16
    Trophy Points:
    100
    Would we have to create a livewallpapersettings.xml to be able to add the 3D banner ads in the settings menu as well?
  9. Eraste Seasoned Vet

    Member Since:
    Jan 26, 2013
    Message Count:
    159
    Likes Received:
    76
    Trophy Points:
    100
    The 3D banner ads would require an additional .xml file but the other ad types do not.
    fatos likes this.

Share This Page