Insert an interstitial banner in a libgdx project that produces both android ios ( robovm ) - libgdx

I opened this question because I would like to do a bit of clarity on how to add an interstitial banner using AdMob in a libgdx project AndroidStudio.
I state that : I followed several tutorials ... I installed Playservice google .. but I can not understand why some classes I did not find them despite importanto everything you need .
So , I created my ID app to connect it to the banner via the convenient panel AdMob Google
i can try follow this tutorial: AdMob Integration
I am not clear how to add the class : InterstitialAd
In practice, I have only created the confusion..some using external projects , other strange libraries :) And ' possible to write lines of code as they should be allowing me to show or hide the banner ? nothing more complicated.
My goal is to create the banner ( both of ios ( robovm ) and on Android ) , and remove it after a timer ... but I 've come too confusion..should clarify ideas on the operation . It ' the first time you use the services ads in an app . Thank you

If you intend on using a library, go to the original documentation rather than grabbing some probably out of data and potentially unreliable tutorial that you found online.
Try https://developers.google.com/admob/ instead.

Related

Android Studio Gradle error: Missing project_info object

basically opening this question again because the answer is outdated, as the link now redirects to Firebase:
Gradle fails building with "Missing project_info object"
I want to attach the google-services.json file to my Android Studio project, and every time I try to download it from the developers API from Google, it gives me a json file with a large name that does't correspond to the tutorial's simple "google-services" and renaming it won't work because of this error.
Downloading it creating a new project doesn't seem possible for me now as it the page gives me another error when I click Configure a Project (I already did that before but left the project there without downloading the json file directly from there, which seems to be the problem).
Where can I safely get this file, and should I rename it or? Thanks in advance.
Apparently the solution is just following the link and creating the project with Firebase:
Then create or select a project and fill it with your app data that shoul look like this (the SHA-1 key should be found in your console log when clicking the button in the image:
Then add the lines of code that should be in your build.gradle(app level one and project level one), editing them with notepadd. Finally you need to sync these Gradle files, in Android Studio : File->Sync project with Gradle Files
The tutorial is very self explatanory, but for beginners like me, this could help.

Codenameone Android build with certificate and maps lib fails

While trying to tackle the native map not showing problem, I was experimenting with building Android app with certificates. I used a simplify test where the source contains only:
Form hi = new Form("Welcome", new BorderLayout());
MapContainer c = new MapContainer();
hi.add(BorderLayout.CENTER, c);
hi.show();
, and relevant build hints:
codename1.android.keystore=...
codename1.android.keystoreAlias=...
codename1.android.keystorePassword=...
codename1.arg.android.debug=false
codename1.arg.android.GoogleMaps.minPlayServicesVersion=9.4.0
codename1.arg.android.playService.maps=true
codename1.arg.android.release=true
codename1.arg.android.xapplication=<meta-data android\:name\="com.google.android.maps.v2.API_KEY" android\:value\="AIza......."/>
codename1.arg.android.playService.maps=true
I used certificate generated through the CN1 generator. Before adding the certificate, the build went fine without any complaints, but after adding the certificate, build failed with a similar error log as in another question with parse CN1Lib. This is the complete error log.
I'd like to know if this can be resolved or do I need some workaround for it? Thanks in advance.
Edit:
I'm not sure if this help, but the issue can be reproduced through:
Create a new cn1 project (I used Eclipse Oxygen), then install native Google maps plugin and refresh cn1lib as instructed
In the start(), add a new MapContainer to the form with BorderLayout in Center
Add the build hints as instructed in github for the native maps cn1lib
Add Android certificate in cn1 settings
Build the project
Things that are not mentioned are left in default state
Sorry about that issue, we pushed out a bad update as part of refactoring work. I've pushed out a fix just now and it should be available for update.

LibGDX: Gwt logging not working in my project

Don't worry, I'm not asking you to fix all my bugs, I just wanted to know common causes for gwt/html logging to not work.
Here is my project:
https://github.com/vedi0boy/Archipelo
I cannot get logging to work at all in html. I used this code in a brand new LibGDX project and it worked (inside the main class):
#Override
public void create () {
Gdx.App.setLogLevel(Application.LOG_DEBUG);
Gdx.app.log("Test", "Test log message.";
}
I just don't get it. Is there something common that could be making basic html/gwt functions not work? My libgdx is update to 1.9.2. I can't seem to figure out why it works on a new project but not mine.
What should I do? Should I attempt to copy all the code to a new project? Thanks.
P.S. I am also unable to use a networking library that I need, and it also works on a brand new project.
The solution was simple. I made a while loop that did not continue until a connection to the server was established. Since javascript is single threaded, it got caught in an infinite loop.
The reason this has to do with logging is because LibGDX only loads up the log box when create is finished being run and my infinite loop was in create so it never got around to rendering the logs.
Lesson: Don't treat JavaScript as a multi-threaded language when using GWT, because it isn't.
You don't need to copy all your code to a new project, if you have doubts about your LIBGDX version you can update your corruent project to a recent V of libgdx,
use the build.gradle like follow :
gdxVersion = "1.5.2" // your gdx version here
for more info read this topic in the official WIKI

writeablebitmap in windows phone 8.1

I create universal project type in vs 2013 for 8.1.
In windows phone project i added reference to WriteableBitmapEx via nuget. In references i see WriteableBitmapEx.WinRT. I write code which creates WriteableBitmap from content (use image in project with Content and Dont copy properties). Next i create Image and set source to WriteableBitmap and add image in LayoutRoot grid. In emulator i see this image, thats ok!
Next i call DrawLine method from WriteableBitmap and call WriteableBitmap.Invalidate().
I dont see my line...why?
1) Why reference name ends with .WinRT, is this normal?
2) Why invalidate method not work?
NOTE: in windows phone 8 project (not universal) all works properly! And reference name not ends with .WinRT.
Help me please!
As already said in my comment, I had the same problem. After hours of confused searching, I finally found this trivial reason:
For universal apps, there are actually two projects: MyProject.Windows and MyProject.WindowsPhone. You need to add the nuget package for both of them (they have separate references) and everything will work.

XamlParseException with amCharts on WP8

I have tried to add a chart to my WP8-App, but there is some problem. I added a SerialChart with this small line of XAML-Code:
<charts:SerialChart ></charts:SerialChart>
This code is working fine when inserting it into an empty project. (Of course nothing is displayed, but also no exception).
But when adding it to my project - where I use Caliburn.Micro as MVVM Framework - I always get a
System.Windows.Markup.XamlParseException: Unknown parser error: Scanner 2147500037.
at the InitializeComponents-Method.
Has anyone also used amCharts and Caliburn together and had any problems?
Ok. It was easy to solve...
My project is splitted into serval sub projects and the xaml-pages were in such a sub project.
Now I just had to also add a reference to AmCharts in the main project and it worked.