How to Monetize Your Android App with MobFox Network


     Making money from your app is not a nightmare if your app has enough users. Generally, many developers give up after seeing a dramatic variation of eCPM and RPM. There are many ways to boost your ad revenue from low rpm. If you search in Google "App Monetization", a huge list of ad networks will show within a few seconds. You might have noticed that many app monetization networks offering maximized eCPM and high revenue but it is a bit difficult to choose from hundreds ofapp monetization networks. In this app monetization tutorial we will discuss about MobFox network, and How to implement ads to your app.
How to Monetize Your Android App with MobFox Network
About MobFox
MobFox offers banner ads, interstitial ads, and fully customizable native ads. One of the great things about this platform is it comes with open source SDK. You can work seamlessly with Android and iOS SDKs. Over 30+ ad networks are integrated by default besides you can easily add support for new networks. You have full control over your ads, unwanted ads can be blocked by efficient filters.
Prerequisites for MobFox implementation

1. You must have a MobFox account.
2. MobFox SDK for Android.

Integrate Google play services using Android Studio
Open the build.gradle from your application module directory
Add a new build rule like below
apply plugin: 'com.android.application'
    ...

    dependencies {
        compile 'com.google.android.gms:play-services:7.x.x'
    }
Note : Version number may change each time when Google Play services is updated.
Save your project and Click Sync Project with Gradle Files
Done.

Getting started with MobFox

Login to your account https://account.mobfox.com
Create a new app from Publisher section (Make sure that you have selected Android as platform)
Copy your Inventory Hash (a unique publisher id)

Integrate into your Android Project

Download MobFox SDK for Android
http://sdk.starbolt.io/MobFox-Android-SDK.zip
Unzip SDK and copy AdSdk_7.0.1.jar and simple-xml-2.7.1.jar to libs folder of your project.
Update manifest file as below

<uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
    
    <uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
Add Google Play services Meta tag under Application tag
<meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" />

Add the following activities

<!-- mobfox ads -->
        <activity android:name="com.adsdk.sdk.banner.InAppWebView" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <activity android:name="com.adsdk.sdk.video.RichMediaActivity" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" android:hardwareAccelerated="false" />
        <activity android:name="com.adsdk.sdk.mraid.MraidBrowser" android:configChanges="keyboard|keyboardHidden|orientation|screenLayout|uiMode|screenSize|smallestScreenSize" />
        <!-- ends -->
Save the file.
Show banner Ad using XML (Direct Ad)

Create an activity called TestAdMobFox open the corresponding xml file, add the Banner AdView.
XML layout
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:layout_width="match_parent" android:layout_height="match_parent" tools:context="${relativePackage}.${activityClass}" >

     <com.adsdk.sdk.banner.AdView android:id="@+id/mobFoxView" android:layout_width="300dp" android:layout_height="50dp" android:layout_alignParentRight="true" adspaceHeight="50" adspaceStrict="true" adspaceWidth="320" animation="true" location="true" publisherId="ENTER_YOUR_HASH" request_url="http://my.mobfox.com/request.php" android:background="#000000" />

     <Button android:id="@+id/button1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@+id/mobFoxView" android:layout_centerHorizontal="true" android:layout_marginTop="71dp" android:text="ShowAdMe" />

</RelativeLayout>
You need to assign an Inventory Hash to publisherId. Run your project, you could see the test banner, live ad will show only if your app is approved.
MobFox Interstitial Ad
You can initialize interstitial ad,
mManager = new AdManager(this, "http://my.mobfox.com/request.php","ENTER_HASH", true);
            mManager.setInterstitialAdsEnabled(true);
            mManager.setListener(this);
mManager.requestAd();

To show the Ad, call showAd() method.
Full Code TestAdMobFox.java

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;
import com.adsdk.sdk.Ad;
import com.adsdk.sdk.AdListener;
import com.adsdk.sdk.AdManager;
public class TestAdMobFox extends Activity implements AdListener {
 private AdManager mManager;
 private Button s;
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_test_ad_mob_fox);
  s=(Button)findViewById(R.id.button1);
  mManager = new AdManager(this, "http://my.mobfox.com/request.php","ENTER_HASH", true);
  mManager.setInterstitialAdsEnabled(true); 
  mManager.setListener(this);
  mManager.requestAd();
    
  s.setOnClickListener(new OnClickListener() {
   
   @Override
   public void onClick(View arg0) {
    // TODO Auto-generated method stub
    if (mManager != null && mManager.isAdLoaded())
    {
     mManager.showAd();
    }
    else
    {
     Toast.makeText(getApplicationContext(), "Failed to load Ad", Toast.LENGTH_SHORT).show();
    }
   }
  });
  
 }
 @Override
 public void adClicked() {
  // TODO Auto-generated method stub
  
 }
 @Override
 public void adClosed(Ad arg0, boolean arg1) {
  // TODO Auto-generated method stub
  
 }
 @Override
 public void adLoadSucceeded(Ad arg0) {
  // TODO Auto-generated method stub
  
 }
 @Override
 public void adShown(Ad arg0, boolean arg1) {
  // TODO Auto-generated method stub
  
 }
 @Override
 public void noAdFound() {
  // TODO Auto-generated method stub
  
 }
}

MobFox Android Test Ad

Google Wallet India Debit Card Support : Google Play Account, App purchase Tips


Google wallet India debit card support

Google wallet is an electrifying payment method from Google.Google shows India on their wallet supported list.
Google Wallet Supported Country List. Google Wallet aims big market on online purchases. Most of the payment required Google Services use Google Wallet like Android Developer account, Chrome Extension account, etc. You can make purchases via Google Wallet using credit card or signature debit card.Google wallet supports visa, master card, American Express(USD only) and Discover (USD only). Before you go for wallet, you must have a Google account. You can add multiple credit or debit card for payment option. Google provides hassle free payment option over internet. You can make phone as wallet with Google Wallet.
Google Wallet India Debit Card Support

Google Wallet Support India
All credit cards from India are supported Wallet. Indian Debit card does not support Google wallet. I have got many queries about Google wallet debit card support. Some people say it is not possible with Google India. Its not true. You can make payment via wallet, and also you can make Google developer account for android and chrome extensions.

Google Android Developer account with Debit Card

if you are from India, your debit card should have global privilege. Indian debit cards declined for purchasing google product with checkout / wallet. If you want to purchase product / service from google, you can use entropay virtual credit card to make purchase product from google.
Google Wallet Debit card supported Banks

Bank (Visa/MASTER CARD DEBIT CARD)
Wallet / Checkout Support
State Bank Of India
No
City Union Bank
No
AXIS Bank
No
South Indian Bank
No
ICICI Bank
Yes
IDBI Bank
No

Google wallet India debit card declined

If you are going for a Google play purchase, definitely Google asks for Google wallet login/registration. You must have bank account with debit card / credit card. You have to check the debit card is supported or not before going to make purchase in Google play. You may charge less than 5 rupees if any failure occurred during the payment method for developer account or application purchase. That means your debit card does not support it well. Google wallet may deny if you don't have sufficient funds in your account. You should have enough money in your account for purchasing.
Which devices support Google Wallet?
All phones do not support Google Wallet Service. Now Google Wallet with tap and pay service only available in the USA. The phone should have NFC feature. Google Wallet does not support devices purchased internationally. Unlocked device does not work with Google Wallet.

Google Wallet Supported Devices

·    HTC One on Sprint
·    LG Nexus 4
·    Samsung Galaxy S4
·    Samsung Nexus S 4G
·    HTC EVO 4G LTE
·    Samsung Galaxy Note II
Tablet
·    Asus Nexus 7
·    Samsung Nexus 10

Does Google Wallet Payment Method work in India?


Obviously, Not! It supports only USA, over 140,000 merchants across the United States.
Google Wallet is free Android application that comes with NFC support. Eligible devices provide rich payment method for purchases. Your smartphone acts as a virtual wallet. So you can make purchases at any contact less payment terminal using virtual version of credit and credit cards.

Android supported HTML Tags : How to Parse String with HTML Tags



HTML support of TexView will add glossy look to your web app. You can't avoid html tags when you working with native web capabilities like hyper-link on text, bold text etc. You may familiar with textview but have you tried any HTML tag along with it.


Android supported HTML Tags
This tutorial discusses how to use html tags in TextView of android app. If you want to use any HTML tag dynamically in android you should import a package android.text.Html.
I consistently notice amongst few fellow android developers who follow HTML tags well in TextView. Let me paint some examples for you.

Android Supported HTML Tags : strings.xml

·    <big></big>
·    <small></small>
·    <bold></bold>
·    <strike></strike>
·    <a href=””></a>
·    <sup></sup>
·    <sub></sub>
·    <u></u>
·    <i></i>
·    <tt></tt>

Example: strings.xml

<?xml version="1.0" encoding="utf-8"?>
    <resources>
    <string name="HtmlData">
        <big>Hello Iam Big</big> \n
        <small>Iam Small</small>  \n
        <b>Iam bold</b> \n
        <strike>Vanish 100$</strike>\n
        <a href="http://bigknol.com">Goto Bigknol</a>
        X<sub>2</sub>Y \n
        X<sup>30</sup>Z \n
        <u>Underline</u> \n
        <i>Hi Five </i> \n
        <tt>Hi Six</tt>\n
   </string>
   </resources>
HtmlTest.java


import android.app.Activity;
import android.os.Bundle;
import android.text.Html;
import android.view.Menu;
import android.widget.TextView;

public class HtmlTest extends Activity {

 TextView dynamicHTML;
 @Override
 protected void onCreate(Bundle savedInstanceState) {
  super.onCreate(savedInstanceState);
  setContentView(R.layout.activity_html_test);
     dynamicHTML=(TextView)findViewById(R.id.dynamicHTML);
  dynamicHTML.setText(Html.fromHtml("<font color='red'>I like bigknol</font><br />" +
    "<strong>Strong Data</strong><br />" +
    "<tt>Moving</tt><br />"));

 }

 @Override
 public boolean onCreateOptionsMenu(Menu menu) {
  // Inflate the menu; this adds items to the action bar if it is present.
  getMenuInflater().inflate(R.menu.activity_html_test, menu);
  return true;
 }

}
activity_html_test.xml

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".HtmlTest" >

    <TextView
        android:id="@+id/Data"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_centerHorizontal="true"
        android:layout_centerVertical="true"
        android:text="@string/HtmlData" />

    <TextView
        android:id="@+id/dynamicHTML"
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:layout_alignLeft="@+id/Data"
        android:layout_below="@+id/Data"
        android:layout_marginTop="16dp"
        android:text="TextView" />

</RelativeLayout>

JSP MySQL Eclipse JEE Development Tutorial



Eclipse JEE IDE development tutorial is for absolute beginners.
Prerequisite for JSP/MySQL Application with Eclipse JEE Kepler.
Download and Install MySQL Server 5.5 on your Windows Machine
Install Tomcat Server6.0( 32-bit windows zip)
Download MySQL Connector/j for connecting JSP to 
MySQL Server.(mysql-connector-java-5.1.25.zip, Platform Independent (Architecture Independent))
Download Eclipse IDE for Java EE Developers 32 bit windows And unzip it
JSP MySQL Eclipse JEE Development Tutorial

Create a database and Table using MySQL : Open cmd prompt (Windows+R and Type 'cmd') or use

MySQL 5.5 Command line client. Change directory to MySQL Server 5.5 installed Path. (In this

example path looks like : C:\mysql\MySQL Server 5.5\bin>)
Create a new user in MYSQL Sever
mysql -u <user-name> -p
enter password: *****
 You can use root if you have super user privilege, or create a new user in MySQL, to create a new user:
CREATE USER 'nikisurf'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'nikisurf'@'localhost';
Login as a new user
mysql -u nikisurf -p
Create a new Database db and Selecting Database
CREATE DATABASE db;
USE db;
Create a new Table in MySQL called 'info'
CREATE TABLE info(username varchar(25),password varchar(25),
firstname varchar(25),lastname varchar(25),
address varchar(25),pincode int,phonenumber int);



Open Eclipse
Click eclipse.exe file from unzipped folder and set a work-space(location of projects)
Create a new Dynamic Web Project
File => New => Dynamic Web Project, and give Project name as ‘Info’ click Next
 again Next Finish.
Connect MySQL to JSP with Eclipse Kepler
Add Library : MySQL Connector/j
 Unzip mysql-connector-java-5.1 and select mysql-connector-java-5.1.23-bin.jar file and drag and drop into the Project explorer of the Eclipse(info => WebContent => WEB-INF => lib).
Start Coding
 Right Click on Info from Project Explorer => New => HTML File (Give Name as index.html)
index.html

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<h1>Add Info</h1>
<form action="add.jsp" method="post">
User name : <input type="text" name="username" /><br />
password : <input type="password" name="password" /><br />
First name :<input type="text" name="firstname" /><br />
Last name :<input type="text" name="lastname" /><br />
address :<textarea cols="10" rows="15" name="address">
</textarea><br />
Pin code <input type="text" name="pincode" /><br /> <br />
phone number <input type="text" name="phonenumber" /><br />
<input type="submit" value="Add Details" /><br />
</form>
</body>
</html>


 Create a new JSP file : Right Click on Info from Project Explorer => New => JSP File (Give Name as add.jsp) Insert the codes between body tag of the document.
add.jsp

<%@page import="java.sql.*" %>

<%@page import="java.io.*" %>

<%@page import="javax.sql.*" %>

<%@page import="java.sql.Connection" %>

<%

String username=request.getParameter("username");

String password=request.getParameter("password");

String firstname=request.getParameter("firstname");

String lastname=request.getParameter("lastname");

String address=request.getParameter("address");

String pincode=request.getParameter("pincode");

String phonenumber=request.getParameter("phonenumber");

Class.forName("com.mysql.jdbc.Driver");

Connection con=DriverManager.getConnection
("jdbc:mysql://localhost:3306/db","nikisurf","nikisurf");

Statement st=con.createStatement();

String sql="insert into info
(username,password,firstname,lastname,address,pincode,phonenumber)

values('"+username+"','"+password+"','"+firstname+"','"+lastname+"',
'"+address+"','"+pincode+"','"+phonenumber+"')";

int flag=st.executeUpdate(sql);

if(flag==1)

{

out.println("Added!");

}

else

{

out.println("Failed");

}

response.sendRedirect("show.html");

%>

Create delete.html

<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Insert title here</title>
</head>
<body>
<form action="delete.jsp" method="post" >
Enter First name to delete:<input type="text" name="username" />
<input type="submit" value="delete" />
</form>
</body>
</html>

delete.jsp

<%@page import="java.sql.*" %>
<%@page import="java.io.*" %>
<%@page import="javax.sql.*" %>
<%@page import="java.sql.Connection" %>
<%
String username=request.getParameter("username");
Class.forName("com.mysql.jdbc.Driver");
Connection con=DriverManager.getConnection
("jdbc:mysql://localhost:3306/db",
"nikisurf","nikisurf");
Statement st=con.createStatement();
try
{
st.executeUpdate("DELETE FROM info WHERE username = '"+username+"'");
boolean flag=true;
if(flag==true)
{
out.println("Deleted");
}
else
{
out.println("Not possible : error!");
}
}
catch(Exception e)
{
out.println("Exception");
}
%>

show.html

<form action="show.jsp" method="post">
Enter User name
<input type="text" name="username" />
<input type="submit" value="show details" />

show.jsp

<%@page import="java.sql.*" %>

<%@page import="javax.sql.*" %>

<%@page import="java.sql.Connection" %>

<%

String username=request.getParameter("username");

Class.forName("com.mysql.jdbc.Driver");

Connection con=DriverManager.getConnection("jdbc:mysql://localhost:3306/db","nikisurf","nikisurf");

Statement st=con.createStatement();

String query="select * from info where username='"+username+"'";

ResultSet rs=st.executeQuery(query);

%>

<%

while(rs.next())

{

%>

<table border="2" bordercolor="#2494b7">

<tr>

<th>UserName</th>

<th>Password</th>

<th>First Name</th>

<th>Last Name</th>

<th>Address</th>

<th>Pin code</th>

<th>Mobile Phone</th>

</tr>

<tr>

<td><%=rs.getString(1)%></td>

<td><%=rs.getString(2)%></td>

<td><%=rs.getString(3)%></td>

<td><%=rs.getString(4)%></td>

<td><%=rs.getString(5)%></td>

<td><%=rs.getString(6)%></td>

<td><%=rs.getString(7)%></td>

</tr>

</table>

<%

}

%>
Run JEE Eclipse Info Project
To run tomcat server with Eclipse : Right Click on Info from Project Explorer =>Run as => Run on Server


Publisher Guide : AdMob Account Disabled What's Next



          AdMob is a perfect comrade of mobile app publishers nowadays mobile advertisement industry is growing tremendously. When it comes to Smartphones like Android based or even iPhone, Ad serving programs are really worthy for advertisers to reach very large audience. You can monitor impressions and ad clicks through AdMob web application after the ad installation. If proper AdMob installation is missing, you won't be able to get impressions or clicks. You can follow better app optimization techniques to grab more app users. I have got many queries from visitors who like to implement admob ads on their apps, Foreseeing revenue is very difficult task because it depends on a lot of factors that includes AdWords value, RPM etc. In this tutorial I'm going to unveil how to protect your admob account from invalid activities. You might be wondering why the tips are so important. Google will take strict action against invalid operations for protecting their Adwords advertisers. So keep in mind some AdMob tips before you integrate it on your app.

admob invalid activity guide



admob account disabled android publisher

The number of ad units on a single page is limited to one. So make sure that you haven't added more than one on a single screen or page.
#2 Scroll View & multiple screens
If the page scrolls, only one ad should be visible on user screen at a time. If you want to implement one more ad unit to same page content you should separate the content with multiple activities (android context).
#3 Avoid hidden Ad-units in Page
When you implement admob make sure that you haven't included it in hidden fields of application.
#4 Ad-Placement at navigation area
Don't place your ad at navigation area of application, and regular interaction area of user interface.
It infringes Google Admob Policy because there is a close chance to click ad unit without user interest.
#5 Avoid Force to Click
Ad should n't be placed for switching next page, force to click method compels users to click ad unit to forward another page or activity.
#6 Don't place ad unit in a blank page
It is not fruitful way for publishers because blank page doesn't grab more audience. Blank page with ad is an annoying thing for users. Please try to avoid it.
#7 Ad Unit - on Menus
It will infringe admob policy so do not place ad on a 'dead end' screen. Placing ad unit in context menu is not feasible way.
#8 Do not include Adsense ads 
Adsense and Admob have several exceptions in policies. So you don't want add adsense responsive ad to mobile application. Google no longer allow Adsense ads to appear in mobile context.
#9 Do not modify Adunit
You have only limited modification over ads so make sure that you haven't altered native features of Admob (Google Play Store Services) SDK. Publishers cannot be shared source of Google SDK code or library.
#10 Syndication and ad network
Publishers don't want to enter the sub syndication; Ads are served through Google Adwords program. Understanding Adwords policy will add more confidence to publishers to start monetization.
How can you appeal for Admob Account for re-initiating?
Google always welcomes client queries, you can forward an appeal to Google for re-initiating your account.
If you feel you haven't made any policy violation fill the appeal form of admob. After reviewing your request Google will send you the account status.