# Is there a way to load admob ads in an animation thread like draw()?

**URL:** https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566
**Category:** Processing for Android
**Created:** [July 12, 2020, 9:36am UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566 "2020-07-12T09:36:39Z")
**Posts on this page:** 11
**Page:** 2

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 1:31pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/21 "2020-07-30T13:31:34Z")

</div>

@noel === Enabled verbose output both in general and for build;  
Pasted the permissions you gave me in the Manifest and checked them in the Sketch Permissions (i couldn’t find the one named ACESS\_COARSE\_UPDATES though)  
The app still crashed.

---

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 1:58pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/22 "2020-07-30T13:58:15Z")

</div>

@noel === wait, where exactly does APDE store the created apk files when you run it in the app mode? Is it only the “build” folder? I noticed that the console said “failed to delete old apk file” after the app crashed this time so i deleted it myself from the “build” folder, for APDE to create a new one. After running it again, the app doesn’t even start anymore and the console still says “failed to delete old apk file”, even though the “build” folder contains 0 apk files. Either APDE didn’t even create an apk this time or there’s some kind of other folder that i don’t know of.  
Anyway, just in case, i also exported signed package through the “tools” menu, installed the apk from the “bin” folder, still crashed.

Edit: found it, unchecked “Build on Intermnal Storage” and it got saved in a different place. After i install the app by running APDE in app mode the app crashes and the console stays empty. No errors, nothing.

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [July 30, 2020, 2:30pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/23 "2020-07-30T14:30:58Z")

</div>

Only root. /data/data/com.calsignlabs.apde/app\_build

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [July 30, 2020, 3:09pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/24 "2020-07-30T15:09:51Z")

</div>

The actual apk when exported is located in sketchbook/your\_app/bin

---

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 3:23pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/25 "2020-07-30T15:23:11Z")

</div>

@noel ===  
@akenaton ===

Ok guys i finally solved it. With AS.  
Here’s what i needed to do in order to solve the AS gradle issue:

> <https://stackoverflow.com/questions/48335551/could-not-resolve-com-android-tools-buildgradle3-0-1/48335690#48335690>

  

> <https://stackoverflow.com/questions/24795079/error1-0-plugin-with-id-com-android-application-not-found/25232725#25232725>

  

> <https://stackoverflow.com/questions/56620228/error-failed-to-resolve-com-android-supportappcompat-v729-0-0/56627866#56627866>

  

> <https://stackoverflow.com/questions/56821250/error-package-android-support-v7-app-does-not-exist/57130369#57130369>

  

> <https://github.com/aseemnishad/react-native-android-scanner/issues/2#issuecomment-490010990>
>
> After having removed the android:allowBackup="false" line from my AndroidManifest.xml file, which prevented me to compile this project, I'm now facing the...

  
Thank you both VERY much for your help and your patience!  
Sorry for wasting your time trying to solve it with APDE.

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [July 30, 2020, 3:30pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/26 "2020-07-30T15:30:52Z")

</div>

> [@superspacespaghetti](#):
>
> trying to solve it with APDE

I still want to try this, but I can’t figure out the error I mentioned above. I unzipped the jar, and the java class files are present and in the right folder structure, according to the import. If I remember well(don’t know if this has changed), at the moment only APDE is capable to store the app on the Play Store.

---

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 3:41pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/27 "2020-07-30T15:41:24Z")

</div>

Do you still have the " Only a type can be imported. com.google.android.gms.games.stats resolves to a package" error? If so, i can just send you a link to the full folder with the manifest, code, the jar file, etc. The working version.  
And i don’t know if you can only store the app with APDE, but i have already personally uploaded my app to google developer console and it looks just fine. In order to do it you just need to export the apk file to your computer and simply drag it to google dev console window.

---

<div class="post-metadata">

### Author: ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)
#### Post date: [July 30, 2020, 3:43pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/28 "2020-07-30T15:43:53Z")

</div>

Yes please…

---

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 3:44pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/29 "2020-07-30T15:44:26Z")

</div>

Ok! I’ll clean it up a bit and send you the link!

---

<div class="post-metadata">

### Author: ![superspacespaghetti](https://avatars.discourse-cdn.com/v4/letter/s/97f17d/32.png) [@superspacespaghetti](https://discourse.processing.org/u/superspacespaghetti)
#### Post date: [July 30, 2020, 4:02pm UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/30 "2020-07-30T16:02:37Z")

</div>

@noel === here you go:

> **[test.rar](https://drive.google.com/file/d/1gb_tmORAVEef2TFAeIOSu9ix3q7z1172/view?usp=sharing)**
>
> Google Drive file.

---

<div class="post-metadata">

### Author: ![NoName](https://avatars.discourse-cdn.com/v4/letter/n/58f4c7/32.png) [@NoName](https://discourse.processing.org/u/NoName)
#### Post date: [August 31, 2020, 2:08am UTC](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566/31 "2020-08-31T02:08:44Z")

</div>

Hello, you were able to add ads using only APDE?

Can I link to your application in the market?

I will soon need to make an advertisement in my program, and I am looking for instructions on how to do this using only Apde.

could you help me?

[Previous page](https://discourse.processing.org/t/is-there-a-way-to-load-admob-ads-in-an-animation-thread-like-draw/22566.md?page=1)
