# I need help making a census app and pet tracker

**URL:** <https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549>\
**Category:** Questions about Thunkable X\
**Created:** [November 3, 2020, 6:55am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549 "2020-11-03T06:55:18Z")\
**Posts on this page:** 20\
**Page:** 4

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 6:40am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/62 "2020-11-13T06:40:43Z")

</div>

![BlocksJPG](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/8/a8dff604e0305875168beac8ec27f03c55185866.jpeg)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 6:41am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/63 "2020-11-13T06:41:10Z")

</div>

It’s crashing immediately after the screen opens, so I sent these blocks.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 13, 2020, 9:09am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/64 "2020-11-13T09:09:01Z")

</div>

In your Location\_Sensor1 block, you are checking for an error but then setting the lat/lon values. The “set” blocks should be in an “else” section of the “if” block so that they only run if there is no error.

Put the “from Map1” set Latitude, Longitude and Zoom blocks inside the “then do” section of the “When Report Opens” block.

I would also recommend converting the lat/lon strings to numbers right away when you set the variable values no matter what (even if there’s an error). So set app lat to [green latitude block] + 0. And set app lon to [green longitude block] + 0. Then just use the variables alone in the addMarker block.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 10:56am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/65 "2020-11-13T10:56:39Z")

</div>

Thanks so much for the help! I was really worried because my troubleshooting skills are almost nil 😅

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 11:57am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/66 "2020-11-13T11:57:21Z")

</div>

Not working

 ![WhatsApp Image 2020-11-13 at 17.23.04](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/f/c/fc61c990d16412b27cb6edea08827e272a60a2c7.jpeg)  
 ![WhatsApp Image 2020-11-13 at 17.18.30](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/c/5/c501b7ee2fef4a485b2988eb0f0a156344e61d26.jpeg)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 12:03pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/67 "2020-11-13T12:03:46Z")

</div>

Maybe I need a personal API key for google maps?

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [November 13, 2020, 12:39pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/68 "2020-11-13T12:39:44Z")

</div>

There are several possible problems.

First and foremost, adding markers to a non-visible map causes Thunkable to crash. Always, everytime. Of course, having a visible map in the web app causes the web app to stop executing. ARGH! To solve this problem, I set the map visible = false at design time, then use the start event to make the map visible if it is not a web app.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/7/1/7192a542acfca0cd18c5677a16406eaf41ecd19c.png)

I have found the onMapReady to be unpredictable and I avoid it. It is possible that the onMapReady is occuring BEFORE the location sensor has gotten the location and set app lat and app lon. Try moving all of the blocks from onMapReady into the “then do” section of the Location Sensor.

Alternatively, in the onMapReady block, check to make sure that app lat and app lon have numeric values before adding markers.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/a/1/a13a20f4c2c98f6398d21fe1dbacd7e0e1896efd.png)

Happy Thunking!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 13, 2020, 12:44pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/69 "2020-11-13T12:44:26Z")

</div>

Thanks so much @drted!! But I just tried it, and it’s still crashing.

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 14, 2020, 8:21am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/70 "2020-11-14T08:21:30Z")

</div>

If something isn’t working and you can’t figure out why, you need to provide more information than just “it doesn’t work” or “it’s still crashing.” Screenshots are usually best, videos may be helpful, descriptions, examples of what you’ve tried, where it gets stuck, etc.

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 14, 2020, 9:48am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/71 "2020-11-14T09:48:58Z")

</div>

The first 2 screens (splash and introduction) move fine. As soon as the 3d screen (in which you fill the details of the dog and the message gets sent) opens, it crashes. I am sure that the map component is the one that’s causing it, because I tried after deleting it, and it worked.

> [@I need help making a census app and pet tracker](http://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/62):
>

I sent a screenshot of the blocks that most likely have caused it.  
@drted, I did what you said in your post, this is before that. I’ll try and take a video.  
Thanks!

---

<div class="post-metadata">

**Author:** ![drted](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/drted/32/92694_2.png) [@drted](https://community.thunkable.com/u/drted)\
**Post date:** [November 14, 2020, 2:13pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/72 "2020-11-14T14:13:05Z")

</div>

[codeswept](http://community.thunkable.com/u/codeswept),

As you app get more a more complex , you are going to need to develop a debugging strategy to solve complex problems. Most software development platforms have some sort of tracing system, but Thunkable does not. But you can create one yourself.

Here is what I use (or slight variations of this):

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/a/6a75193fb15a4ccd61149b72abf8fcb8d4f9fc0a.png)

First, create a label I usually put it at the top or the bottom of the screen. Set the height of the lable to fill contents and set the screen to scrollable. Don’t worrry if it messes up your layout, it is just for debugging. When the screen is production ready, just set the label to visiblle = false

At the begining of each event (click, select etc). Reset the label by setting it to some initial value  
 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/0/1/0193978dde242cfbf6c311a3d7731ff58b834098.png)

Then before each block, update the status by joining the current label value to a new value (get ready to do stuff) and a New Line

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/2/12e3085b7aca1a5bc271c6fae07031cc7b2691f8.png)

The output looks something like this.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/1/f/1f3ba086c7600b5447f7fc7bded1316f15ed7a5d.png)

Using this, you can track down what your blocks are doing and where the app is crashing.

If you have a section of code that is very complicated or is causing the entire app to crash (white screen), you can use an IF FALSE block to take out sections of code, then add them back in one at a time to isolate the problem.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/6/b/6b05daebb392e4539b1a218b1ad55f9a2e59b746.png)

Don’t get me wrong, asking questions to the thunkable group is great! But you knowledge about your app, and even some components, will eventually exceed the knowledge of those in the group. You will then need a strategy to solve these problems.

I hope these suggestions help. Feel free to DM me and I can share other debugging tips and tricks.

Happy Thunking!

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 14, 2020, 3:19pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/73 "2020-11-14T15:19:18Z")

</div>

Thank you very much, @drted!  
Will definitely check this out for debugging.  
Thanks again!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 14, 2020, 6:14pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/74 "2020-11-14T18:14:28Z")

</div>

Yep, really helpful suggestion, @drted. I often use that same strategy with wait blocks after each “set Text to” block. And since it’s a pain to change/remove the wait blocks over and over, I create a function. @codeswept, you can see an example of my “WAIT and report” function here: [Debugging in Thunkable X (Video)](http://community.thunkable.com/t/debugging-in-thunkable-x-video/849471)

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 16, 2020, 9:55pm UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/75 "2020-11-16T21:55:15Z")

</div>

@codeswept, I’m teaching a class on app development using Thunkable and one of my students today suggested making a tree identification app. It reminded me of your app idea so I did some Googling and found that Microsoft has an AI image recognizer that can identify dog breeds.

You can try it at [https://speciesclassification.westus2.cloudapp.azure.com](https://speciesclassification.westus2.cloudapp.azure.com). Type a search term in such as “labrador” and search for images. Then, click on an image and it will send that image to the service to classify it.

I just requested an API key from Microsoft for that service so if I get accepted, I’ll let you know how it works in Thunkable. You may want to request an API key as well.

 ![IMG_1006](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/4/d43dcb488bea3ccb643266e97e18fccf47ef8e02.jpeg)

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 17, 2020, 4:24am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/76 "2020-11-17T04:24:00Z")

</div>

Wow! Thanks so much for this. This is exactly what I’m looking for. I will try to request an API KEY as well. It has not juts classified as dog, or maybe brown dog, but as a labrador retriever. Thanks again!

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 17, 2020, 6:10am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/77 "2020-11-17T06:10:52Z")

</div>

I got some info from the director of the Microsoft AI Earth project but it’s over my head. I tried and tried and can’t figure out how to do a proper API call… yet.

These are the two documents he shared with me:

> **[species-classification-api-demo](http://dolphinvm.westus2.cloudapp.azure.com/ai4e/notebooks/species-classification-api-demo.html)**

> **[developer portal](https://aiforearth.portal.azure-api.net/docs/services/species-classification-v2/operations/predict)**

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 17, 2020, 6:23am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/78 "2020-11-17T06:23:25Z")

</div>

It’s gibberish for me too🤔

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 19, 2020, 4:23am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/79 "2020-11-19T04:23:54Z")

</div>

Hi!  
Did the director give you some information?

---

<div class="post-metadata">

**Author:** ![codeswept](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/codeswept/32/87755_2.png) [@codeswept](https://community.thunkable.com/u/codeswept)\
**Post date:** [November 19, 2020, 4:41am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/80 "2020-11-19T04:41:22Z")

</div>

![image](https://us1.discourse-cdn.com/flex015/uploads/thunkable/original/3X/d/b/dbb21b9cecc4aa62cd6599773cdf962c3e5c3b10.png)  
I’ve done away with the map, and tried a web-viewer. Now, it’s not exactly crashing, but the web-viewer is still blank. Is there anything I’ve missed in the screenshot above?  
Thanks,  
@codeswept

---

<div class="post-metadata">

**Author:** ![tatiang](https://sea1.discourse-cdn.com/flex015/user_avatar/community.thunkable.com/tatiang/32/55482_2.png) [@tatiang](https://community.thunkable.com/u/tatiang)\
**Post date:** [November 19, 2020, 4:48am UTC](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549/81 "2020-11-19T04:48:01Z")

</div>

No word from the director yet. I haven’t used the web viewer block so I’m afraid I can’t help you there.

[Previous page](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549.md?page=3)

[Next page](https://community.thunkable.com/t/i-need-help-making-a-census-app-and-pet-tracker/948549.md?page=5)
