I have a more of a tactics question
In my app i often get failed to load ad error code 3
My app is not banned , my admob account is fine i know that this error means that google has no ads to offer BUT
My question is what should i do after i get this error
1) Should i keep asking for ad with the code below? If i keep asking i finaly get an ad but shouldnt this will lead to app ban?
public void onAdFailedToLoad(int errorCode) {
// Code to be executed when an ad request fails.
mInterstitialAd.loadAd(new AdRequest.Builder().build());
}
2) Should i mediate with other networks?
3) Should i do nothing of the above and let my app mature and get more ads from google ?
4) is it true that according to the audience and app oldines google is providing more ads?
Thank you in advance
If you read mentioned post, you can see answers. Related Post
A1:
If you are getting this error, then your code is correct. The issue is
that AdMob does not always have an ad to return for every request.
A2:
Another reason your fill rate may be low is that you don't have
AdSense backfill enabled, or you have filtered out some ads. Check
your app settings to see if that is the case.
A3:
Questions 3 and 4 same. This is not about oldines or maturity.
Related
Problem: Attempting to read accounts created via AccountManager API in Android via a TWA LauncerActivity.
I'm aware that some native functionality isn't possible in Android, and if I am attempting something that is impossible please link me a resource. I haven't came across anything explicitly about account manager access.
I have confirmed I have accounts on device, and am attempting a print out to Logcat of all of the accounts, but I am returned no results:
private void printAccounts() {
Account[] accounts = AccountManager.get(this).getAccounts();
Log.d("FoundAccount", "Total accounts: " + accounts.length);
for (Account account : accounts) {
Log.d("FoundAccount", ": " + account.name);
}
}
Resulting output via Logcat: D/FoundAccount: Total accounts: 0
Any resources would be greatly appreciated, thank you!
After running the exact same code in a pre-existing Android application, the accounts were pulled right away for Google and custom third party accounts. Safe to say this functionality doesn't exist for TWAs... if anyone else has any links to the documentation for this, I would say that is still pertinent information, but for the sake of answering this question for anyone else seeking an answer to the same question.... the answer is no, this functionality is not possible, at least at this time.
The context:
I use AdMob mediation to display banner ads in my app.
I integrated Millennial ad network SDK and Millennial AdMob adapter.
Problem: my app supports Android API 9+, whereas Millennial SDK supports API 16+. Worse, instead of gracefully failing (returning no ad to the AdMob mediation layer so that it can continue going down the mediation waterfall), the SDK crashes on devices running Android < 16 (Fatal Exception: java.lang.NoSuchMethodError
android.webkit.WebSettings.setAllowUniversalAccessFromFileURLs)
Apparently Millennial developers are not planning to fix this, they recommend publishing 2 distinct APKs ("<16" without their SDK and "16+" with their SDK), which is a troublesome solution.
I would prefer a simpler solution: on devices running Android API < 16, I'd like to reproduce what happens when an AdMob adapter is missing: AdMob mediation just goes to the next network.
This would mean unloading or erasing the Millennial adapter class before I instantiate the AdMod mediation banner.
The question:
Is there any way to prevent any future instantation of a given class (from a 3rd party library) at runtime? (e.g. by forcing a ClassNotFound exception)
Use two ad units. You can set up two banner ad units at AdMob.com, one with MillennialMedia in the mediation stack and one without. You can then check the API level of the device at runtime as Bonatti suggests, and set the ad unit ID on your AdView as appropriate prior to requesting ads.
If MillennialMedia is not in the mediation configuration for the ad unit being used, their adapter will not be instantiated by the Google Mobile Ads SDK.
I am exactly in the same situation as you.
After doing a lot of research and black magic with class loaders, etc., I've found a dirty but working solution:
// At onCreate() or wherever it makes sense
if (Build.VERSION.SDK_INT < 16) {
// Must be done before requesting the first ad
disableMMediaAdapter();
}
m_adView.loadAd(adRequest);
// ...
private void disableMMediaAdapter()
{
try {
Field fInitialized = MMSDK.class.getField("initialized");
fInitialized.setAccessible(true);
fInitialized.set(null, true);
} catch (Exception e) {
e.printStackTrace();
}
}
By tricking the SDK into believing it's initialized it will fail miserabily when an ad is requested through it and the next mediation adapter will be called.
This will work as long as they don't change their class desing too much.
Is there any way to prevent any future instantation of a given class at runtime? (e.g. by forcing a ClassNotFound exception)
You can, before loading the Adapter, check the OS version, and if its below your threshold
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.THE_VERSION_I_WANT_MINIMUM) {
// doStuffs()
} else {
throw new MyException("Stuffs have stuffened...");
}
For the last two days I am trying to figure out this issue but so far i've been unable to solve it. I am successfully creating/deleting Recurring profiles in Paypal Express checkout(sandbox mode).Now im facing issues with the direct payment. Yesterday I created two profiles using the following piece of code and got the responses as shown below. Unfortunately my account activity isnt showing any of this profile creation. Can you tell me why? At the same time I created it with express checkout and that activity is present in my account.
Any help is highly appreciated.
encoder.add("VERSION", "86.0");
encoder.add("METHOD","CreateRecurringPaymentsProfile");
encoder.add("DESC","Cloudstream10UserPack");
encoder.add("INITAMT","25.29");
encoder.add("FAILEDINITAMTACTION","ContinueOnFailure");
encoder.add("BILLINGPERIOD","Day");
encoder.add("BILLINGFREQUENCY","1");
encoder.add("PROFILESTARTDATE","2015-06-04T00:00:00Z");
encoder.add("CURRENCYCODE","USD");
encoder.add("COUNTRYCODE","US");
encoder.add("MAXFAILEDPAYMENTS","3");
encoder.add("AMT",amount);
encoder.add("CREDITCARDTYPE",cardType);
encoder.add("ACCT",acct);
encoder.add("EXPDATE",expdate);
encoder.add("CVV2",cvv2);
encoder.add("FIRSTNAME",firstName);
encoder.add("LASTNAME",lastName);
response
{VERSION=86.0,
BUILD=16837281,
TRANSACTIONID=03H59687N1667990E,
PROFILEID=I-4K9NPGAHRM34,
PROFILESTATUS=PendingProfile,
ACK=Success, CORRELATIONID=2f485d30ec1f4,
TIMESTAMP=2015-06-03T08:25:38Z}
In the second profile I removed INITAMT and FAILEDINITAMTACTION and got the following response:
{VERSION=86.0,
BUILD=16837281,
PROFILEID=I-W0CRGLBCJTBB,
PROFILESTATUS=ActiveProfile,
ACK=Success,
CORRELATIONID=6002b88159503,
TIMESTAMP=2015-06-03T11:58:02Z}
I made third profile right now and got response and when I check the activity I got nothing updated
{VERSION=86.0,
BUILD=16837281,
PROFILEID=I-YV4LTS1JGUJ1,
PROFILESTATUS=ActiveProfile,
ACK=Success,
CORRELATIONID=c322b816c1403,
TIMESTAMP=2015-06-05T07:25:41Z}
I released my Android app two days ago, using admob advertising. I used my personal phone as the test phone, but took out the test mode code before releasing it. My admob status is active and I get requests and impressions on the report, but whenever I try to use the app on my personal phone i only get "test ads". I don't know why. I looked through the code of my app and can't find anything amiss. And i did delete the test version of the app and then download the released version from the market.
I'm not sure why the test ads are appearing in your app, but one way to shut them off is to go to your Admob App Settings, and choose the option "Disable test mode for all requests" as your Test Mode setting.
You customers would not have been seeing the debug ads. You probably have a line like:
AdManager.setTestDevices( new String[] {
AdManager.TEST_EMULATOR, // Android emulator
"E83D20734F72FB3108F104ABC0FFC738", // My T-Mobile G1 Test Phone
}
Assuming E83D20734F72FB3108F104ABC0FFC738 is you're personal phone, any time that phone makes a request it will get a test ad. All other phones will not be eligible for test ads, unless they are also individually added to that method.
Nick's answer works. (But is missing the final parenthesis.)
But what if I want to give my (not yet released) Android app out to 10 friends?
Is there any java code that says "treat ALL phones as test devices"?
Here is code for treat all devices as test devices:
String aid = Settings.Secure.getString(context.getContentResolver(), "android_id");
try {
Object obj;
((MessageDigest) (obj = MessageDigest.getInstance("MD5"))).update(aid.getBytes(), 0, aid.length());
aid = String.format("%032X", new Object[] { new BigInteger(1, ((MessageDigest) obj).digest()) });
} catch (NoSuchAlgorithmException localNoSuchAlgorithmException) {
aid = aid.substring(0, 32);
}
adRequest.addTestDevice(aid);
I have recently noticed that I keep getting a 403 error while doing twitter search. My application was working until couple of days back when i noticed the error.
I checked with Twitter & they say my IP is not blocked, I am also within the rate limit = about 60 search requests/per hour.
Here's how i was initializing the Twitter object -
private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance();
After i noticed the error, i tried the following & still no success -
private static Twitter TWITTER_CLIENT = new TwitterFactory().getInstance("user", "password");
Here's how i am searching -
TWITTER_CLIENT.search(new Query("#keyword1 OR #keyword2"));
I tried this URL (curl http://search.twitter.com/search.json?q=ipad) from my server & it works alright.
Following is the exception. I am on java6 + Twitter4j v2.1.2. Would really appreciate any help. Thanks.
TwitterException{statusCode=403, retryAfter=0, rateLimitStatus=null}
at twitter4j.internal.http.HttpClientImpl.request(HttpClientImpl.java:301)
at twitter4j.internal.http.HttpClientWrapper.request(HttpClientWrapper.java:68)
at twitter4j.internal.http.HttpClientWrapper.get(HttpClientWrapper.java:82)
at twitter4j.Twitter.search(Twitter.java:193)
Most likely the reason is basic auth shutdown by Twitter (aka OAuthcalypse):
Basic Auth Shutdown
You need to switch to using OAuth.
Recently i got the same error while executing similar code.
To fix it, please go to
https://apps.twitter.com/app/your_app_id
Click on Keys and access token
In Access Level, click modify app permission and choose the 3rd option: Read, Write and Access direct messages
Click on update. ( Note: you might have to add your mobile no and verify with otp to get this access if you dont have your no added in twitter)
Regenerate both Consumer key & secretand Access token & secret using the clickable button
Us e the new keys in your program
And you are done! Your program will start working.