I just implemented the ad-network, Leadbolt, into my android application. Im using the HTML Banner as my adtype. And I would like some kind of fallback solution if Leadbolt fails to load use Admob instead etc.
Bringing Leadbolt html ads is done via a webview and you pass in a URL to the webview and the ad is shown within.
This is the code:
wv.getSettings().setJavaScriptEnabled(true);
wv.setBackgroundColor(Color.TRANSPARENT);
String html = "MY_ID";
wv.loadData(html, "text/html", "utf-8");
I also have set my Webview (wv) set on: setWebViewClient, so I get callbacks but even if I dont have any internet connection I get the callback OnPageFinished so im unable to se if my ad has loaded or what has been done.
Does anyone have any advice how to do this, to help me with a fallback solution?
Thanks!
Check your www.adwhirl.com
With the SDK and homepage you can create new "Apps" with a fallback hierarchy. All you need to do is, create a custom event on adwhirl, implement the method for calling your ads on leadbolt add your publisher id to admob settings and set up the fallback hierarchy.
Hope this helps. Good luck.
Related
So, I'm being able to disable the device using the AMAPI(Android Management API), but I want to let the user know why his device is being disabled, so I started looking for a way to show why the device was disabled and I found the "disabledReason" property, but it's not working, or I don't know where is displaying the reason that I set.
If you know where is displaying or how to display the disabledReason I will be very thankful.
device.setState("DISABLED");
UserFacingMessage reason = new UserFacingMessage();
reason.setDefaultMessage("Reason why your device was disabled...");
device.setDisabledReason(reason);
androidManagementClient
.enterprises()
.devices()
.patch(device.getName(), device).execute();
There is an issue when using the disabledReason field in AMAPI. There is no message displayed on the device indicating why the device is disabled, and this issue has not yet been resolved, but you can see it on your JSON response if you set a customized disabledReason.defaultMessage.
I am trying to implement a PayPal Vault Braintree payment solution. But since it is a "redirect" process via Chrome Custom Tab, I am having trouble finishing the process. This because in Paypal Web version, the "data response" returns in URL to be used. However, on Android I cannot achieve the same result since the Chrome Custom Tab Works in parallel to the application.
The documentation talks about some listeners that are supposed to work automatically and also about some handlers that can be added manually. However, I don't know how to trigger these listeners and I was also unable to implement a "response" in the handlers.
For now I can open the PayPal page and finish the authentication and authorization, but I do now know how to get data from response.
Anyway, any help would be cool.
Thank you.
The function opening the Chorm Custom tab:
public void startBillingAgreement() {
PayPalRequest request = new PayPalRequest()
.localeCode("US")
.billingAgreementDescription("Your agreement description");
PayPal.requestBillingAgreement(getBraintreeFragment(), request);
}
The process guide (they say about the onPaymentMethodNonceCreated function, but i do not know how to)
The listeners guide
I'm working in a notification app for Android and my customer has requested me to insert a video inside the notification preview.
I know that I'm able to create notifications with pictures and notifications with custom views, but when I try to add a video to the custom view my app gives me always this error:
FATAL EXCEPTION: main
Bad notification posted from package com.codeversed.example.Notifications: Couldn't expand RemoteViews for: StatusBarNotification(pkg=com.codeversed.example.Notifications user=UserHandle{0} id=0 tag=null score=0 key=0|com.codeversed.example.Notifications|0|null|10008: Notification(pri=0 contentView=com.codeversed.example.Notifications/0x1090089 vibrate=default sound=default defaults=0x7 flags=0x18 color=0x00000000 originalPackageName=N originalUserId=0 vis=PRIVATE))
I suppose that is it because videos aren't allowed to remote views. Does somebody know if this limitation can be sorted or if there is a way to show videos on notifications?
Regards,
No, you cannot show a video in a Notification. Partially, that is because RemoteViews does not support a SurfaceView, TextureView, or VideoView that you would need. Partially, that is because the party responsible for showing the video may not have rights to do so (e.g., may not have Internet access). Remember that you are not the one actually showing the Notification — somebody else is. You merely provide the specification.
My application often used WebView as core. My websites are deployed in 3 different host for increase the availability of service. How to handle switching the websites efficiently if one of them is down or cannot reach. Assume the websites url are url1, url2 and url3 respectively. For Example if webview.loadUrl(url1); bring any error result, It should switch to another.
Thanks
Android WebView onReceivedError()
may be will help you.
when you use onReceivedError to handle your problem, you could switch you url in the override function.
Sorry for the vagueness of my questions here, but I wanted to know if it was possible to login into this website https://oyster.tfl.gov.uk/oyster/entry.do through an a native phone app?
I've seen many apps which access data for the Oyster Card but there is no API for them to access this data and can only think they've logged into the website using the users details then extracting the necessary text to display within their app.
Here is a sample app alongside what the actual website looks like once logged in;
Sure it is, here is an example using WebView:
webview.getSettings().setJavaScriptEnabled(true);
webview.loadUrl("https://oyster.tfl.gov.uk/oyster/entry.do");
webview.setWebViewClient(new WebViewClient() {
public void onPageFinished(WebView view, String url) {
view.loadUrl("javascript:document.getElementsByName('j_username')[0].value = '"+ausername+"'");
view.loadUrl("javascript:document.getElementsByName('j_password')[0].value = '"+apassword+"'");
view.loadUrl("javascript:document.forms[0].submit()");
}
});
This will show the common desktop version of the website but if you want a dedicated app for the site, it would be preferable with some sort of API for the site. Without an API, you are left with either the common desktop website, or DOM manipulation of the received html using regular HTTP requests.