Detecting first launch with Tiny DB

Even if we offer a built-in block that detects first launch, we would use this method. However, by using blocks assembled by your own, you can detect N number of launches.

That is True

1 Like

0 = first run? no
1= first run ? yes

1 Like

There is a problem.

The value of the tag “first” here will always be “0” in the if checks.

1 Like

change to blocks queue

blocks%20(2)
first check and next change to 0

1 Like

You can also use boolean values like this.

Edit: It doesn’t make sense to store value if the tag is there and has same value (false)

1 Like

@pavi2410 So, will https://community.makeroid.io/t/detecting-first-launch-with-tiny-db/7340/12?u=turboprogramming (12) work?

Yes

1 Like

@pavi2410 @Yusuf_Deniz Thank you both for helping me, really appreciate it.

1 Like

Screenshot%20(22)

2 Likes

@pavi2410: @hammerhai’s response or @Yusuf_Deniz’s response?

Not to be rude @Yusuf_Deniz but, with your response, the Tag will not stay in the Datastore, however with a variable it will…

@hammerhai’s more preferable because of this

1 Like

Umm, it will.

It actually should be the opposite.

1 Like

That doesnt make sense then because, your device can’t hold a value with a tag that has a text block, it has to find a specific path to store that value, which is the variable.

Umm, let’s think like this. I let my app know that user has disabled ads by purchasing a pack with Tiny DB. And it works fine, until they delete the app and re-install it, as variables will be deleted too.

As you can understand from their names, they are “variables” and they can change easily over time. But Tiny DB stores something that doesn’t change so often.

The same goes with a Text Block, if you were smart enough and thought of storing the value in a txt file that’d be safer. You should read this: Defining Global Variables in Android – Android Research Blog

OK, I have a better solution.

@Makeroid, give us some suggestions about this.

1 Like