SlideShare ist ein Scribd-Unternehmen logo
1 von 7
Downloaden Sie, um offline zu lesen
Airpush Android SDK
     Installation Instructions
Airpush Android SDK Installation Instructions
Airpush Android SDK contains the code necessary to install Airpush ads in your application. This PDF will guide
you through a simple XML implementation.

NOTE: you will need to replace all instances of <appid>, <package name> and <apikey> with your actual
application id, package name and api key which is obtainable from Airpush portal.




Step 1 – Adding the JAR
Copy the Airpush JAR file (AirpushSDK.jar) in your project's root directory.


For Eclipse projects:
    • Right-click on your project from the Package Explorer tab and select “Properties”
    • Select “Java Build Path” from the left panel
    • Select “Libraries” tab from the main window
    • Click on “Add JARs...”
    • Select the JAR that's been copied to the project's root directory
    • Click “OK” to add the SDK to your Android project
Step 2 – Editing Your Manifest File
First you will need to note your Airpush <appid> It was given to you when registering your Android application
on www.airpush.com (in Step 3). It is a numeric code and can be found by locating your app in the apps
dashboard.




Just before the closing </application> tag of your AndroidManifest.xml file, you will need to add three things:




1: Copy and paste the following XML just before the closing </application> tag:

        <!-- Airpush Code Start-->
        <activity android:name="com.airpush.android.PushAds"
              android:configChanges="orientation|keyboardHidden"/>
          <receiver android:name="com.airpush.android.UserDetailsReceiver"/>
          <receiver android:name="com.airpush.android.MessageReceiver" />
          <receiver android:name="com.airpush.android.DeliveryReceiver" />
          <receiver android:name="<Package Name>.BootReceiver">
        <intent-filter>
        <action android:name="android.intent.action.BOOT_COMPLETED" />
        <category android:name="android.intent.category.HOME" />
        </intent-filter>
        </receiver>

        <service android:name="com.airpush.android.PushService">
                  <intent-filter>
                  <action android:name="com.airpush.android.PushServiceStart<Your
appId>"/>
                  </intent-filter>
      </service>
      <!-- Airpush Code End-->

    * Please replace <Package Name> with your “package name” where boot reciever class has been added
    (given in Step-4)
2: Add Following Permissions:

      <uses-permission android:name="android.permission.INTERNET" />
      <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
      <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
      <uses-permission android:name="android.permission.READ_PHONE_STATE" />
      <uses-permission android:name="android.permission.VIBRATE"/>(Optional But
Highly recommended to enhance your revenue stream)
 <uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION"/>(Optional But Highly
recommended to enhance your revenue stream)
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>(Optional
But Highly recommended to enhance your revenue stream)
Step 3 – Editing your main file.
Inside onCreate() method, please add :

new Airpush(getApplicationContext(), "<appid>","<apikey>");

Note: If your application supports android version 1.5 or below, please initialize the sdk as given below:

                 if(Integer.parseInt(VERSION.SDK) > 3){
                      new Airpush(getApplicationContext(),"<appid>","<apikey>");
                }

You can either generate an <apikey> from permission API page or use “airpush” as API key.
Step 4– Setting Boot Receiver
If you don't have any boot receiver class in your application, Create one with name bootreceiver.java and add
the code given below or you can also use the example class file given along with SDK


                import   android.content.BroadcastReceiver;
                import   android.content.Context;
                import   android.content.Intent;
                import   com.airpush.android.Airpush;

                public class BootReceiver extends BroadcastReceiver {

                     public void onReceive(Context arg0, Intent arg1) {
                       if(Integer.parseInt(VERSION.SDK) > 3){
                             new Airpush(arg0,"<appid>","<apikey>");
                       }
                     }

                }




Or if you already have any boot receiver in your application add below code in your boot receiver.


                new Airpush(context,"<appid>","<apikey>");
Step 5 – Setting Test Mode
While integrating Airpush SDK into your application it is recommended that you use test mode. This will help you
verify that your application is working fine with integrated SDK and test ads are returned every few minutes on
an emulator or real device before publishing your app to Android Market. To enable test mode, please include
the Boolean parameter while initializing Airpush as illustrated in the code below:

                new Airpush(getApplicationContext(), <appid>,                    <apikey> , true);

Once you have verified SDK installation, you can turn test mode off by removing the Boolean parameter.
You can either generate an <apikey> from permission API page or use “airpush” as API key.




Sample Application Code and Support:
Included with this SDK is an Airtest Example Project (Airtest.rar) and in case of any issues integrating SDK,
please feel free to contact publishersupport@airpush.com


* Please note, for the privacy of your users Airpush never stores personally identifiable information. Our
SDK encrypts all IMEI numbers using md5 hashing.

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 

Kürzlich hochgeladen (20)

SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Fostering Friendships - Enhancing Social Bonds in the Classroom
Fostering Friendships - Enhancing Social Bonds  in the ClassroomFostering Friendships - Enhancing Social Bonds  in the Classroom
Fostering Friendships - Enhancing Social Bonds in the Classroom
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Empfohlen

Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
Kurio // The Social Media Age(ncy)
 

Empfohlen (20)

Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 

Airpush sdk

  • 1. Airpush Android SDK Installation Instructions
  • 2. Airpush Android SDK Installation Instructions Airpush Android SDK contains the code necessary to install Airpush ads in your application. This PDF will guide you through a simple XML implementation. NOTE: you will need to replace all instances of <appid>, <package name> and <apikey> with your actual application id, package name and api key which is obtainable from Airpush portal. Step 1 – Adding the JAR Copy the Airpush JAR file (AirpushSDK.jar) in your project's root directory. For Eclipse projects: • Right-click on your project from the Package Explorer tab and select “Properties” • Select “Java Build Path” from the left panel • Select “Libraries” tab from the main window • Click on “Add JARs...” • Select the JAR that's been copied to the project's root directory • Click “OK” to add the SDK to your Android project
  • 3. Step 2 – Editing Your Manifest File First you will need to note your Airpush <appid> It was given to you when registering your Android application on www.airpush.com (in Step 3). It is a numeric code and can be found by locating your app in the apps dashboard. Just before the closing </application> tag of your AndroidManifest.xml file, you will need to add three things: 1: Copy and paste the following XML just before the closing </application> tag: <!-- Airpush Code Start--> <activity android:name="com.airpush.android.PushAds" android:configChanges="orientation|keyboardHidden"/> <receiver android:name="com.airpush.android.UserDetailsReceiver"/> <receiver android:name="com.airpush.android.MessageReceiver" /> <receiver android:name="com.airpush.android.DeliveryReceiver" /> <receiver android:name="<Package Name>.BootReceiver"> <intent-filter> <action android:name="android.intent.action.BOOT_COMPLETED" /> <category android:name="android.intent.category.HOME" /> </intent-filter> </receiver> <service android:name="com.airpush.android.PushService"> <intent-filter> <action android:name="com.airpush.android.PushServiceStart<Your appId>"/> </intent-filter> </service> <!-- Airpush Code End--> * Please replace <Package Name> with your “package name” where boot reciever class has been added (given in Step-4)
  • 4. 2: Add Following Permissions: <uses-permission android:name="android.permission.INTERNET" /> <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /> <uses-permission android:name="android.permission.READ_PHONE_STATE" /> <uses-permission android:name="android.permission.VIBRATE"/>(Optional But Highly recommended to enhance your revenue stream) <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/>(Optional But Highly recommended to enhance your revenue stream) <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>(Optional But Highly recommended to enhance your revenue stream)
  • 5. Step 3 – Editing your main file. Inside onCreate() method, please add : new Airpush(getApplicationContext(), "<appid>","<apikey>"); Note: If your application supports android version 1.5 or below, please initialize the sdk as given below: if(Integer.parseInt(VERSION.SDK) > 3){ new Airpush(getApplicationContext(),"<appid>","<apikey>"); } You can either generate an <apikey> from permission API page or use “airpush” as API key.
  • 6. Step 4– Setting Boot Receiver If you don't have any boot receiver class in your application, Create one with name bootreceiver.java and add the code given below or you can also use the example class file given along with SDK import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; import com.airpush.android.Airpush; public class BootReceiver extends BroadcastReceiver { public void onReceive(Context arg0, Intent arg1) { if(Integer.parseInt(VERSION.SDK) > 3){ new Airpush(arg0,"<appid>","<apikey>"); } } } Or if you already have any boot receiver in your application add below code in your boot receiver. new Airpush(context,"<appid>","<apikey>");
  • 7. Step 5 – Setting Test Mode While integrating Airpush SDK into your application it is recommended that you use test mode. This will help you verify that your application is working fine with integrated SDK and test ads are returned every few minutes on an emulator or real device before publishing your app to Android Market. To enable test mode, please include the Boolean parameter while initializing Airpush as illustrated in the code below: new Airpush(getApplicationContext(), <appid>, <apikey> , true); Once you have verified SDK installation, you can turn test mode off by removing the Boolean parameter. You can either generate an <apikey> from permission API page or use “airpush” as API key. Sample Application Code and Support: Included with this SDK is an Airtest Example Project (Airtest.rar) and in case of any issues integrating SDK, please feel free to contact publishersupport@airpush.com * Please note, for the privacy of your users Airpush never stores personally identifiable information. Our SDK encrypts all IMEI numbers using md5 hashing.