Android Question Firebase AdMob increase the CPU usage dramatically

Status
Not open for further replies.

artsoft

Active Member
Licensed User
Longtime User
Hi dears!

Today I added a new admob banner in my main activity and for this I had to load the relevant lib into my project.

After this, my CPU usage increased to this value:

CPU.png


And this always ...... while not working with B4A.
The CPU fan is blowing all the time :eek: ... šŸŒŖ ... Sometimes values up to 57% CPU usage ... Grrrr!

What's happen here?
What could I do to avoid this?

My Java version is 1.8.

Updated: When I try to compile my app (RELEASE or DEBUG) ... the B4A processbar hangs at about 70% (DEX optimizer). The CPU FAN is blowing like a storm in my PC ... 60% CPU. Without firebase admob, the CPU usage is about 2-10%.

After trying to compile, I can see now 2 Java processes.... What is this!!!!!! So, I cant work with B4A...

CPU2.png
.

Thanks
ARTsoft
 
Last edited:

artsoft

Active Member
Licensed User
Longtime User
Found in
\AppData\Roaming\Anywhere Software\Basic4android\b4aV0.1.ini .... and in
\AppData\Roaming\Anywhere Software\Basic4android\b4xV5.ini

Value set to 4096 !!!!

Regards
ARTsoft
 
Last edited:
Upvote 0

artsoft

Active Member
Licensed User
Longtime User
Switch to Java 8 - 64 Bit in B4A

-------> Same effect :-(

How I can increase the JAVA HEAP for B4A??

Is there perhaps a B4A start parameter which can control the JAVA heap size?

Need help urgently...
 
Last edited:
Upvote 0

artsoft

Active Member
Licensed User
Longtime User
Cannot compile anymore ..... CPU now always to 85-97% ... if FirebaseAdMob LIB is loaded...

Cannot do anything on PC!
What happens here?????

After unload Firebase Admob ... the CPU usage: 5%

I changed the Java Options:

heap_error.png


I also changed Java's heap size:
JAVA_OPTS = "-Xms1024m -Xmx2048m"

No effect ........... :-(
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
close B4A, open the task manager and close all java.exe applications then try again.

make sure the ram value is still in the ini file. if B4A was not closed it might have written the default value to it again.
 
Upvote 0

artsoft

Active Member
Licensed User
Longtime User
close B4A, open the task manager and close all java.exe applications then try again.

make sure the ram value is still in the ini file. if B4A was not closed it might have written the default value to it again.

sorex, YESSSSSS you are right... Thanks a lot!

After closing B4A, the value in the INI file was reset to 512 by B4A ...... So first, I reset it too again to 4096 and I restarted B4A.

Compiling time (without errors :D ) was now increased to 49 seconds ... :rolleyes: !! What??? Very long time...

Ok.... Could be that I have to accept this time now.

Other question: regarding firebase.admob ...
Do you know which entry is needed for MANIFEST file while using Firebase.AdMob, I got this error:

java.lang.IllegalStateException: A required meta-data tag in your app's AndroidManifest.xml does not exist. You must have the following declaration within the <application> element: <meta-data android:name="com.google.android.gms.version" android:value="@Integer/google_play_services_version" />
Thanks again,
ARTsoft
 
Upvote 0

sorex

Expert
Licensed User
Longtime User
I think you followed an old tutorial, google play services is not required for firebase based admob ads
 
Upvote 0

artsoft

Active Member
Licensed User
Longtime User
I think you followed an old tutorial, google play services is not required for firebase based admob ads

Yes, you are right ....... Thx :)

I created a Firebase account with a connected AdMob ads banner ..... Waiting now for the activation ... ZZZzzz

Sometimes a little bit complicated, if you had no contact with these methods in the last few years.
 
Upvote 0

asales

Expert
Licensed User
Longtime User
Sometimes a little bit complicated, if you had no contact with these methods in the last few years.
Check this example that uses the new lib and methods:
 
Upvote 0
Status
Not open for further replies.
Top