Category: Developers Corner

Android Tutorials | How to add banner ads with Facebook Audience Network

Manifest: <uses-permission android:name=”android.permission.INTERNET” /> <uses-permission android:name=”android.permission.ACCESS_WIFI_STATE” /> <uses-permission android:name=”android.permission.ACCESS_NETWORK_STATE” /> build.gradle – dependency implementation ‘com.facebook.android:audience-network-sdk:5.11.0’ Layout <LinearLayout android:id="@+id/banner_container" android:layout_width="match_parent" android:layout_height="wrap_content" android:layout_alignParentBottom="true" android:orientation="vertical" app:layout_constraintBottom_toBottomOf="parent" /> Source Code import com.facebook.ads.AudienceNetworkAds; import com.facebook.ads.*; private NativeBannerAd nativeBannerAd; oncreate() AudienceNetworkAds.initialize(this); adView = new AdView(this, "415395656050XXX_649219926001XXX", AdSize.BANNER_HEIGHT_50); // Find the Ad Container LinearLayout adContainer = (LinearLayout) findViewById(R.id.banner_container); // Add the ad

How to read JSON data and display in HTML

<!DOCTYPE html> <html> <body> <script> var xmlhttp = new XMLHttpRequest(); xmlhttp.onreadystatechange = function() { if (this.readyState == 4 && this.status == 200) { // document.write(this.responseText+”<hr>”); var myObj = JSON.parse(this.responseText); for(var i = 0 ; i < myObj.score.length ; i++) { document.write(myObj.score[i].user_name + ” ” + myObj.score[i].total_score + “<br />”); } } }; xmlhttp.open(“GET”, “all-time-json.php”, true);

Gradle | Android

It is sometimes very difficult to debug your app if the settings in gradle are incorrect. You can find a sample of the latest gradle settings that I am using for your reference. build.gradle (Project: xyz) // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { repositories { jcenter()

How to send an HTML email using PHP?

<?php $to = “somebody@example.com, somebodyelse@example.com”; $subject = “HTML email”; $message = ” <html> <head> <title>HTML email</title> </head> <body> <p>This email contains HTML Tags!</p> <table> <tr> <th>Firstname</th> <th>Lastname</th> </tr> <tr> <td>ABCD</td> <td>EFGH</td> </tr> </table> </body> </html> “; // Always set content-type when sending HTML email $headers = “MIME-Version: 1.0” . “\r\n”; $headers .= “Content-type:text/html;charset=UTF-8” . “\r\n”;

Developers Corner

Q. How to load content while scrolling any website? A. jScroll is a jQuery plugin for infinite scrolling. Infinite scrolling; also known as lazy loading, endless scrolling, autopager, endless pages, etc.; is the ability to load content via AJAX within the current page or content area as you scroll down. The new content can be